1

I am trying to convert KML files to geoJson file by following Convert Kml with multiple features to Geojson . However, I am unable to get below jars as maven dependencies which contains below classes. KMLConfiguration FeatureJSON.

below is my pom.xml:

http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.test.data Converter 0.0.1-SNAPSHOT Archetype - Converter 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>

Community
  • 1
  • 1
user3406322
  • 37
  • 2
  • 8

1 Answers1

1

I was following that guide too and managed to sort out maven deps. Here is my dependencies:

<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>

with repository

<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>

and property

<geotools.version>17.2</geotools.version>

Sorry for late reply (less than a year BTW :D).

Hope it helps.

Trio
  • 78
  • 7
  • Using these dependencies, I got this: `error: cannot access XMLStreamException class file for javax.xml.stream.XMLStreamException not found` – Krupa Kakkad Mar 11 '19 at 07:44
  • Looks like you are missing a dep. Try a "Maven update" or add explicitly this dependency: https://mvnrepository.com/artifact/javax.xml.stream/stax-api – Trio Mar 12 '19 at 08:12