Python Forum
Help regarding geoJSON - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Help regarding geoJSON (/thread-32580.html)



Help regarding geoJSON - vicegb009 - Feb-19-2021

Hi! I have a geoJSON file with 160 restaurant location within a city. I have to arrange some specific data sets into columns, e.g. restaurant name, restaurant address and coordinates. Problem is I can't use any external modules except 'json', can't use dictionary operations and have to use string sequences to solve this. The json file can be found here: https://1drv.ms/u/s!ArZ5ln6zCpQugbUcBcNkYPIAJsGSuA?e=KeGRtE

Can anyone please help me how to approach this problem?


RE: Help regarding geoJSON - buran - Feb-19-2021

(Feb-19-2021, 05:35 AM)vicegb009 Wrote: I can't use any external modules except 'json', can't use dictionary operations and have to use string sequences to solve this
If you use json module, you will end up having a nested dict of dicts. Then not using dict operations doesn't make sense. So if restrictions hold - you need to basically write parser yourself - read/process the file like regular text file.


RE: Help regarding geoJSON - Larz60+ - Feb-19-2021

You can also look at the code from some geojson readers and see how they do it
see: https://pypi.org/search/?q=geojson+%2B+reader&o=

You can then load the data in QGIS see: https://gis.stackexchange.com/questions/199403/loading-geojson-into-qgis
to verify that your translation was correct.