문제

I'm looking for a java library for android or an algorithm description which can calculate the difference between 2 polygons. I've been looking for a few hours with no luck. Any suggestions?

도움이 되었습니까?

해결책

Check out the JTS library. It gets tons of use in the Java GIS world, and is generally useful for solving topology problems in Java. JTS represents various topology types (including Polygons) as with a Geometry base class. Here's the method for calculating the difference between two geometries (including two polygons): http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html#difference%28com.vividsolutions.jts.geom.Geometry%29

You can download JTS from http://sourceforge.net/projects/jts-topo-suite/.

다른 팁

The subtraction?

Check out the Area API. It has a subtract() method.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top