Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for overly-detailed geometries #36

Open
slibby opened this issue Jul 20, 2017 · 4 comments
Open

Check for overly-detailed geometries #36

slibby opened this issue Jul 20, 2017 · 4 comments

Comments

@slibby
Copy link
Collaborator

slibby commented Jul 20, 2017

For Polygon and Polyline features, we should check to make sure the feature creator (on the ArcGIS Side) hasn't created it with thousands of vertices where a half-dozen would do. Maybe there is functionality in D3 or the existing iD code for this, but there may need to be some math designed for this to assess what "too detailed" actually means.

ref: openstreetmap#4164 (comment)

@jgravois
Copy link
Collaborator

at a minimum, we can (and should) be using the maxAllowableOffset query parameter that our query operation exposes to keep vertex counts reasonable.

@mapmeld
Copy link
Owner

mapmeld commented Jul 22, 2017

@jgravois can you clarify maxAllowableOffset parameter for me? Assuming that we are querying in 4326 and units are degrees of latitude/longitude, would I set it to 0.000005 or so?

@jgravois
Copy link
Collaborator

that sounds close enough for jazz. in esri-leaflet we let folks supply their own simplification factor and calculate it dynamically as folks zoom in closer.

simplify: function (map, factor) {
  var mapWidth = Math.abs(map.getBounds().getWest() - map.getBounds().getEast());
  this.params.maxAllowableOffset = (mapWidth / map.getSize().y) * factor;
  return this;
},

mapmeld added a commit that referenced this issue Jul 23, 2017
@amandasaurus
Copy link

I have heard of one approach to this: To do a simplification with a really small simplification value. e.g. do a Douglas–Peucker simplication with a parameter of 1cm. Or use the OSM accuracy value. This shouldn't change the geometry much/at all, and I think it will remove extra nodes. The advantage of this approach is that you can run it on every geometry you get from the WFS source. Geometries that aren't overnoded will be returned unchanged, overnoded ones will be fixed up. No special cases to think about!

This is just from the top of my head, you'll have to double check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants