Skip to main content
Question

Extract geoJSON geometry from a complex JSON file

  • December 7, 2021
  • 5 replies
  • 406 views

webservicessia
Contributor
Forum|alt.badge.img+1

Hello,

How extract the geoJSON geometry from the attached complex JSON file?

The data model is a new one. So the supplementary attributes before "horizontalProjection" are right.

The goal is to display the shape of thousands other surfaces for verification.

Here is the code :

imageThanks for any information that could help.

5 replies

bradleyp
Contributor
Forum|alt.badge.img+2
  • Contributor
  • December 7, 2021

To get the to coordinates the JSONExtractor should take care of the job. This JSON Query returns the coordinates json["features"][*]["geometry"][*]["horizontalProjection"]["coordinates"]


webservicessia
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 7, 2021

Thank you @bradleyp​ .

Here is the result for the community :

image


webservicessia
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 7, 2021

but there is several features in the JSON file (see attached file) and all the extracted values are merged in the same attribute instead of a for each one.

So, I try this and I get the shape drawn of each one but without identifier :

image


webservicessia
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 8, 2021
webservicessia wrote:

but there is several features in the JSON file (see attached file) and all the extracted values are merged in the same attribute instead of a for each one.

So, I try this and I get the shape drawn of each one but without identifier :

image

and there could be several geometries per feature not encoded with multipolygon.

So more tricky.


bradleyp
Contributor
Forum|alt.badge.img+2
  • Contributor
  • December 8, 2021

Fun. My approach would be to first fragment the JSON (JSONFramenter) into features and the use the JSON Extractor to pull the needed attributes out of each feature. I've attached an example. My first time hopefully it works.😉


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings