Open cedricraeymaeckers opened 4 years ago
I'm guessing you're coding in python, have you done any coding in other languages before?
Poi.json is a direct export of our MongoDB database which in turn is a direct export of our normal poi API for all results.
It's not that hard to make a (python) script to make it all into a GeoJSON file.
This below is a crude example I made to turn the whole POI file into geojson. The fact that the file isn't actually valid json is a bit of a pain, but it's manageable. There's also (on my system) some fiddling with encoding. But it works.
It's not that hard to make a (python) script to make it all into a GeoJSON file.
This below is a crude example I made to turn the whole POI file into geojson. The fact that the file isn't actually valid json is a bit of a pain, but it's manageable. There's also (on my system) some fiddling with encoding. But it works.
Just on the above, I seem to have saved (and thus uploaded) a second-last version of my own little script. There's a function missing, to do this.
Once that's done, it can be read as Json.
Update: I've updated our geojson output implementation so that it validates in modern GeoJSON parsers. If you encounter bugs specific to GeoJSON please create an issue:
https://api.openchargemap.io/v3/poi/?output=geojson&countrycode=BE
Update: I've updated our geojson output implementation so that it validates in modern GeoJSON parsers. If you encounter bugs specific to GeoJSON please create an issue:
https://api.openchargemap.io/v3/poi/?output=geojson&countrycode=BE
If I hit that API, it seems to give back only a small fraction of the charging locations in a country. Whether BE or elsewhere. Really quite a small fraction
@hughsheehy remember that maxresults defaults to 100, so you should get max 100 results whichever country code you use unless you specify a high maxresults and an API key.
@hughsheehy remember that maxresults defaults to 100, so you should get max 100 results whichever country code you use unless you specify a high maxresults and an API key.
Silly me. 😳
It seems that the poi.json file is not a list of dictionaries but the file just contains one dictionary per line in the file, this makes it difficult to process.