Skip to main content

I have a json-file (see attachment) that contains the coördinates of a circular route. It looks like this:

{

 "segments": :{

  "geometry": {

   "type": "LineString",

   "coordinates": e

    /50.814103, 4.521174],

    450.81309, 4.521811],

    250.80626, 4.536902],

     50.80482, 4.538866],

    450.80573, 4.541452],

    050.80621, 4.543173],

    Â50.80705, 4.545501],

    Â50.80755, 4.546541],

    p50.80777, 4.546841],

    /50.80919, 4.547739],

    150.8096, 4.548199],

    550.81052, 4.550243],

     50.810663, 4.551096]

   ]

  },

  {

  "geometry": {

   "type": "LineString",

   "coordinates": o

    ;50.810663, 4.551096],

    Â50.81065, 4.555264],

    <50.81071, 4.555622]

   ]

  },

...

 

I want to convert it to an ESRI line feature class, but I'm stuck. The geojsonreader gives no error, but also no result as reader. 

 

Json-fragmenter gives me the list of vertices in an attribute, but I can't fix it to convert these points to vertices/line.

imageSomeone who can help me out?

Use a JSONFragmenter with the query  

jsond"segments"]
  • t"geometry"]
  • to get the individual geometry per segment, then use a GeometryReplacer set to GeoJSON to get the geometry from it.

    2023-03-27_13h33_12


    Use a JSONFragmenter with the query  

    jsond"segments"]
  • t"geometry"]
  • to get the individual geometry per segment, then use a GeometryReplacer set to GeoJSON to get the geometry from it.

    2023-03-27_13h33_12

    This is what I was looking for. Thanks a lot!!


    This is what I was looking for. Thanks a lot!!

    cheers:)


    This is what I was looking for. Thanks a lot!!

    Niels,

    To extract the nodes from the json-file, I did the following:

    imageThis works fine, but I assume there is an easier way to get the points (including their attributes)?


    Use a JSONFragmenter with the query  

    jsond"segments"]
  • t"geometry"]
  • to get the individual geometry per segment, then use a GeometryReplacer set to GeoJSON to get the geometry from it.

    2023-03-27_13h33_12

    Looking at the result, I see that the spatial location is not correct. The GeometryReplacer translates the .Lat,Long] to rX,Y] instead of lY,X]. The GeoJSON Geometry encoding has no possibility to change the axis order. Anybody an idea to solve this?


    Looking at the result, I see that the spatial location is not correct. The GeometryReplacer translates the [Lat,Long] to [X,Y] instead of [Y,X]. The GeoJSON Geometry encoding has no possibility to change the axis order. Anybody an idea to solve this?

    Yes I just found the same 🙂 The CoordinateSwapper can fix this.


    This is what I was looking for. Thanks a lot!!

    As always the are different approaches to solve these things. I attached a workspace which solves the segments in a more elegant way. The geometry in the nodes and unpaved segments is not in a default format, so this still need to be done manually.

    2023-03-28_10h17_24


    This is what I was looking for. Thanks a lot!!

    Where exactly in the FeatureReader do you define the queries for the output ports?

    imageI did this, but no succes:

    image


    This is what I was looking for. Thanks a lot!!

    This is correct, then under Parameters set Geometry Format to GeoJSON and set Geometry Key Name = "geometry".

    2023-03-28_11h05_26


    This is what I was looking for. Thanks a lot!!

    Thank s a lot, Niels. Works fine.


    Reply