From: Michael B. <mic...@gm...> - 2009-06-09 02:11:53
|
Hi Luong, I've moved your question to the users' list... > i am going through this tutorial > http://docs.codehaus.org/display/GEOTDOC/SLD+XML+Support and wanted to know > if org.geotools.xml.Configuration = new org.geotools.sld.SLDConfiguration(); > org.geotools.xml.Parser parser = new org.geotools.xml.Parser( configuration > ); > > was out of date, because i'm attempting to display the road names from my > .dbf file with the help of my .sld file but everytime i use the code lines, > i get an error saying class not found. I also manuallly installed > gt2-xml-sld and gt-xml so it can recognise it but i keep getting the same > error. Am i missing any other jar files for this or have i lost the plot? I've edited the code example on that page to make it a little clearer (I hope). Please try it now. Regarding dependencies: for that example you only need to specify the gt-xsd-sld in your pom.xml. Maven will automagically round up the other required dependencies for you. Hope this helps Michael |
From: Michael B. <mic...@gm...> - 2009-06-09 02:14:39
|
PS. I only just noticed that you said... > I also manuallly installed gt2-xml-sld and gt-xml You're using GeoTools 2.5.x - yes ? The modules all have the "gt" prefix rather than "gt2". Michael |
From: ATI <luo...@ho...> - 2009-06-09 12:54:50
|
For the dependecies,gt-xsd-sld, i was trying to look for this in the repository, in particular, http://maven.geotools.fr/repository/org/geotools/ but could not find the jar file you mentioned unless it has not been updated. Also, with regards the GeoTools version, i'm not actually using any geotools jar file because on the repo site http://maven.geotools.fr/repository/org/geotools/geotools/, there is no associated jar file that i can download from and so when i do something like this <dependency> <groupId>org.geotools</groupId> <artifactId>geotools</artifactId> <version>2.5.3</version> </dependency> i just get an error telling me i need to manually install it using mvn command which i know how to do, but again i can't because there is not jar file for this. I've downloaded the zip files of 2.5.5 on my c drive, but since i'm using my project is a maven project, when i click on the libraries folder, there isn't an option where i can simply load a jar from my local directory without having to give the artifact and groupid ect, unless i change my whole project into a standard java project, if that makes any sense at all. Also, after downloading the zip files, this might sound silly, but which folder do i need to convert into the jar file to be loaded into my maven project?(although, again i can't really do that because there is no option to do so) Cheers mbedward wrote: > > Hi Luong, > > I've moved your question to the users' list... > >> i am going through this tutorial >> http://docs.codehaus.org/display/GEOTDOC/SLD+XML+Support and wanted to >> know >> if org.geotools.xml.Configuration = new >> org.geotools.sld.SLDConfiguration(); >> org.geotools.xml.Parser parser = new org.geotools.xml.Parser( >> configuration >> ); >> >> was out of date, because i'm attempting to display the road names from my >> .dbf file with the help of my .sld file but everytime i use the code >> lines, >> i get an error saying class not found. I also manuallly installed >> gt2-xml-sld and gt-xml so it can recognise it but i keep getting the same >> error. Am i missing any other jar files for this or have i lost the plot? > > I've edited the code example on that page to make it a little clearer > (I hope). Please try it now. > > Regarding dependencies: for that example you only need to specify the > gt-xsd-sld in your pom.xml. Maven will automagically round up the > other required dependencies for you. > > Hope this helps > > Michael > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- View this message in context: http://n2.nabble.com/Re%3A-SLD-XML-TUT-Query-tp3046875p3049189.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: Andrea A. <aa...@op...> - 2009-06-09 13:25:24
|
ATI ha scritto: > For the dependecies,gt-xsd-sld, i was trying to look for this in the > repository, in particular, http://maven.geotools.fr/repository/org/geotools/ > but could not find the jar file you mentioned unless it has not been > updated. Wrong repository. The official GeoTools repo is at: http://download.osgeo.org/webdav/geotools/ Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. |
From: ATI <luo...@ho...> - 2009-06-09 15:51:18
|
Hi, thanks for that Andrea, it took me quite a while to look for the jar file which i managed to download. As i built my app, it downloaded the jar files, but came to a build failure as i got this: [ERROR]Transitive dependency resolution for scope: compile has failed for your project. [ERROR]Error message: Missing: [ERROR]---------- [ERROR]1) org.geotools:geotools:jar:2.5.5 [ERROR] Try downloading the file manually from the project website. [ERROR] Then, install it using the command: [ERROR] mvn install:install-file -DgroupId=org.geotools -DartifactId=geotools -Dversion=2.5.5 -Dpackaging=jar -Dfile=/path/to/file [ERROR] Alternatively, if you host your own repository you can deploy the file there: [ERROR] mvn deploy:deploy-file -DgroupId=org.geotools -DartifactId=geotools -Dversion=2.5.5 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] [ERROR] Path to dependency: [ERROR] 1) com.mycompany:Map_AppV3:jar:1.0-SNAPSHOT [ERROR] 2) org.geotools:geotools:jar:2.5.5 [ERROR]---------- [ERROR]1 required artifact is missing. [ERROR]for artifact: [ERROR] com.mycompany:Map_AppV3:jar:1.0-SNAPSHOT [ERROR]from the specified remote repositories: [ERROR] geotools (http://download.osgeo.org/webdav/geotools/), [ERROR] ibiblio (http://www.ibiblio.org/maven2), [ERROR] central (http://repo1.maven.org/maven2), [ERROR] refractions (http://lists.refractions.net/m2) [ERROR]Group-Id: com.mycompany [ERROR]Artifact-Id: Map_AppV3 [ERROR]Version: 1.0-SNAPSHOT [ERROR]From file: C:\Users\Luong\Documents\NetBeansProjects\Map_Project\Map_AppV3\pom.xml On the repo site(http://download.osgeo.org/webdav/geotools/org/geotools/geotools/2.5.5/) , is their a corresponding jar file because i can't seem to find it. Although i have downloaded all of the zip files on the geotools site, do i need to change one of them to a jar folder? and which one? Thanks again for your assistant. ATI ha scritto: > For the dependecies,gt-xsd-sld, i was trying to look for this in the > repository, in particular, > http://maven.geotools.fr/repository/org/geotools/ > but could not find the jar file you mentioned unless it has not been > updated. Wrong repository. The official GeoTools repo is at: http://download.osgeo.org/webdav/geotools/ Cheers Andrea -- Andrea Aime -- View this message in context: http://n2.nabble.com/Re%3A-SLD-XML-TUT-Query-tp3046875p3050293.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: ATI <luo...@ho...> - 2009-06-09 15:54:58
|
My current POM is here for referrence : <?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>Map_AppV3</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>Map_AppV3</name> <url>http://maven.apache.org</url> <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>2.5-RC1</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>geotools</artifactId> <version>2.5.5</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-shapefile</artifactId> <version>2.5-RC1</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-mappane</artifactId> <version>2.5-RC1</version> </dependency> <!-- epsg-hsql is the European Petroleum Survey Group and contains cordinate systems and is used to send points or features with a cordinate system code and the receiving app knows where to place the features or points on the map--> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-epsg-hsql</artifactId> <version>2.5-RC1</version> </dependency> <dependency> <groupId>com.vividsolutions</groupId> <artifactId>jts</artifactId> <version>1.9</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-render</artifactId> <version>2.5.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.geotools.xsd</groupId> <artifactId>gt-xsd-sld</artifactId> <version>2.5.6</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-xml</artifactId> <version>2.5.1</version> <scope>compile</scope> </dependency> </dependencies> <build> <!--finalName>gt-foo-1.0-SNAPSHOT</finalName--> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>org.example.geotools.base.DemoBase</mainClass> <addClasspath>true</addClasspath> </manifest> </archive> </configuration> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> <resources> <resource> <directory>.</directory> <includes> <include>LICENSE*</include> <include>*README*</include> </includes> </resource> <resource> <!-- targetPath>data</targetPath --> <directory>src/main/resources</directory> <includes> <include>**</include> </includes> </resource> </resources> </build> <!-- =========================================================== --> <!-- Repositories (ibiblio, refractions...). --> <!-- This is where Maven looks for dependencies. --> <!-- =========================================================== --> <repositories> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>ibiblio</id> <name>Ibiblio - the public's library and digital archive</name> <url>http://www.ibiblio.org/maven2</url> </repository> <repository> <id>refractions</id> <name>Refractions Research Maven 2 Repository</name> <url>http://lists.refractions.net/m2</url> </repository> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>geotools</id> <name>Geotools repository</name> <url>http://download.osgeo.org/webdav/geotools/</url> </repository> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://repo1.maven.org/maven2</url> </repository> </repositories> </project> Hi, thanks for that Andrea, it took me quite a while to look for the jar file which i managed to download. As i built my app, it downloaded the jar files, but came to a build failure as i got this: [ERROR]Transitive dependency resolution for scope: compile has failed for your project. [ERROR]Error message: Missing: [ERROR]---------- [ERROR]1) org.geotools:geotools:jar:2.5.5 [ERROR] Try downloading the file manually from the project website. [ERROR] Then, install it using the command: [ERROR] mvn install:install-file -DgroupId=org.geotools -DartifactId=geotools -Dversion=2.5.5 -Dpackaging=jar -Dfile=/path/to/file [ERROR] Alternatively, if you host your own repository you can deploy the file there: [ERROR] mvn deploy:deploy-file -DgroupId=org.geotools -DartifactId=geotools -Dversion=2.5.5 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] [ERROR] Path to dependency: [ERROR] 1) com.mycompany:Map_AppV3:jar:1.0-SNAPSHOT [ERROR] 2) org.geotools:geotools:jar:2.5.5 [ERROR]---------- [ERROR]1 required artifact is missing. [ERROR]for artifact: [ERROR] com.mycompany:Map_AppV3:jar:1.0-SNAPSHOT [ERROR]from the specified remote repositories: [ERROR] geotools (http://download.osgeo.org/webdav/geotools/), [ERROR] ibiblio (http://www.ibiblio.org/maven2), [ERROR] central (http://repo1.maven.org/maven2), [ERROR] refractions (http://lists.refractions.net/m2) [ERROR]Group-Id: com.mycompany [ERROR]Artifact-Id: Map_AppV3 [ERROR]Version: 1.0-SNAPSHOT [ERROR]From file: C:\Users\Luong\Documents\NetBeansProjects\Map_Project\Map_AppV3\pom.xml On the repo site(http://download.osgeo.org/webdav/geotools/org/geotools/geotools/2.5.5/) , is their a corresponding jar file because i can't seem to find it. Although i have downloaded all of the zip files on the geotools site, do i need to change one of them to a jar folder? and which one? Thanks again for your assistant. -- View this message in context: http://n2.nabble.com/Re%3A-SLD-XML-TUT-Query-tp3046875p3050317.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: Michael B. <mic...@gm...> - 2009-06-10 05:49:36
|
Hi Luong, > <dependency> > <groupId>org.geotools</groupId> > <artifactId>geotools</artifactId> > <version>2.5.5</version> > </dependency> I'm not sure what this one is meant to be but it won't do anything useful for you. There is no module (artifact in maven-speak) called 'geotools'. All of the module names are of the form gt-module-name Also I notice that you have a mix of versions with your other dependencies. It's a good idea to use the same version for all of them, e.g. change them all to version 2.5.5 Hope this helps Michael |
From: ATI <luo...@ho...> - 2009-06-10 11:44:52
|
Hi, thanks for the reply. I've updated the jar versions to have 2.5.5 but the reason why i did this is because on the the following link http://download.osgeo.org/webdav/geotools/org/geotools/geotools/2.5.5/geotools-2.5.5.pom i saw that the geotools version was 2.5.5 and i just naturally thought that i also need this because i remember you asking what version of geotools i had, and noticed that i did not have this in my pom file. That was also why i was asking which of the zip files i needed to convert into the jar file. Thanks for the assistance . mbedward wrote: > > Hi Luong, > >> <dependency> >> <groupId>org.geotools</groupId> >> <artifactId>geotools</artifactId> >> <version>2.5.5</version> >> </dependency> > > I'm not sure what this one is meant to be but it won't do anything > useful for you. There is no module (artifact in maven-speak) called > 'geotools'. All of the module names are of the form gt-module-name > > Also I notice that you have a mix of versions with your other > dependencies. It's a good idea to use the same version for all of > them, e.g. change them all to version 2.5.5 > > Hope this helps > Michael > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- View this message in context: http://n2.nabble.com/Re%3A-SLD-XML-TUT-Query-tp3046875p3055076.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: ATI <luo...@ho...> - 2009-06-10 12:07:45
|
Just wanted to ask, with regards to the SLD file, although it is written in xml, can i still safely asssum that the file is saved as a .sld and NOT a .xml? Thanks for the help . Hi, thanks for the reply. I've updated the jar versions to have 2.5.5 but the reason why i did this is because on the the following link http://download.osgeo.org/webdav/geotools/org/geotools/geotools/2.5.5/geotools-2.5.5.pom i saw that the geotools version was 2.5.5 and i just naturally thought that i also need this because i remember you asking what version of geotools i had, and noticed that i did not have this in my pom file. That was also why i was asking which of the zip files i needed to convert into the jar file. Thanks for the assistance . Hi Luong, -- View this message in context: http://n2.nabble.com/Re%3A-SLD-XML-TUT-Query-tp3046875p3055197.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: Michael B. <mic...@gm...> - 2009-06-11 05:18:19
|
Hi Luong, > i saw that the geotools version was 2.5.5 and i just naturally thought that > i also need this because i remember you asking what version of geotools i > had, and noticed that i did not have this in my pom file. Yes, I can see how you got that idea. I should have explained things more clearly. So just to be clear, in a maven project, you control the version of GeoTools that your app is using via the "version" parameter on each of the dependencies. When you've got more than a few dependencies it is boring, and error-prone, to manually edit the version number of each. Also you have change them all when you want to use a newer version of GeoTools. Life's too short. Here is an easier way... Put this in the top section of your pom.xml (near <name>, <description> etc. although the exact place doesn't matter)... <properties> <geotoolsVersion>2.5.5</geotoolsVersion> </properties> Then specify each of the GeoTools dependencies in your pom.xml similar to this... <dependency> <groupId>org.geotools</groupId> <artifactId>gt-main</artifactId> <version>${geotoolsVersion}</version> </dependency> Now your dependencies will all use the same version of GeoTools and when you want to change the version you only have to edit one line. Easy-peasy :-) Michael |
From: ATI <luo...@ho...> - 2009-06-11 10:46:20
|
Oh i see, thanks for that. Although, after i had posted i immiediately, changed pretty much all of them to 2.5.5, one by one which was a bit time consuming i might add. Although, this one in particular, <dependency> <groupId>com.vividsolutions</groupId> <artifactId>jts</artifactId> <version>1.9</version> </dependency> i could not change as i just got the same error asking me to manuallly install it ect. so i left it like it is. I think when i start creating new maven projects, i'm going to start using that method that you suggested, it would make life a bit easier. Easy-peasy lemon-squeezy:-) Thanks for the help again. mbedward wrote: > > Hi Luong, > >> i saw that the geotools version was 2.5.5 and i just naturally thought >> that >> i also need this because i remember you asking what version of geotools i >> had, and noticed that i did not have this in my pom file. > > Yes, I can see how you got that idea. I should have explained things > more clearly. So just to be clear, in a maven project, you control > the version of GeoTools that your app is using via the "version" > parameter on each of the dependencies. > > When you've got more than a few dependencies it is boring, and > error-prone, to manually edit the version number of each. Also you > have change them all when you want to use a newer version of GeoTools. > Life's too short. Here is an easier way... > > Put this in the top section of your pom.xml (near <name>, > <description> etc. although the exact place doesn't matter)... > > <properties> > <geotoolsVersion>2.5.5</geotoolsVersion> > </properties> > > Then specify each of the GeoTools dependencies in your pom.xml similar > to this... > > <dependency> > <groupId>org.geotools</groupId> > <artifactId>gt-main</artifactId> > <version>${geotoolsVersion}</version> > </dependency> > > Now your dependencies will all use the same version of GeoTools and > when you want to change the version you only have to edit one line. > Easy-peasy :-) > > Michael > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- View this message in context: http://n2.nabble.com/Re%3A-SLD-XML-TUT-Query-tp3046875p3061345.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: Michael B. <mic...@gm...> - 2009-06-11 12:03:52
|
Hi Luong > Although, this one in particular, > > <dependency> > <groupId>com.vividsolutions</groupId> > <artifactId>jts</artifactId> > <version>1.9</version> > </dependency> > > i could not change as i just got the same error asking me to manuallly > install it ect. so i left it like it is. Oh-oh... I probably should have emphasized that I was only talking about the GeoTools dependencies before (e.g. gt-main, gt-shapefile and so on). There is actually no such thing as jts version 2.5.5. The JTS project's latest stable release, in their own version numbering system, is 1.10. Another tip for using maven is that you shouldn't bother specifying a dependency in your pom.xml unless you really need to. Maven does something called transitive dependency tracking. This means that when you add module X to your pom as a dependency, any other modules (=jars = artifacts) that module X needs will be pulled in to your project automagically. This will be the case for JTS. If you look at the Libraries element in the Project window in Netbeans you will see that your project is using many more jars than you have specified explicitly in your pom. It's good practice to let maven do the work for you. That way, when GeoTools is updated to use a newer version of some project's jar, such as JTS, this change will feed through to your own app without you needing to edit your pom. Michael |