我正在尝试按照 Convert Kml with multiple features to Geojson 将 KML 文件转换为 geoJson 文件。 但是,我无法将以下 jars 作为包含以下类的 Maven 依赖项。 KML配置 特征JSON。
下面是我的 pom.xml:
http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.test.data 转换器 0.0.1-快照 原型(prototype) - 转换器 http://maven.apache.org
<dependencies>
<!-- https://mvnrepository.com/artifact/pull-parser/pull-parser -->
<dependency>
<groupId>pull-parser</groupId>
<artifactId>pull-parser</artifactId>
<version>2.1.10</version>
</dependency>
<dependency>
<groupId>org.geotools.xsd</groupId>
<artifactId>gt-xsd-core</artifactId>
<version>9.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.owasp.encoder/encoder -->
<dependency>
<groupId>org.owasp.encoder</groupId>
<artifactId>encoder</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-configuration/commons-configuration -->
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.opengis</groupId>
<artifactId>geoapi</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository> <!--Add the snapshot repository here -->
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>opengeo</id>
<name>OpenGeo Maven Repository</name>
<url>http://repo.opengeo.org</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>boundless</id>
<name>Boundless Maven Repository</name>
<url>http://repo.boundlessgeo.com/main</url>
</repository>
</repositories>
最佳答案
我也在遵循该指南并设法整理了 Maven 部门。这是我的依赖项:
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-main</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools.xsd</groupId>
<artifactId>gt-xsd-core</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools.xsd</groupId>
<artifactId>gt-xsd-kml</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-geojson</artifactId>
<version>${geotools.version}</version>
</dependency>
带有存储库
<repository>
<id>boundlessgeo.com</id>
<url>http://repo.boundlessgeo.com/main/</url>
</repository>
<repository>
<id>download.osgeo.org</id>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
和属性(property)
<geotools.version>17.2</geotools.version>
抱歉回复晚了(顺便说一句,不到一年:D)。
希望有帮助。
关于java - 在java中将KML文件转换为geoJson,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39620882/