quickstart and example pages

11 messages Options
Embed this post
Permalink
mbedward

quickstart and example pages

Reply Threaded More More options
Print post
Permalink
Dear GeoTools friends,

Jody and I would be eternally grateful if any of you have a few
minutes to look over the new introductory web pages that we're putting
together at the moment.  In particular, these two...

http://geotools.org/quickstart.html

http://geotools.org/examples/csv2shp.html

(if you've looked at either of these in the last few days please
refresh your browser to get the latest page, hot off the press)

The other pages in the Examples area are in a state of creative chaos
at the moment so don't worry about those yet, although any suggestions
are welcome.

Feedback to the list please.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Andy Turner

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
Hi,

I'm looking at these now.

I am using Netbeans 6.7.1 on Windows XP.

The first issue I have is in the Depending on GeoTools section (http://www.geotools.org/quickstart.html) with the junit dependency.

If I change from:
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
To:
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>

My project is reported as malformed.

I moved on from this keeping the dependency as is...

The next issue I face is in the Adding the Shape and EPSG-HSQL Plugins to your Project section. The example Quickstart class will not compile for me as the following imports fail:
import org.geotools.data.FileDataStore;
import org.geotools.map.DefaultMapContext;
import org.geotools.map.MapContext;
import org.geotools.swing.JMapFrame;
import org.geotools.swing.data.JFileDataStoreChooser;

I have added the gt-epsg-hsql and gt-shapefile dependencies.

I also tried adding the OpenGeo Maven Repository in the repositories list.

I've tried to get things working, but had no success yet...

I'll have a look at http://geotools.org/examples/csv2shp.html now...

Andy
http://www.geog.leeds.ac.uk/people/a.turner/
 

-----Original Message-----
From: Michael Bedward [mailto:[hidden email]]
Sent: 23 September 2009 13:20
To: geotools users
Subject: [Geotools-gt2-users] quickstart and example pages

Dear GeoTools friends,

Jody and I would be eternally grateful if any of you have a few
minutes to look over the new introductory web pages that we're putting
together at the moment.  In particular, these two...

http://geotools.org/quickstart.html

http://geotools.org/examples/csv2shp.html

(if you've looked at either of these in the last few days please
refresh your browser to get the latest page, hot off the press)

The other pages in the Examples area are in a state of creative chaos
at the moment so don't worry about those yet, although any suggestions
are welcome.

Feedback to the list please.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
Good on you Andy - you're an intrepid soul braving our examples :-)
'Tis much appreciated.

The issue with not finding classes is going to be the same one that
bit us with the Quickstart example - namely that the required code is
missing from the 2.6-M2 release.

Could you try editing the pom as you did with the Quickstart: ie.
changing the version to 2.6-SNAPSHOT and adding the snapshot
repository.

If you get stuck on the malformed pom error in Netbeans, send your pom
and I'll see if I can spot the problem.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Andy Turner

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
Hi Michael,

I changed from the version and now with Quickstart it resolves the following import:
import org.geotools.data.FileDataStore;

It still has problems with:
import org.geotools.map.DefaultMapContext;
import org.geotools.map.MapContext;
import org.geotools.swing.JMapFrame;
import org.geotools.swing.data.JFileDataStoreChooser;

I'll change the junit dependency and see if this breaks things now...

I've done a bit of tinkering to try to get things to work. One thing I think I have right is the reactor...

Thanks for your help.

Andy
http://www.geog.leeds.ac.uk/people/a.turner/
 

-----Original Message-----
From: Michael Bedward [mailto:[hidden email]]
Sent: 29 September 2009 12:03
To: Andy Turner
Cc: geotools users
Subject: Re: [Geotools-gt2-users] quickstart and example pages

Good on you Andy - you're an intrepid soul braving our examples :-)
'Tis much appreciated.

The issue with not finding classes is going to be the same one that
bit us with the Quickstart example - namely that the required code is
missing from the 2.6-M2 release.

Could you try editing the pom as you did with the Quickstart: ie.
changing the version to 2.6-SNAPSHOT and adding the snapshot
repository.

If you get stuck on the malformed pom error in Netbeans, send your pom
and I'll see if I can spot the problem.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
Hi Andy,

> It still has problems with:
> import org.geotools.map.DefaultMapContext;
> import org.geotools.map.MapContext;
> import org.geotools.swing.JMapFrame;
> import org.geotools.swing.data.JFileDataStoreChooser;
>

OK - the first two are in the gt-render module and the second two are
in the gt-swing module. They must be missing from the pom (so much for
my web page proof-reading skills !)

Add those in and see how you go.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Andy Turner

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
To be clear, I added the following dependencies:

        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-render</artifactId>
            <version>${geotools.version}</version>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-swing</artifactId>
            <version>${geotools.version}</version>
        </dependency>

Now all imports resolve :-)

