Solved

Hi, does anyone know if there is a way to extract geometry from a feature as GeoJSON in an attribute (in general i'm using GeometryExtractor) but having access to the options that the writer gives? Specifically the file Structure options contained th

  • 19 January 2023
  • 3 replies
  • 2 views

Badge +5

We need this to be able to post the attribute to an API which requires one of the other File Structure types than the default

icon

Best answer by david_r 19 January 2023, 11:45

View original

3 replies

Userlevel 1
Badge +21

I'm not sure I fully understand the ask, but could you write to geojson with a featurewriter with whatever settings you need, and then reread that file in as text to get the json you need for the API?

Userlevel 4

Off the top of my head, there are two options:

  1. Use the JSONTemplater to generate the entire GeoJSON document, or
  2. Use the FeatureWriter to write the GeoJSON to disk, then read it back into an attribute, e.g. using an AttributeFileReader connected to the summary port, reading from the file referenced in the "_dataset" attribute.

 

Badge +5

Off the top of my head, there are two options:

  1. Use the JSONTemplater to generate the entire GeoJSON document, or
  2. Use the FeatureWriter to write the GeoJSON to disk, then read it back into an attribute, e.g. using an AttributeFileReader connected to the summary port, reading from the file referenced in the "_dataset" attribute.

 

Thanks, I think this is a slight omission from the GeometryExtractor but this solution works great, especially with AttributeFileReader in the mix

Reply