Hi
I'm new to JSON and GeoJSON, but I have some text for a geometry generated by Mapbox coded as GeoJSON:
"{"type":"FeatureCollection","features":[{"id":"c2fc8b172269fb5b220d5661e804a7e5","type":"Feature","properties":{},"geometry":{"coordinates":[[[5.7289984618329015,58.97117391031097],[5.727435803187348,58.97244926566199],[5.725808033947516,58.97459712581869],[5.728542686566385,58.97520118738589],[5.729714680561443,58.974630685071816],[5.728868240463584,58.973858813964995],[5.728314798897173,58.9731876075123],[5.729193794339011,58.972449265591706],[5.730040234436871,58.971274597908206],[5.7289984618329015,58.97117391031097]]],"type":"Polygon"}}]}"
In my workspace I have added a creator with an attribute containing this text. I the add a Geometry-replacer and choose GeoJSON. Upon running the workspace I get syntax errors.
JSONFragmenter(JSONQueryFactory): A JSON syntax error was found at line 1, column 551
JSONFragmenter(JSONQueryFactory): Unexpected non-whitespace characters were found after the JSON text
The value of the import attribute 'geom2' contained JSON text, but could not be recognized as '%1'
However, the attribute is validated as correct JSON using the attributevalidator but not using the JSONValidator. "Unexpected non-whitespace characters were found after the JSON text" is reported. Meaning the " at the end of the text. Removing this does not remedy the situation.
Â
Whats weird is that if I store the text in a text-file and change the extension to JSON, the GeoJSON-reader in FME produces the described polygon, but also reporting about an unexpected character. If I remove it in the JSON-file the workspace generates the polygon without errors.
Â
My problem is that I want to store these text segments as an attribute, and later generate the geometry, not from a file using the reader, but ideally using the GeometryReplacer or similar.
Â
Anyone have an idea on what can be done?