Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

Cheers, Sanjeewa

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Yes it is. Use the class ShortEdgesDeletion in the opencarto-algo module. 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. The whole API is there (I have just uploaded it - it is brand new!).

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

enter image description here

share|improve this answer
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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