I'm trying to create a map based D3 visualisation but my limitation is that my data is a tabular, csv format data. I have two options - 1. Convert the csv to a geoJSON format in javascript itself 2. Work with the csv data and figure out how to get the D3 functions to work with it.
I'm trying to modify this example - http://zevross.com/blog/2014/09/30/use-the-amazing-d3-library-to-animate-a-path-on-a-leaflet-map/ to work with my data which has two columns with latitude and longitude data but I'm unable to get the transform and projection working.
Any advice?
Data:
Value1,Value2,Lat,Long
1,2,15,16
4,2,15.01,16.03
4,2,15.03,16.02
Part where I think I'm stuck at:
I've modified some of the code: pointing it to a csv, setting the map to center around my data, Using d.lat
and d.long
instead of d.geometry.coordinates
wherever visible. I'm unable to test it as d3path.bounds
gets set to +- infinities and no overlay svg is created. My feeling is that the projectPoint
function 1which takes (x,y)
needs some modifications but I'm unable to figure out how x and y are getting mapped to the coordinates.