2013-11-25 90 views
0

有沒有人有使用JAK kml包的經驗?我正在嘗試生成KML文件。我從谷歌融合表拉一個已經生成的多邊形對象。JAK KML java將文本合併到kml

我怎樣才能把這個傳遞給JAK,而不必通過每一對經/長對來呼叫;

.addToCoordinates(-122.3662784465226,37.81884427772081,30)

<Polygon><outerBoundaryIs><LinearRing><coordinates>-88.47298,34.99603,0.0 -88.47288,34.99603, 
0.0 -88.37504,34.99561,0.0 -88.30513,34.99561,0.0 -88.24958,34.99546,0.0 -88.20006,34.99563, 
0.0 -88.20006,34.99564,0.0 -88.09899,34.88335,0.0 -88.10789,34.8091, 
0.0 -88.13023,34.64853,0.0 ,0.0 -88.63014,34.99547,0.0 -88.52806,34.99583,0.0</coordinates></LinearRing></outerBoundaryIs></Polygon> 

回答

0

如果你能以某種方式獲得的座標,你可以使用類線性環設置器的列表:setCoordinates(java.util.List的座標)。 (http://www.nilab.info/docs/jak091130/de/micromata/opengis/kml/v_2_2_0/LinearRing.html#setCoordinates%28java.util.List%29

+0

我想無論我需要處理來自谷歌融合表的經緯度/長列表。它不幸的我不能把它當作一個字符串並將其附加到Document對象。 – user3032973

+0

對於我來說,將來自融合表的上面的數據實際處理爲xml並將其解析爲單獨的kml文件可能會更好,因此與反過來需要花費大量時間的每個經緯度對相反。 – user3032973