0
我有座標的數組列表:從數組列表中創建多邊形點 - 座標序列?
List<Coordinate> coords;
我想創建一個基於這些值的多邊形。
我想:
GeometryFactory geometryFactory = new GeometryFactory();
Polygon polyg = geometryFactory.createPolygon(coords);
但它表明,它想的CoordinateSequence:
The method createPolygon(CoordinateSequence) in the type GeometryFactory is not applicable for the arguments (List<Coordinate>)
如果我嘗試創建的CoordinateSequence它顯示的方法bucnh,我不知道如何繼續(或者無論如何需要序列)。
你的意思是使用'LinearRing'後首先從'List'轉換'coords'到'Array'並通過'holes'我們指的是多邊形內部的空白區域? ?謝謝! – George
爲了找出一個點是否位於多邊形中,我可以簡單地使用'point.within(polygon)'? – George
我認爲包含的是你想要的方法,或者實際上通常不是不相交的。 –