Jody Garnett-2 wrote:
> 
> Dumping all the jars into the project will work (as an alternative to
> maven) but you do need to be careful to only select one epsg jars. You can
> only have one of them; which one you choose is up to you.
> 

I'm going to stick with Maven if I can. Here is a copy of my POM, I don't
think there are any espg clashes:

*************************************************

<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.demo</groupId>
  <artifactId>example</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>example</name>
  <url>http://maven.apache.org</url>
  <properties>
    <geotools.version>2.6.4</geotools.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-main</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-shapefile</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-epsg-hsql</artifactId>
      <version>${geotools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-referencing</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-render</artifactId>
      <version>${geotools.version}</version>
    </dependency>      
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-coverage</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-geotiff</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-image</artifactId>
        <version>${geotools.version}</version>
    </dependency>
        <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-svg</artifactId>
        <version>${geotools.version}</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>
  </repositories>
</project>

*************************************************


Jody Garnett-3 wrote:
> 
> Okay I am not sure what is going on there; can you check your project
> build path. The CoordinateReferenceSystem class is defined in the
> geoapi.jar
> 

In Eclipse, the Referenced Libraries for my project includes:
geoapi-2.3-M1.jar
(M2_REPO\org\opengis\geoapi\2.3-M1\geoapi-2.3-M1.jar)


Jody Garnett-3 wrote:
> 
> It really feels like your classpath is wrong or otherwise having problems.
> You may wish to try building carefully on the command line. If you are
> following the quicksart it shows you how to create a project from scratch
> and run it. (In addition to importing it into eclipse).  Did these steps
> work for you? Or are you skipping ahead right into your own project
> 

I have followed the quickstart and other labs in order to build my project,
and then used Eclipse to compile/run it rather than from the command line.
This works fine for everything, except it seems for this CRS issue?

Here's an example - a modified version of the QuickStart that crashes with
the same original error ("Authority "ESPG" is unknown or doesn't match the
supplied hints"):

*************************************************

package org.geotools.demo.example;

import java.io.File;

import org.geotools.data.FeatureSource;
import org.geotools.data.FileDataStore;
import org.geotools.data.FileDataStoreFinder;
import org.geotools.map.DefaultMapContext;
import org.geotools.map.MapContext;
import org.geotools.referencing.CRS;
import org.geotools.swing.JMapFrame;
import org.geotools.swing.data.JFileDataStoreChooser;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

/**
 * GeoTools Quickstart demo application. Prompts the user for a shapefile
 * and displays its contents on the screen in a map frame
 *
 * @source $URL$
 */
public class Quickstart2 {

    /**
     * GeoTools Quickstart demo application. Prompts the user for a
shapefile
     * and displays its contents on the screen in a map frame
     */
    public static void main(String[] args) throws Exception {
        // display a data store file chooser dialog for shapefiles
        File file = JFileDataStoreChooser.showOpenFile("shp", null);
        if (file == null) {
            return;
        }

        FileDataStore store = FileDataStoreFinder.getDataStore(file);
        FeatureSource featureSource = store.getFeatureSource();

        // Create a map context and add our shapefile to it
        MapContext map = new DefaultMapContext();
        map.setTitle("Quickstart");
        map.addLayer(featureSource, null);
        
        // Now display the map
        JMapFrame mapFrame = new JMapFrame();
        
        CoordinateReferenceSystem crs = CRS.decode("ESPG:32198");  //
doesn't work
        mapFrame.setMapContext(new DefaultMapContext(crs));
        
        mapFrame.showMap(map);
        
    }
}

*************************************************

I've tried running this now from the command line:

mvn compile
mvn exec:java -Dexec.mainClass="org.geotools.demo.example.Quickstart2"

It fails with the same error...

-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Exception-in-CoordinateReferenceSystem-tp5087708p5357956.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to