I am using Oz library to create vega-lite views and have created several different types of visuzlizations. However, I am finding it difficult to find GeoJSON files to work with Oz. Out of 5 GeoJSON files I have tried, only one displays a map and unfortunately is broken down into regions that are very different from my data source. Is there any advice on how to debug / troubleshoot GeoJSON files either with Oz or Vega-lite? Thank you
No, geojson is the ticket. The problem is that sometimes you'll find geojson files that are shaped differently, so you end up having to specify a few extra things in how the json is being interpetted
Like, sometimes the assumptions about the shapes being loaded in matches up perfectly, as in the examples on the vega-lite examples page.
Do you have any suggestions as to why the following draws a blue circle in Oz or in the vega-lite editor. This is the closest GeoJSON to my data set districts (its quite big so hammers the browser a bit)
{
"$schema": "<https://vega.github.io/schema/vega-lite/v4.json>",
"data": {
"url": "<https://opendata.arcgis.com/datasets/6638c31a8e9842f98a037748f72258ed_0.geojson>",
"format": {
"type": "json",
"property": "features"
}
},
"mark": "geoshape"
}
Its not the end of the world if I dont get this working...I remember having to do this in a project in the past, but am not sure where now; basically though if you compare the shape of your json file (with jq or something similar) to the geojson file used in one of the vega-lite/vega example visualizations, you may see that it has some obviously different shape. Like, the actual geojson part of the data might be nested under some parent entity in a different way. So just as with data where the attributes you want to specify are nested, you have a to modify your field specifications to match.
Thanks, that makes sense. I will calve out some time to experiment.
Sometimes the files come in somewhat different shapes so it sort of depends.
I am using the Vega-lite web based editor to check, seems the most direct approach. I am putting my results in this Gist, along with the code used in the editor https://gist.github.com/jr0cket/96e3656ecf16be4c6bacfa566a37afc8
@metasoarous I am not tied to GeoJSON. If there are other formats for geographical maps that work with Oz / vega-lite I would be happy to switch