Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mbostock
Last active February 9, 2016 01:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbostock/2846726 to your computer and use it in GitHub Desktop.
Save mbostock/2846726 to your computer and use it in GitHub Desktop.
Simplifying and cleaning Shapefiles.
us.coordinates = us.coordinates.map(function(polygon) {
return polygon.map(function(lineString) {
return lineString.map(function(point) {
return point.map(function(coordinate) {
return d3.round(coordinate, 2);
});
});
})
});
d3.select("body").text(JSON.stringify(us));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment