Skip to main content

Hello,

With an URL, I Can create polygon with a json Extractor and a geometryReplacer but it's impossible to keep the attributes. I can't expose any attributes. I don't know how to do.

imageimage The Json looks like this

image 

Any idea?

Thank you so muche

You have to enter the names of the attributes you want to expose in that bottom box. For that, you either need to know what attributes can be there -or- check out one feature in the Feature Information Panel of Visual Preview (which shows more than the Table View)


Yes I know that but it doesn't work .It returns me nothing.

image


Yes I know that but it doesn't work .It returns me nothing.

image

Hello @kael112​ , would you be able to share a sample JSON file/URL with me? Going off of @Hans van der Maarel​ suggestion, the attributes should still around, just not exposed. You can check this by clicking on a feature in the Visual Preview Window, and then opening the 'Feature Information' window beside the table view (see image):

 

FeatInformationIf you can see your attributes in Feature Information window, all you have to do is expose them! You can do this in your JSONFragmenter_7 by using the 'Attributes to Expose' parameter or by adding an AttributeExposer after your Fragmenter - I would personally try to do this in the JSONFragmenter though.

 

Please let me know if you have anymore questions about this, or cannot see your attributes in the Feature Information! Best, Kailin.


Hello @kailinatsafe​ , unfortunetaly, I see nothing on the Visual Preview Window,only the coordinates.

imageThis is the Json.

{"type":"FeatureCollection","features":c{"type":"Feature","geometry":{"type":"Polygon","coordinates":on"-0.4711899,44.8654793],1-0.4711999,44.8655797],1-0.4712177,44.8656794],1-0.4712354,44.8657600],1-0.4716340,44.8664852],1-0.4724261,44.8670228],2-0.4734634,44.8672721],3-0.4963334,44.8690323],6-0.4964455,44.8690391],6-0.4965580,44.8690424],6-0.4979659,44.8690611],7-0.4992957,44.8688132],9-0.5002471,44.8681076],0-0.5007033,44.8674984],0-0.5010003,44.8666632],1-0.5011139,44.8532494],1-0.5011059,44.8530948],1-0.5010792,44.8529412],1-0.4993389,44.8455520],9-0.4989132,44.8448141],8-0.4980810,44.8442794],8-0.4970058,44.8440532],7-0.4926865,44.8438559],2-0.4916598,44.8439605],1-0.4907784,44.8443494],0-0.4808709,44.8510683],0-0.4803406,44.8515849],0-0.4714419,44.8646158],1-0.4711899,44.8654793]]]},"properties":{"gid":7,"geom_err":null,"ident":"FLEX51","libelle":"Flexo 51","type":"ARRIVEE","rs_sv_arret_p_ent_a":4099,"rs_sv_arret_p_ent_r":null,"rs_sv_arret_p_sor_a":null,"rs_sv_arret_p_sor_r":null,"rs_sv_ligne_a":84,"cdate":"2022-03-28T00:00:00+02:00","mdate":"2022-03-28T03:53:22+02:00"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":gon-0.6762588,44.8860847],7-0.6766029,44.8869121],7-0.6785315,44.8892548],7-0.6796731,44.8899855],7-0.6811988,44.8901125],8-0.6825470,44.8895892],8-0.6832214,44.8886081],8-0.6835488,44.8870289],8-0.6834203,44.8861452],8-0.6827129,44.8854129],8-0.6805979,44.8840950],8-0.6794117,44.8836817],7-0.6780943,44.8837493],7-0.6770040,44.8842796],7-0.6764378,44.8851280],7-0.6762967,44.8856825],7-0.6762618,44.8858828],7-0.6762588,44.8860847]]]},"properties":{"gid":23,"geom_err":null,"ident":"FLEX84","libelle":"Ligne 84","type":"INTERMEDIAIRE","rs_sv_arret_p_ent_a":4686,"rs_sv_arret_p_ent_r":4832,"rs_sv_arret_p_sor_a":4829,"rs_sv_arret_p_sor_r":3602,"rs_sv_ligne_a":110,"cdate":"2022-03-28T00:00:00+02:00","mdate":"2022-03-28T03:53:22+02:00"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":ygo-0.5005939,44.9323824],5-0.5009229,44.9331945],5-0.5017375,44.9338104],5-0.5020642,44.9339623],5-0.5021528,44.9340017],5-0.5022436,44.9340385],5-0.5109548,44.9373955],5-0.5123845,44.9376064],5-0.5137407,44.9372220],5-0.5145730,44.9363699],5-0.5146399,44.9362235],5-0.5147639,44.9356464],5-0.5146212,44.9350715],5-0.5116421,44.9290372],5-0.5108458,44.9282342],5-0.5102667,44.9279010],5-0.5096780,44.9276477],5-0.5039607,44.9258906],5-0.5027199,44.9257503],5-0.5015368,44.9260508],5-0.5007024,44.9267181],5-0.5004219,44.9275882],5-0.5005924,44.9323504],5-0.5005939,44.9323824]]]},"properties":{"gid":16,"geom_err":null,"ident":"FLEX49_1","libelle":"Flexo 49","type":"INTERMEDIAIRE","rs_sv_arret_p_ent_a":2040,"rs_sv_arret_p_ent_r":1926,"rs_sv_arret_p_sor_a":1924,"rs_sv_arret_p_sor_r":2041,"rs_sv_ligne_a":82,"cdate":"2022-03-28T00:00:00+02:00","mdate":"2022-03-28T03:53:22+02:00"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":lyg-0.4933012,44.9419938],.-0.4938381,44.9430261],.-0.4939054,44.9430871],.-0.4946573,44.9435456],.-0.4955993,44.9437643],.-0.5070560,44.9447371],.-0.5085960,44.9445199],.-0.5096603,44.9437002],.-0.5098405,44.9425925],.-0.5090673,44.9416221],.-0.5089879,44.9415705],.-0.5076922,44.9411229],.-0.5025659,44.9405185],.-0.5024649,44.9405081],.-0.5023634,44.9405006],.-0.4960459,44.9401227],.-0.4946585,44.9403214],.-0.4936375,44.9410175],.-0.4933012,44.9419938]]]},"properties":{"gid":17,"geom_err":null,"ident":"FLEX49_2","libelle":"Flexo 49","type":"INTERMEDIAIRE","rs_sv_arret_p_ent_a":3078,"rs_sv_arret_p_ent_r":188,"rs_sv_arret_p_sor_a":187,"rs_sv_arret_p_sor_r":3079,"rs_sv_ligne_a":82,"cdate":"2022-03-28T00:00:00+02:00","mdate":"2022-03-28T03:53:22+02:00"}}

 

