Skip to main content
Solved

JSON MultiPolygon

  • March 2, 2017
  • 3 replies
  • 121 views

I'm very new to FME and sorry if my question is stupid.

There are some JSON data containing objects with multipolygon geometry on a single spline 256x256 with integer values of (x, y) as you can see in following example (just part of whole file of course)

{"HotspotMetaData":{"id":162011,"RenderedGeometry":{"type":"MultiPolygon","coordinates":[[[[0,231],[-3,228],[-9,233],[-6,236],[0,231]]],[[[1,227],[-1,225],[-6,231],[-3,234],[1,227]]],[[[3,224],[0,222],[-3,228],[0,230],[3,224]]],[[[8,229],[9,225],[0,222],[-1,226],[8,229]]]]}},"hintContent":"40 km/h","unit":"kilometers per hour","description":40}

See on JsonEditorOnline

As I can see it is very similary to GeoJSON except that "Rendered ...", but! First of all FME say me "There is no geometry". Ok, I can live without it. But I see no way how to access that multi-array of coordinates. I got all of that "HotspotMetaData.Id", "RenderGeometry.type" and all that "unit", "description" etc. But not that most necessary geometry. How can I get that and convert to MID / MIF or any other format, even if it is "Excell" with rows of something like this:

id

value

polygonxy16201140 km/h0023116201140 km/h0-3228....16201140 km/h1122716201140 km/h1-1225....

Any help will be appreciated!

Best answer by jdh

Extract the rendered geometry to an attribute, JSONExtractor: json["HotspotMetaData"]["RenderedGeometry"]

follow that by a GeometryReplacer with the geometry encoding as GeoJSON and the geometry source the attribute you created in the previous step.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • Best Answer
  • March 2, 2017

Extract the rendered geometry to an attribute, JSONExtractor: json["HotspotMetaData"]["RenderedGeometry"]

follow that by a GeometryReplacer with the geometry encoding as GeoJSON and the geometry source the attribute you created in the previous step.


  • Author
  • 5 replies
  • March 2, 2017

Extract the rendered geometry to an attribute, JSONExtractor: json["HotspotMetaData"]["RenderedGeometry"]

follow that by a GeometryReplacer with the geometry encoding as GeoJSON and the geometry source the attribute you created in the previous step.

thanks alot! Working fine and w/o any additional question, you are great :)


pbyhistorian
Contributor
Forum|alt.badge.img+3
  • Contributor
  • 12 replies
  • October 1, 2021

Extract the rendered geometry to an attribute, JSONExtractor: json["HotspotMetaData"]["RenderedGeometry"]

follow that by a GeometryReplacer with the geometry encoding as GeoJSON and the geometry source the attribute you created in the previous step.

Wow - my meticulous and determined chain of Transformers replaced by just two! Thank you.