I'm trying to convert official boundaries of administrative regions of Poland from official governmental site (codgik.gov.pl). I want to use those data because they are official ones, and set contains additional levels of borders of that I cannot find in other data sets (such as Natural Earth).
I use approach similar to How to create a GeoJSON that works with D3?.However when I'm trying to use conversion ogr2ogr and plot the results using d3.js I fail. Data seems to be incorrectly translated giving essentially gibberish.
The same approach worked just fine w Natural Earth shapefiles.
By playing around with SVG (deleting paths) I can see that path overlaps and hugely and result in just black square.
Java GeoTools [quickstart tutorial] shows this shapefile without any problem, so I'm guessing mine conversions are off.
Shapefile set is available here (5.5MB)
JavaScript code:
d3.json("wojeowdztwa.json", function(error, map) { if (error) return console.error(error);var projection = d3.geo.mercator()// .center([171677, 133223])// .scale(69) .translate([width / 2, height / 2]); var path = d3.geo.path() .projection(projection);svg.append("g").attr("id", "polska") .selectAll("path") .data(map.features) .enter() .append("path") .attr("id", function(d) { return d.id; }) .attr("d", path) .attr("class", "wojewodztwo");Content of .PRJ file:
PROJCS["ETRS89 / Poland CS92", GEOGCS["ETRS89", DATUM["European Terrestrial Reference System 1989", SPHEROID["GRS 1980", 6378137.0, 298.257222101], TOWGS84[0,0,0] ], PRIMEM["Greenwich", 0.0], UNIT["Decimal Degree", 0.017453292519943295] ], PROJECTION["Transverse_Mercator"], PARAMETER["latitude_of_origin", 0.0], PARAMETER["central_meridian", 18.999999999999982], PARAMETER["scale_factor", 0.9993], PARAMETER["false_easting", 500000.0], PARAMETER["false_northing", -5300000.0], UNIT["Meter", 1.0], AUTHORITY["EPSG", 2180]]I'm very new to this whole cartography stuff. So I would be very happy to get some advice.
Thanks very much!
أكثر...
I use approach similar to How to create a GeoJSON that works with D3?.However when I'm trying to use conversion ogr2ogr and plot the results using d3.js I fail. Data seems to be incorrectly translated giving essentially gibberish.
The same approach worked just fine w Natural Earth shapefiles.
By playing around with SVG (deleting paths) I can see that path overlaps and hugely and result in just black square.
Java GeoTools [quickstart tutorial] shows this shapefile without any problem, so I'm guessing mine conversions are off.
Shapefile set is available here (5.5MB)
JavaScript code:
d3.json("wojeowdztwa.json", function(error, map) { if (error) return console.error(error);var projection = d3.geo.mercator()// .center([171677, 133223])// .scale(69) .translate([width / 2, height / 2]); var path = d3.geo.path() .projection(projection);svg.append("g").attr("id", "polska") .selectAll("path") .data(map.features) .enter() .append("path") .attr("id", function(d) { return d.id; }) .attr("d", path) .attr("class", "wojewodztwo");Content of .PRJ file:
PROJCS["ETRS89 / Poland CS92", GEOGCS["ETRS89", DATUM["European Terrestrial Reference System 1989", SPHEROID["GRS 1980", 6378137.0, 298.257222101], TOWGS84[0,0,0] ], PRIMEM["Greenwich", 0.0], UNIT["Decimal Degree", 0.017453292519943295] ], PROJECTION["Transverse_Mercator"], PARAMETER["latitude_of_origin", 0.0], PARAMETER["central_meridian", 18.999999999999982], PARAMETER["scale_factor", 0.9993], PARAMETER["false_easting", 500000.0], PARAMETER["false_northing", -5300000.0], UNIT["Meter", 1.0], AUTHORITY["EPSG", 2180]]I'm very new to this whole cartography stuff. So I would be very happy to get some advice.
Thanks very much!
أكثر...