Thank you


Hello @kailinatsafe​ , unfortunetaly, I see nothing on the Visual Preview Window,only the coordinates.

imageThis is the Json.

{"type":"FeatureCollection","features":c{"type":"Feature","geometry":{"type":"Polygon","coordinates":on"-0.4711899,44.8654793],1-0.4711999,44.8655797],1-0.4712177,44.8656794],1-0.4712354,44.8657600],1-0.4716340,44.8664852],1-0.4724261,44.8670228],2-0.4734634,44.8672721],3-0.4963334,44.8690323],6-0.4964455,44.8690391],6-0.4965580,44.8690424],6-0.4979659,44.8690611],7-0.4992957,44.8688132],9-0.5002471,44.8681076],0-0.5007033,44.8674984],0-0.5010003,44.8666632],1-0.5011139,44.8532494],1-0.5011059,44.8530948],1-0.5010792,44.8529412],1-0.4993389,44.8455520],9-0.4989132,44.8448141],8-0.4980810,44.8442794],8-0.4970058,44.8440532],7-0.4926865,44.8438559],2-0.4916598,44.8439605],1-0.4907784,44.8443494],0-0.4808709,44.8510683],0-0.4803406,44.8515849],0-0.4714419,44.8646158],1-0.4711899,44.8654793]]]},"properties":{"gid":7,"geom_err":null,"ident":"FLEX51","libelle":"Flexo 51","type":"ARRIVEE","rs_sv_arret_p_ent_a":4099,"rs_sv_arret_p_ent_r":null,"rs_sv_arret_p_sor_a":null,"rs_sv_arret_p_sor_r":null,"rs_sv_ligne_a":84,"cdate":"2022-03-28T00:00:00+02:00","mdate":"2022-03-28T03:53:22+02:00"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":gon-0.6762588,44.8860847],7-0.6766029,44.8869121],7-0.6785315,44.8892548],7-0.6796731,44.8899855],7-0.6811988,44.8901125],8-0.6825470,44.8895892],8-0.6832214,44.8886081],8-0.6835488,44.8870289],8-0.6834203,44.8861452],8-0.6827129,44.8854129],8-0.6805979,44.8840950],8-0.6794117,44.8836817],7-0.6780943,44.8837493],7-0.6770040,44.8842796],7-0.6764378,44.8851280],7-0.6762967,44.8856825],7-0.6762618,44.8858828],7-0.6762588,44.8860847]]]},"properties":{"gid":23,"geom_err":null,"ident":"FLEX84","libelle":"Ligne 84","type":"INTERMEDIAIRE","rs_sv_arret_p_ent_a":4686,"rs_sv_arret_p_ent_r":4832,"rs_sv_arret_p_sor_a":4829,"rs_sv_arret_p_sor_r":3602,"rs_sv_ligne_a":110,"cdate":"2022-03-28T00:00:00+02:00","mdate":"2022-03-28T03:53:22+02:00"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":ygo-0.5005939,44.9323824],5-0.5009229,44.9331945],5-0.5017375,44.9338104],5-0.5020642,44.9339623],5-0.5021528,44.9340017],5-0.5022436,44.9340385],5-0.5109548,44.9373955],5-0.5123845,44.9376064],5-0.5137407,44.9372220],5-0.5145730,44.9363699],5-0.5146399,44.9362235],5-0.5147639,44.9356464],5-0.5146212,44.9350715],5-0.5116421,44.9290372],5-0.5108458,44.9282342],5-0.5102667,44.9279010],5-0.5096780,44.9276477],5-0.5039607,44.9258906],5-0.5027199,44.9257503],5-0.5015368,44.9260508],5-0.5007024,44.9267181],5-0.5004219,44.9275882],5-0.5005924,44.9323504],5-0.5005939,44.9323824]]]},"properties":{"gid":16,"geom_err":null,"ident":"FLEX49_1","libelle":"Flexo 49","type":"INTERMEDIAIRE","rs_sv_arret_p_ent_a":2040,"rs_sv_arret_p_ent_r":1926,"rs_sv_arret_p_sor_a":1924,"rs_sv_arret_p_sor_r":2041,"rs_sv_ligne_a":82,"cdate":"2022-03-28T00:00:00+02:00","mdate":"2022-03-28T03:53:22+02:00"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":lyg-0.4933012,44.9419938],.-0.4938381,44.9430261],.-0.4939054,44.9430871],.-0.4946573,44.9435456],.-0.4955993,44.9437643],.-0.5070560,44.9447371],.-0.5085960,44.9445199],.-0.5096603,44.9437002],.-0.5098405,44.9425925],.-0.5090673,44.9416221],.-0.5089879,44.9415705],.-0.5076922,44.9411229],.-0.5025659,44.9405185],.-0.5024649,44.9405081],.-0.5023634,44.9405006],.-0.4960459,44.9401227],.-0.4946585,44.9403214],.-0.4936375,44.9410175],.-0.4933012,44.9419938]]]},"properties":{"gid":17,"geom_err":null,"ident":"FLEX49_2","libelle":"Flexo 49","type":"INTERMEDIAIRE","rs_sv_arret_p_ent_a":3078,"rs_sv_arret_p_ent_r":188,"rs_sv_arret_p_sor_a":187,"rs_sv_arret_p_sor_r":3079,"rs_sv_ligne_a":82,"cdate":"2022-03-28T00:00:00+02:00","mdate":"2022-03-28T03:53:22+02:00"}}

 

