Closed mroavi closed 2 years ago
As GeoJSON is a subset of JSON its completely possible to have valid JSON that github can visualise, that is not valid GeoJSON.
This may or may not be the case with this file... a better test is if another json package un a different language can read it.
You can also try GeoJSONTables.jl, which will soon replace the code here.
I see. Thanks for clarifying. I'll give GeoJSONTables.jl a go.
I noticed that GeoJSONTables is not registered yet. I tried installing the master branch the github's URL but I'm having issues during the precompilation:
I created a clean environment and added this package only.
If you want I can create an issue in GeoJSONTables instead.
The colombia-municipios.json file is not a GeoJSON, but TopoJSON, which is an extension of GeoJSON that encodes topology. Find out more here: https://github.com/topojson/topojson.
This package, nor GeoJSONTables, support TopoJSON. Perhaps one day it will, or maybe it's better suited for a separate package, I don't know. If you want to read it now however your best best is to read it through GDAL, for instance with GeoDataFrames.jl
Ahhh that makes it clear now! Later, when the GeoJSONTables functionality gets integrated, it would be nice if an error is thrown whenever the read fails. For now, I will just work with the second file I posted (which doesn't contain the municipalities but should be ok). Thanks again for your time.
Yeah returning nothing
isn't great. In GeoJSONTables the error will be better:
julia> GeoJSONTables.read(read("colombia-municipios.json"))
ERROR: ArgumentError: Unknown geometry type Topology
Hi there. I'm new to GeoJSON. I'm having issues trying to load the following json file: https://github.com/finiterank/mapa-colombia-js/blob/master/colombia-municipios.json
I downloaded it to my computer. This is how I'm trying to read the file:
The issue is that nothing get's loaded (
Nothing
literally gets stored ingeo
).I've investigated a little to see if I could discover what is going wrong.
I actually managed to read and plot the following geojson file: https://observablehq.com/@john-guerra/spike-map-of-colombian-cities-by-population
I compared the content of both files and I found differences. For example, the one that fails to be read does not have a
FeatureCollection
orFeatures
in it. However, I find it strange that GitHub is able to visualize it correctly.Could it be that the first geojson file has a different format that is not supported by GeoJSON.jl?