With the v3 of d3.js I am having problems drawing a map using geoJSON data. The code and the resulting map is shown at: http://bl.ocks.org/73833ec90a8a77b0e29f. Using v2 of d3.js this example generates a correct map.
- My data is already projected (they are Dutch National Grid/Rijksdriehoekstelsel coordinates). In order to compensate for this I wrote my own projection function that just translates the coordinate system of the map to pixels (e.g. scaling and translation).
- d3.geo.path() in v3 of d3.js resamples the data. However, the points generated in the resampling do not seem to be in the same coordinate system as my map (I assume they are lon, lat coordinates).
I would prefer not to translate the coordinates of my map to lon,lat coordinates, since the map is already projected the way I would like, and as far as I can tell this is not a trivial projection.
If the problems are indeed caused by the resampling, I would like to disable the resampling. However, in the documentation I could not really find how to do this. Instead of passing a projection function to d3.geo.path.projection(), I could pass an streaming object. I thought the following would work:
var projection = d3.geo.projection(function(x, y) {
return [ scale*(x-xmin), height-scale*(y-ymin) ];
}).precision(0);
but it doesn't. Probably also to do with the fact that I don't have lat,lon coordinates. How can I disable the resampling using a custom projection function?
Or when something else is causing the problems, I would like to hear that to.
Thanks.