I want to know if simplification of orthogonal polygons can be done with OpenCarto Java Library. If yes, does it have any API documentation?


Yes it is. Use the class ShortEdgesDeletion. You have to give as parameters the polygon you want to simplify, and the tolerance wall length (the algo tries to delete all walls shorter than this distance). The higher this distance is, the more the polygon is simplified. If you want more detail on the algo, let me know. It works mainly on polygons with squared angles.

Here is an output example, with different parameter values (black line is the initial, grey fill the final):

enter image description here

  • 1
    +1 Nice examples. Could it also be done with DouglasPeuckerRamerFilter and have you compared results? By the way what is the difference beetwen this method and the native JTS DouglasPeuckerSimplifier()? – simo Oct 12 '11 at 11:30
  • Excellent suggestion simo. For this specific case, it is important to preserve the orthogonality of the polygon. With Douglas-Peucker filter, the output polygon is not squared anymore. – julien Oct 12 '11 at 11:32
  • Very interesting. Thanks for the APIs. After simplification, can DouglaPeuckerRamerFilter square the sides? Also it is appreciated if you can provide me details of the algorithm you used for simplification. Another question: Does your library support amalgamation (union) of buildings? – Sanjeewa Oct 12 '11 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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