2013-10-14 1 views
2

J'ai trouvé un outil utile pour convertir des fichiers .csv dans des fichiers de forme avec geotools:SchemaException en java

Mais j'ai un problème en cours d'exécution, je reçois l'erreur suivante Maven:

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project tutorial: Command execution failed. Process exited with an error: 1 (Exit value: 1)

Et une erreur dans cette ligne:

final SimpleFeatureType TYPE = DataUtilities.createType(
       "Location",     // <- the name for our feature type 
       "location:Point:srid=4326," + // <- the geometry attribute: Point type 
       "name:String"   // <- a String attribute 
     ); 

L'erreur:

Exception in thread "main" org.geotools.feature.SchemaException: Error decoding srs

Mon fichier POM est le suivant:

<project 
    xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.geotools</groupId> 
    <artifactId>tutorial</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 
    <name>tutorial</name> 
    <url>http://maven.apache.org</url> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <geotools.version>11-SNAPSHOT</geotools.version> 
    </properties> 
    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>3.8.1</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.geotools</groupId> 
      <artifactId>gt-shapefile</artifactId> 
      <version>${geotools.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.geotools</groupId> 
      <artifactId>gt-swing</artifactId> 
      <version>${geotools.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>exec-maven-plugin</artifactId> 
      <version>1.2.1</version> 
     </dependency> 
    </dependencies> 
    <repositories> 
     <repository> 
      <id>maven3-repository.dev.java.net</id> 
      <name>Java.net repository</name> 
      <url>http://download.java.net/maven/3</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> 
    </repositories>  
</project> 

J'utilise Maven 3.1 sur Win8.1.

J'espère que quelqu'un peut m'aider!

Répondre

2

J'ai juste eu le même problème. Peut-être que cela aidera quelqu'un à l'avenir. Ajoutez ceci à votre pom.xml:

<dependency> 
     <groupId>org.geotools</groupId> 
     <artifactId>gt-epsg-hsql</artifactId> 
     <version>${geotools.version}</version> 
</dependency>