Iam having huge issues with Vega and geoJSON foles and would appreciate some pointers. I have several issues.
- I can’t seem to get the vector file to situate properly in the canvas. ! have been trying to adapt Mike Bostock’s basic map tutorial that uses a topoJson file for areas and a csv file with [long,lat] for points. I have a line vector layer in both geoJSON and topoJSON format and I can bring in and render either - but using VEGA I get a huge amount of whitespace on the top of the canvas. I have no idea why. (Using straight d3 renders correctly, but there I can use fitExtent() and everything is happy.) What am I doing wrong?
- For the point data, how do I reference the geometry.coordinates array that has the lat,long ? (it’s not called lat/long in the geoJson file. ) The json file was generated by qGIS.
2b. If i give up and put the point data into a .csv, Observable hangs and then gives me the block unhappy face with no explanation.
Workbooks are public: https://observablehq.com/@drlynb/starting-from-the-basics-reimagining-my-code-from-mike-bost (starting from scratch) and https://observablehq.com/@drlynb/drawing-maps-from-geodata-with-d3-observable(has the correctly rendered line map).
Why am I using VEGA? I am teaching non-programmers using Vega as a scaffold, and before I completely give up I’d like to know what I am doing wrong.