Thank you

Hi @kael112​ thank you for sending the sample JSON. I have attached a sample workspace that extracts the geometry without removing the attributes. 

A JSONExtractor uses a query to extract the geometry string into a new attribute called 'geometry' and then a JSONfFlattener extracts the attributes that we need. Next, a GeometryReplacer creates the geometry features without removing the attributes. 

 

Hope this helps!


Hi @danminneyatsaf​ , it doesn't work with the HttpCaller.Can you try with an URL? I Can't give you mine because there is a authentification key but if you need it, i can give you by personal message.

image


Hi @danminneyatsaf​ , it doesn't work with the HttpCaller.Can you try with an URL? I Can't give you mine because there is a authentification key but if you need it, i can give you by personal message.

image

@kael112​ I found that the JSON you posted above was missing some closing brackets at the end of the JSON structure, so I manually added the missing brackets. Perhaps this is having an effect on the way the JSONFragmenter is handling the response_body from the HTTPCaller.

 

Either way I'd still be interested in taking a look at your workspace and HTTPCaller setup. You can upload it to our Safe Support FTP or if that's not possible, submit a Support Case and we will follow up with you there.


Ok @danminneyatsaf​  ,I sent you the Json with the workspace. I hope it works. I sent you an other one (new 13.json), you can delete it!

image


Ok @danminneyatsaf​  ,I sent you the Json with the workspace. I hope it works. I sent you an other one (new 13.json), you can delete it!

image

@kael112​ Thank you for sending the workspace and JSON. I removed the JSONExtractor from your workspace and attached the transformers from the workspace I sent above (json_to_polygons.fmw) and was able to successfully parse the JSON response from the HTTPCaller and extract the polygons.

image 

I attached the workspace for your use (httpcaller_json_support.fmw). Note: I removed any sensitive information from your workspace so you will need to re-configure the HTTPCaller.

 

Hope this helps!


Reply