Andy
http://www.geog.leeds.ac.uk/people/a.turner/
 

-----Original Message-----
From: Michael Bedward [mailto:[hidden email]]
Sent: 29 September 2009 13:04
To: Andy Turner
Cc: geotools users
Subject: Re: [Geotools-gt2-users] quickstart and example pages

Hi Andy,

> It still has problems with:
> import org.geotools.map.DefaultMapContext;
> import org.geotools.map.MapContext;
> import org.geotools.swing.JMapFrame;
> import org.geotools.swing.data.JFileDataStoreChooser;
>

OK - the first two are in the gt-render module and the second two are
in the gt-swing module. They must be missing from the pom (so much for
my web page proof-reading skills !)

Add those in and see how you go.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
Exactly right - you are becoming a maven guru by the minute...

Michael

2009/9/29 Andy Turner <[hidden email]>:

> To be clear, I added the following dependencies:
>
>        <dependency>
>            <groupId>org.geotools</groupId>
>            <artifactId>gt-render</artifactId>
>            <version>${geotools.version}</version>
>        </dependency>
>        <dependency>
>            <groupId>org.geotools</groupId>
>            <artifactId>gt-swing</artifactId>
>            <version>${geotools.version}</version>
>        </dependency>
>
> Now all imports resolve :-)
>
> Andy
> http://www.geog.leeds.ac.uk/people/a.turner/
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Jody Garnett-2

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
In reply to this post by mbedward
Hi Michael and Andy -

For the tutorial I have revised the pom dependencies to exclude batik  
(since netbeans was downloading more batik jars then geotools jars and  
we were not even using them).

Jody

On 29/09/2009, at 10:04 PM, Michael Bedward wrote:

> Hi Andy,
>
>> It still has problems with:
>> import org.geotools.map.DefaultMapContext;
>> import org.geotools.map.MapContext;
>> import org.geotools.swing.JMapFrame;
>> import org.geotools.swing.data.JFileDataStoreChooser;
>>
>
> OK - the first two are in the gt-render module and the second two are
> in the gt-swing module. They must be missing from the pom (so much for
> my web page proof-reading skills !)
>
> Add those in and see how you go.
>
> cheers
> Michael
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9-12, 2009. Register  
> now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Geotools-gt2-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
In reply to this post by Andy Turner
Andy, I still have the problem after I add those dependencies
could you help me?i really need to use this >.<

this is my pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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>com.mycompany</groupId>
  <artifactId>cobacoba</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>cobacoba</name>
  <url>http://maven.apache.org</url>
  <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>RELEASE</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
  <profiles>
        <profile>
            <id>netbeans-public</id>
            <activation>
                <property>
                    <name>netbeans.execution</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addClasspath>true</addClasspath>
                                    <classpathPrefix>lib</classpathPrefix>
                                    <mainClass>com.mycompany.cobacoba.App</mainClass>
                                </manifest>
                            </archive>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>nb</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>directory</goal>
                                </goals>
                                <configuration>
                                    <descriptor>${basedir}/src/main/assemblies/netbeans-run.xml</descriptor>
                                    <finalName>executable</finalName>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
  <properties>
    <geotools.version>2.6-M2</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-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-render</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-swing</artifactId>
  <version>${geotools.version}</version>
  <!-- For this module we explicitly exclude some of its own -->
  <!-- dependencies from being downloaded because they are   -->
  <!-- big and we don't need them                            -->
  <exclusions>
    <exclusion>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-transcoder</artifactId>
      </exclusion>
    </exclusions>
</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>

and this is my error log

