0

我是使用 Geo Tools 和 Maven 的新手。我正在关注教程并遇到了一个特定的错误。我尝试运行的代码可在此处获得。

我的 pom.xml 是:

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.geotools</groupId>
  <artifactId>tutorial</artifactId>
  <packaging>jar</packaging>
  <version>10.0-SNAPSHOT</version>
  <name>tutorial</name>
  <url>http://maven.apache.org</url>
  <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <geotools.version>10.1</geotools.version>
    </properties>
    <build>
     <defaultGoal>install</defaultGoal>
     <plugins>
          <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
               </configuration>
          </plugin>
      </plugins>
</build>
  <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.geotools</groupId>
           <artifactId>gt-grid</artifactId>
           <version>${geotools.version}</version>
        </dependency>
        <dependency>
           <groupId>org.geotools</groupId>
           <artifactId>gt-epsg-hsql</artifactId>
           <version>${geotools.version}</version>
        </dependency>
        <dependency>
        <groupId>gov.nist.math</groupId>
        <artifactId>jama</artifactId>
        <version>1.0.2</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>
    </repositories>
</project>

正如我提到的,我正在尝试运行上面链接中提供的相同代码。

我收到的错误是:

line 122: cannot find symbol
  symbol:   class IntersectionBuilder
  location: class org.geotools.grid.GridExamples

缺课吗?任何帮助将不胜感激。

4

1 回答 1

0

我自己对使用 maven 和 geotools 还很陌生,最近遇到了类似的问题。如果我没记错的话,gt-grid 是一个不受支持的模块。因此,您可能需要下载源代码并构建它才能使用它。我似乎无法在http://svn.osgeo.org/geotools/tags/post-migration/modules/unsupported/grid/src/main/java/org/geotools/grid/找到 GridExamples 类

于 2013-11-13T12:12:33.797 回答