3

I have a polyline element and I want to reduce the number of points (vertices?) that make up the line. I know it will make the curved sections jagged and that is fine. I just want to control (perhaps by a percentage of the total?) how many points are decimated. I looked at the ITopologicalOperator.Simplify method but this does not seem to be what I need.

  • 2
    Have you looked at the IPolycurve.Generalize method, which uses a specified maximum offset tolerance? – Barbarossa Oct 3 '18 at 16:49
  • There is also Weed. If you need to specify how many points are decimated, you may have to make several passes, keeping track of how many vertices are retained until you are happy with the results (i.e. total count, percentage of total, etc). – Barbarossa Oct 3 '18 at 16:59
  • 1
    That sounds like the answer @Barbarossa. ITopoloigalOperatorX.Simplify doesn't reduce the number of vertices, think of simplify more like validate which fixes self intersections and incorrect orientations (like Repair Geometry) which isn't so important to an IElement geometry but is absolutely vital for geometries stored in an enterprise database - the database will refuse to store or update a geometry that isn't simple. Simplify has no meaning for point and multipoint geometries. – Michael Stimson Oct 5 '18 at 2:30
3

Take a look at IPolycurve.Generalize or IPolycurve.Weed methods. Both use a specified maximum offset tolerance. If, however, you need to specify how many points are decimated, you can make several passes over your geometry, using Generalize/Weed to reduce the vertex count, keeping track of this count until you are happy with the results.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.