------------------------------------------------------------------------
[ERROR]BUILD FAILURE
------------------------------------------------------------------------
Compilation failure

com/mycompany/cobacoba/Quickstart.java.java:[11,24] cannot find symbol
symbol  : class FileDataStore
location: package org.geotools.data

com/mycompany/cobacoba/Quickstart.java.java:[15,25] package org.geotools.swing does not exist

com/mycompany/cobacoba/Quickstart.java.java:[16,30] package org.geotools.swing.data does not exist

com/mycompany/cobacoba/Quickstart.java.java:[30,20] cannot find symbol
symbol  : variable JFileDataStoreChooser
location: class com.mycompany.cobacoba.Quickstart

com/mycompany/cobacoba/Quickstart.java.java:[35,8] cannot find symbol
symbol  : class FileDataStore
location: class com.mycompany.cobacoba.Quickstart

com/mycompany/cobacoba/Quickstart.java.java:[35,49] getDataStore(java.net.URL) in org.geotools.data.FileDataStoreFinder cannot be applied to (java.io.File)

com/mycompany/cobacoba/Quickstart.java.java:[40,11] cannot access org.geotools.coverage.grid.io.AbstractGridCoverage2DReader
class file for org.geotools.coverage.grid.io.AbstractGridCoverage2DReader not found
        map.addLayer(featureSource, null);

com/mycompany/cobacoba/Quickstart.java.java:[43,8] cannot find symbol
symbol  : variable JMapFrame
location: class com.mycompany.cobacoba.Quickstart
------------------------------------------------------------------------
Total time: 5 seconds
Finished at: Wed Sep 30 23:35:25 ICT 2009
Final Memory: 79M/95M
------------------------------------------------------------------------


Andy Turner wrote:
To be clear, I added the following dependencies:

        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-render</artifactId>
            <version>${geotools.version}</version>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-swing</artifactId>
            <version>${geotools.version}</version>
        </dependency>

Now all imports resolve :-)

Andy
http://www.geog.leeds.ac.uk/people/a.turner/
 

-----Original Message-----
From: Michael Bedward [mailto:michael.bedward@gmail.com]
Sent: 29 September 2009 13:04
To: Andy Turner
Cc: geotools users
Subject: Re: [Geotools-gt2-users] quickstart and example pages

Hi Andy,

> It still has problems with:
> import org.geotools.map.DefaultMapContext;
> import org.geotools.map.MapContext;
> import org.geotools.swing.JMapFrame;
> import org.geotools.swing.data.JFileDataStoreChooser;
>

OK - the first two are in the gt-render module and the second two are
in the gt-swing module. They must be missing from the pom (so much for
my web page proof-reading skills !)

Add those in and see how you go.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
In reply to this post by mbedward
Hello,

2009/10/1 dadar (via Nabble) <[hidden email]>:
> Andy, I still have the problem after I add those dependencies
> could you help me?i really need to use this >.<
>

You are missing the GeoTools snapshot repository from your pom.xml. At
this stage (prior to the upcoming 2.6 milestone release, 2.6-M3) the
example will only work with the development build of the library.

If you add this to your repositories section you should have more luck.

<repository>
    <id>geotools-dev</id>
    <name>OSGeo snapshot repository</name>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
    <url>http://repo.osgeo.org/</url>
<repository>

Hope this helps. Please let us know how you go.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
dadar

Re: quickstart and example pages

Reply Threaded More More options
Print post
Permalink
Thx Michael. but my program is still error >.<
and the error is still same
would you like to try my source?? I really need this
i'm using geotools 2.6-M2 right now btw

mbedward wrote:
Hello,

2009/10/1 dadar (via Nabble) <ml-user+291713-308955531@n2.nabble.com>:
> Andy, I still have the problem after I add those dependencies
> could you help me?i really need to use this >.<
>

You are missing the GeoTools snapshot repository from your pom.xml. At
this stage (prior to the upcoming 2.6 milestone release, 2.6-M3) the
example will only work with the development build of the library.

If you add this to your repositories section you should have more luck.

<repository>
    <id>geotools-dev</id>
    <name>OSGeo snapshot repository</name>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
    <url>http://repo.osgeo.org/</url>
<repository>

Hope this helps. Please let us know how you go.

Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users