Re: [Geotools-gt2-users] new blog post - fun with graticules
Cool ! Nice work Ian. Michael On 23 June 2015 at 00:47, Ian Turton ijtur...@gmail.com wrote: I've been playing with creating labeled graticules in GeoTools, see http://blog.ianturton.com/geotools/mapping/cartography/2015/06/17/fun-with-graticules.html for examples. If people agree that this is useful I'll try to chase down the license on the tick mark code and prepare a pull request. Ian -- Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical virtual servers, alerts via email sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Possible to deploy GeoTools to maven central repositories?
On 5 September 2014 09:52, Jody Garnett jody.garn...@gmail.com wrote: So GeoTools for example would not be able to deploy until JTS deploys :) Since we have a lot of dependencies this does not seem likely. Not quite - JTS is already at maven central. -- Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] No Repaint of MapPane on manipulating the layer
Hello Florian, There did used to be such a chain of events which JMapPane took advantage of, but it was unfortunately dropped some time ago when the feature collection classes were reworked. The following thread may be helpful: http://osgeo-org.1560.x6.nabble.com/Geotools-8-0-to-9-4-difference-with-SimpleFeatureCollection-and-Map-refresh-td5073829.html#a5073908 Michael On 4 April 2014 01:31, fmd85 florian-di...@gmx.de wrote: Hi, I am currently trying to add/delete features on a feature layer and display them on a JMapFrame. It works fine, but the MapPane doesn't repaint on adding new features to the collection. I've read on this forum (1) that there should be a chain of events from the FeatureCollection to the MapPane, but it doesn't work for me, even the manual call of frame.getMapPane.repaint() doesn't help. Heres how i do it: *//1. Create a JMapFrame* MapContent map = new MapContent(); JMapFrame frame = new JMapFrame(map); *//2. Create a SimpleFeatureList and a SimpleFeatureCollection* ListSimpleFeature listSF = new ArrayListSimpleFeature(); listSF.add(someFeatures); ListFeatureCollection colPoints = new ListFeatureCollection(myhelper.getFeatureTypePoint, listSF); Layer layer = new FeatureLayer(colPoints, SLD.createPointStyle(Circle, SLD.createPointStyle(...)); map.addLayer(messlayer); *// 3. Now i add some more Points to the collection* colPoints.add(someFeatures); frame.getMapPane.repaint(); *4. ..and nothing happens. * There's two ways how i could make the new points visible, but none of them seems to be a good idea: 1. Remove the layer from the Pane and add ist again (map.addLayer(layer)). 2. Enable the layertable of JMapFrame and click the toggle visibility button two times. Can anyone please help me and show me the fault in my code/strategy? Is the a better (and faster?) way to display dynamic features in geotools? Best regards, Florian (1) http://osgeo-org.1560.x6.nabble.com/Adding-geometry-to-layer-td4324729.html http://osgeo-org.1560.x6.nabble.com/Adding-geometry-to-layer-td4324729.html -- View this message in context: http://osgeo-org.1560.x6.nabble.com/No-Repaint-of-MapPane-on-manipulating-the-layer-tp5132892.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Geotools JavaFX Netbeans 7.4
Hi Frank - your reply dropped off the list so I'm just forwarding it (please see below for Frank's solution everyone). Michael On 2 December 2013 09:19, Frank van der Hulst drifter.fr...@gmail.com wrote: OK folks, I have an answer for anyone else stuck in this rut :) The problem is nothing to do with GeoTools or its libraries... as indicated by Michael, it is to do with JavaFX and the JavaFX packager and Maven. There is no need to go through the process of creating a gt-uber archive The page I found most useful was http://java.dzone.com/articles/create-javafx-executables I used the first technique on that page (which he deprecates) and added the JavaFX runtime to my Maven repository by changing to the location of jfxrt.jar and executing mvn install:install-file -Dfile=jfxrt.jar -DgroupId=com.oracle -DartifactId=javafx-runtime -Dpackaging=jar -Dversion=2.2.45 I did also try his new improved technique (reference the jfxrt.jar using the system scope and the ${java.home} property), but when I couldn't get that to work immediately, I decided to stick with what does work. Here's my POM, which works 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; modelVersion4.0.0/modelVersion groupIdfrankv/groupId artifactIdMapping/artifactId version1.0-SNAPSHOT/version packagingjar/packaging nameMapping/name urlhttp://maven.apache.org/url build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId version2.3.2/version configuration source1.7/source target1.7/target /configuration /plugin /plugins /build properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding geotools.version10.2/geotools.version /properties dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version3.8.1/version scopetest/scope /dependency dependency groupIdcom.oracle/groupId artifactIdjavafx-runtime/artifactId version2.2.45/version /dependency dependency groupIdmysql/groupId artifactIdmysql-connector-java/artifactId version5.1.27/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-api/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-epsg-hsql/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-main/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-render/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-swing/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-shapefile/artifactId version${geotools.version}/version /dependency /dependencies repositories repository idosgeo/id nameOpen Source Geospatial Foundation Repository/name urlhttp://download.osgeo.org/webdav/geotools//url /repository /repositories /project All the gt- artifacts and the mysql-connector driver won't be needed for everyone's apps... pick and choose what you actually use. Lack of the gt-epsg-hsql does NOT cause a compile-time error for me, but DOES cause a runtime error. Hope this helps someone Frank On Fri, Nov 29, 2013 at 10:06 PM, Michael Bedward michael.bedw...@gmail.com wrote: Does this help at all ? http://www.adam-bien.com/roller/abien/entry/how_to_compile_java_fx Michael On 29 November 2013 08:50, Frank van der Hulst drifter.fr...@gmail.com wrote: Hi Michael, Yes, it's all learning by doing kind of stuff. I'm OK with that... just hoping that someone has stumbled around in this piece of dark before :) There was never any problem with building GeoTools projects, which is confirmed by your experiment with the Quickstart project. The problem is building a GeoTools project which uses JavaFX2 for the GUI. If I could somehow include jfxrt.jar as a dependency in the POM file, I think I'd be just about there. Frank On Thu, Nov 28, 2013 at 5:13 PM, Michael Bedward michael.bedw...@gmail.com wrote: Hi Frank, Well I did say it was a stab in the dark :) As an experiment, I just tried taking the includes section out of the pom.xml in the gist and rebuilt the jar. That stuffs the GeoTools modules plus
Re: [Geotools-gt2-users] Geotools JavaFX Netbeans 7.4
Does this help at all ? http://www.adam-bien.com/roller/abien/entry/how_to_compile_java_fx Michael On 29 November 2013 08:50, Frank van der Hulst drifter.fr...@gmail.com wrote: Hi Michael, Yes, it's all learning by doing kind of stuff. I'm OK with that... just hoping that someone has stumbled around in this piece of dark before :) There was never any problem with building GeoTools projects, which is confirmed by your experiment with the Quickstart project. The problem is building a GeoTools project which uses JavaFX2 for the GUI. If I could somehow include jfxrt.jar as a dependency in the POM file, I think I'd be just about there. Frank On Thu, Nov 28, 2013 at 5:13 PM, Michael Bedward michael.bedw...@gmail.com wrote: Hi Frank, Well I did say it was a stab in the dark :) As an experiment, I just tried taking the includes section out of the pom.xml in the gist and rebuilt the jar. That stuffs the GeoTools modules plus all of the third-party dependencies in there. Then I modified the pom of the GeoTools Quickstart project to reference gt-uber instead of individual gt jars. Finally I built and ran the app from within Netbeans 7.2. It ran without error. There is probably also a way of including the direct-dependency GeoTools jars and creating a new pom for the uber jar which lists all of the transitive dependencies, but I don't know what it is. Sorry I couldn't help more. Good luck with it and please the list know if you find a solution. Michael On 28 November 2013 14:14, Frank van der Hulst drifter.fr...@gmail.com wrote: Thanks Michael, but still no joy :( It seems to be building gt-uber OK... but a couple of suspicious things 1. The project has a warning on it: Project's main artifact is processed through maven-shade-plugin. Well, I knew that. It goes on to say When the final artifact jar contains classes not originating in current project, NetBeans internal compiler cannot use the sources of the project for compilation. Then changes done in project's source code only appears in depending projects when project is recompiled. Also applies to features like Refactoring which will not be able to find usages in depending projects.. 2. The output from building gt-uber says JAR will be empty - no content was marked for inclusion! Despite these warnings, it appears to work OK... my gt-uber-10.2.jar file is 13.3MB. Again, I tried various things with the POM you shared... I included com.vivid*, since I was referencing some of their classes, and then later included * I also tried adding all the gt-* artifacts as dependencies, and I added the osgeo repository I added the project.build.sourceEncoding property as UTF8 because there were some warnings about encoding conversions. I did notice that the Mapping build output includes this, which suggests to me that its unpacking gt-uber, so I may still in the same boat as before.:( --- maven-dependency-plugin:2.6:unpack-dependencies (unpack-dependencies) @ Mapping2 --- Unpacking C:\Users\frankv\.m2\repository\org\geotools\gt-uber\10.2\gt-uber-10.2.jar to C:\Users\frankv\Documents\NetBeansProjects\Mapping2\target\classes with includes and excludes With all of that, and the Combined GeoTools jar project added as a dependency of my Mapping project, the Mapping project builds without errors and runs, up to the point where it tries to use a Factory. If the first Factory I reference is a CRSAuthorityFactory, e.g. CoordinateReferenceSystem internalCRS = CRS.getAuthorityFactory(true).createCoordinateReferenceSystem(EPSG:2193); // NZGD2000 NZTM it crashes with Nov 28, 2013 4:01:11 PM org.geotools.factory.FactoryRegistry scanForPlugins WARNING: Can't load a service for category CRSAuthorityFactory. Cause is ServiceConfigurationError: org.opengis.referencing.crs.CRSAuthorityFactory: Provider org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory not a subtype. java.util.ServiceConfigurationError: org.opengis.referencing.crs.CRSAuthorityFactory: Provider org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory not a subtype at java.util.ServiceLoader.fail(ServiceLoader.java:231) at java.util.ServiceLoader.access$300(ServiceLoader.java:181) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:369) at java.util.ServiceLoader$1.next(ServiceLoader.java:445) at org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:826) at org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:772) at org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:805) at org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:196) at org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:180
Re: [Geotools-gt2-users] Geotools JavaFX Netbeans 7.4
org.geotools.filter.FilterFactoryImpl not a subtype. java.util.ServiceConfigurationError: org.opengis.filter.FilterFactory: Provider org.geotools.filter.FilterFactoryImpl not a subtype at java.util.ServiceLoader.fail(ServiceLoader.java:231) at java.util.ServiceLoader.access$300(ServiceLoader.java:181) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:369) at java.util.ServiceLoader$1.next(ServiceLoader.java:445) at org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:826) at org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:772) at org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:805) at org.geotools.factory.FactoryRegistry.getUnfilteredProviders(FactoryRegistry.java:230) at org.geotools.factory.FactoryRegistry.getServiceImplementation(FactoryRegistry.java:430) at org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:365) at org.geotools.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:145) at org.geotools.factory.CommonFactoryFinder.lookup(CommonFactoryFinder.java:346) at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:300) at org.geotools.factory.CommonFactoryFinder.getFilterFactory2(CommonFactoryFinder.java:390) at org.geotools.factory.CommonFactoryFinder.getFilterFactory2(CommonFactoryFinder.java:404) at org.geotools.data.DataUtilities.clinit(DataUtilities.java:200) at org.geotools.data.shapefile.files.ShpFiles.exists(ShpFiles.java:975) at org.geotools.data.shapefile.files.ShpFiles.init(ShpFiles.java:182) at org.geotools.data.shapefile.files.ShpFiles.init(ShpFiles.java:139) at org.geotools.data.shapefile.ShapefileDataStore.init(ShapefileDataStore.java:119) at frankv.mapping2.FXMLController.handleButtonAction(FXMLController.java:27) Frank On Wed, Nov 27, 2013 at 2:40 PM, Michael Bedward michael.bedw...@gmail.com wrote: Hi Frank, Your last reply fell off the list... Here's an example pom.xml to create a GeoTools uber jar using the shade plugin... https://gist.github.com/mbedward/7669318 To use it, just stick it in a new directory somewhere, edit it to add the GeoTools dependencies you need, and run mvn install from the command line. You can also build it from within Netbeans if you like. You should end up with gt-uber-10.2.jar in the target sub-dir and your local maven repo. You can then reference gt-uber from your application pom.xml. No idea if this will fix your JavaFXPackager problem but it's worth a try :) Michael On 27 November 2013 10:16, Frank van der Hulst drifter.fr...@gmail.com wrote: Thanks Michael, Yes, I did run my earlier setup via maven exec. I know even less than you about Java packages in general and JavaFXPackager in particular ;) Nor about Maven projects :( I've had a couple of attempts at producing the gt-uber that you suggest. First problem is that NetBeans doesn't give me an option to produce a jar from a Maven project, although it does have a Maven/POM Project option which is described as A Maven pom-packaging project, usable as a parent and/or aggregator for other modules. That sounded promising, so I built a pom for this using dependencies and repositories and some of the plugins from the original pom. That seemed to go well, except that it doesn't produce a jar :( OK, build a Java/Java Class Library project which depends on the target directory of the Maven/POM Project. That produces a geotools.jar :) But it is a MANIFEST-only jar, which suggests that it hasn't done what I want :( Can someone point me at how to build gt-uber? Frank On Tue, Nov 26, 2013 at 1:22 PM, Michael Bedward michael.bedw...@gmail.com wrote: Hi Frank, Yep, I don't think adding the shade plugin here will make any difference because you are already using the exec plugin to call JavaFXPackager. A quick look at the docs (http://docs.oracle.com/javafx/2/deployment/packager.htm) suggests that it is creating a single output jar for you. If that's the case, then I think the SPI merging problem that I suggested earlier does indeed apply. In your earlier kludge setup, did you run your app via maven exec rather than assembling a single jar ? With the caveat that I no nothing about JavaFX or JavaFXPackager, one suggestion would be to pre-combine all of your GeoTools dependencies into a single dep jar (e.g. gt-uber) using the shade plugin, and then reference that from your build instead of the individual gt modules. But hopefully someone else here or in JavaFX forums will have a better suggestion. Michael On 26 November 2013 10:52, Frank van der Hulst drifter.fr...@gmail.com wrote: Thanks for the reply Michael. Below is my complete pom.xml... this is pretty much the standard Maven
Re: [Geotools-gt2-users] Geotools JavaFX Netbeans 7.4
Hi Frank, Your last reply fell off the list... Here's an example pom.xml to create a GeoTools uber jar using the shade plugin... https://gist.github.com/mbedward/7669318 To use it, just stick it in a new directory somewhere, edit it to add the GeoTools dependencies you need, and run mvn install from the command line. You can also build it from within Netbeans if you like. You should end up with gt-uber-10.2.jar in the target sub-dir and your local maven repo. You can then reference gt-uber from your application pom.xml. No idea if this will fix your JavaFXPackager problem but it's worth a try :) Michael On 27 November 2013 10:16, Frank van der Hulst drifter.fr...@gmail.com wrote: Thanks Michael, Yes, I did run my earlier setup via maven exec. I know even less than you about Java packages in general and JavaFXPackager in particular ;) Nor about Maven projects :( I've had a couple of attempts at producing the gt-uber that you suggest. First problem is that NetBeans doesn't give me an option to produce a jar from a Maven project, although it does have a Maven/POM Project option which is described as A Maven pom-packaging project, usable as a parent and/or aggregator for other modules. That sounded promising, so I built a pom for this using dependencies and repositories and some of the plugins from the original pom. That seemed to go well, except that it doesn't produce a jar :( OK, build a Java/Java Class Library project which depends on the target directory of the Maven/POM Project. That produces a geotools.jar :) But it is a MANIFEST-only jar, which suggests that it hasn't done what I want :( Can someone point me at how to build gt-uber? Frank On Tue, Nov 26, 2013 at 1:22 PM, Michael Bedward michael.bedw...@gmail.com wrote: Hi Frank, Yep, I don't think adding the shade plugin here will make any difference because you are already using the exec plugin to call JavaFXPackager. A quick look at the docs (http://docs.oracle.com/javafx/2/deployment/packager.htm) suggests that it is creating a single output jar for you. If that's the case, then I think the SPI merging problem that I suggested earlier does indeed apply. In your earlier kludge setup, did you run your app via maven exec rather than assembling a single jar ? With the caveat that I no nothing about JavaFX or JavaFXPackager, one suggestion would be to pre-combine all of your GeoTools dependencies into a single dep jar (e.g. gt-uber) using the shade plugin, and then reference that from your build instead of the individual gt modules. But hopefully someone else here or in JavaFX forums will have a better suggestion. Michael On 26 November 2013 10:52, Frank van der Hulst drifter.fr...@gmail.com wrote: Thanks for the reply Michael. Below is my complete pom.xml... this is pretty much the standard Maven/JavaFX pom.xml generated by NetBeans, plus the dependencies and repositories for Geotools. ?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/xsd/maven-4.0.0.xsd; modelVersion4.0.0/modelVersion groupIdcom.mycompany/groupId artifactIdmavenproject2/artifactId version1.0-SNAPSHOT/version packagingjar/packaging namemavenproject2/name properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding mainClasscom.mycompany.mavenproject2.MainApp/mainClass slf4j.version1.6.1/slf4j.version geotools.version9.2/geotools.version /properties organization !-- Used as the 'Vendor' for JNLP generation -- nameYour Organisation/name /organization build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-dependency-plugin/artifactId version2.6/version executions execution idunpack-dependencies/id phasepackage/phase goals goalunpack-dependencies/goal /goals configuration excludeScopesystem/excludeScope excludeGroupIdsjunit,org.mockito,org.hamcrest/excludeGroupIds outputDirectory${project.build.directory}/classes/outputDirectory /configuration /execution /executions /plugin plugin groupIdorg.codehaus.mojo/groupId artifactIdexec-maven-plugin/artifactId version1.2.1/version executions execution idunpack-dependencies/id phasepackage/phase
Re: [Geotools-gt2-users] Geotools JavaFX Netbeans 7.4
Hi Frank, This is just a stab in the dark... Are you using this plugin: http://zenjava.com/javafx/maven/ ? And if so are you also using it to build an executable jar ? The error dump looks like it might be an SPI problem which can happen with GeoTools when module jars are combined into a single uber-jar without taking care to merge the META-INF/services entries properly. There is more info about this, although not in the context of JavaFX, here: http://docs.geotools.org/latest/userguide/faq.html#how-do-i-create-an-executable-jar-for-my-geotools-app Michael On 26 November 2013 08:48, Frank van der Hulst drifter.fr...@gmail.com wrote: Hi all, I'm new to this list, but have been using Geotools with Netbeans and JavaFX2 for some time. Recently I upgraded to Netbeans v7.4 and JDK 1.7u45 and rebuilt my Mapping project to use the newly available Maven/JavaFX Application project type. Previously I had kludged up a link to the JavaFX runtime jar in an ordinary Maven/Java Application project. That worked, but didn't allow use of the JavaFX GUI builder. Now when I run my app, it crashes. :( This happens on both Windows 7.0 and Ubuntu Linux. I've tried with various versions of GeoTools from 9.2 through 10.2, without any change. I've tried re-installing Netbeans Java. No joy. I've simplified things down as much as possible, to the point where I've added one reference to GeoTools in the default project:package com.mycompany.mavenproject2; import java.net.MalformedURLException; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Label; import org.geotools.data.FileDataStore; import org.geotools.data.shapefile.ShapefileDataStore; public class FXMLController implements Initializable { @FXML private Label label; @FXML private void handleButtonAction(ActionEvent event) { System.out.println(You clicked me!); try { FileDataStore store = new ShapefileDataStore(new URL(file:/C:/Users/frankv/Documents/Mapping/Output/XCSoar/Airstrip.shp)); } catch (MalformedURLException ex) { throw new RuntimeException(ex); } label.setText(Hello World!); } @Override public void initialize(URL url, ResourceBundle rb) { // TODO } } When this gets executed in the Maven/JavaFX2 application, I get this output: Nov 26, 2013 9:56:00 AM org.geotools.factory.FactoryRegistry scanForPlugins WARNING: Can't load a service for category FilterFactory. Cause is ServiceConfigurationError: org.opengis.filter.FilterFactory: Provider org.geotools.filter.FilterFactoryImpl not a subtype. java.util.ServiceConfigurationError: org.opengis.filter.FilterFactory: Provider org.geotools.filter.FilterFactoryImpl not a subtype at java.util.ServiceLoader.fail(ServiceLoader.java:231) at java.util.ServiceLoader.access$300(ServiceLoader.java:181) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:369) at java.util.ServiceLoader$1.next(ServiceLoader.java:445) at org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:826) at org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:772) at org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:805) at org.geotools.factory.FactoryRegistry.getUnfilteredProviders(FactoryRegistry.java:230) at org.geotools.factory.FactoryRegistry.getServiceImplementation(FactoryRegistry.java:430) at org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:365) at org.geotools.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:145) at org.geotools.factory.CommonFactoryFinder.lookup(CommonFactoryFinder.java:346) at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:300) at org.geotools.factory.CommonFactoryFinder.getFilterFactory2(CommonFactoryFinder.java:390) at org.geotools.factory.CommonFactoryFinder.getFilterFactory2(CommonFactoryFinder.java:404) at org.geotools.data.DataUtilities.clinit(DataUtilities.java:200) at org.geotools.data.shapefile.ShpFiles.exists(ShpFiles.java:1023) at org.geotools.data.shapefile.ShpFiles.init(ShpFiles.java:185) at org.geotools.data.shapefile.ShpFiles.init(ShpFiles.java:142) at org.geotools.data.shapefile.ShapefileDataStore.init(ShapefileDataStore.java:200) at org.geotools.data.shapefile.ShapefileDataStore.init(ShapefileDataStore.java:172) at org.geotools.data.shapefile.ShapefileDataStore.init(ShapefileDataStore.java:162) at com.mycompany.mavenproject2.FXMLController.handleButtonAction(FXMLController.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at
Re: [Geotools-gt2-users] Geotools JavaFX Netbeans 7.4
dependency groupIdorg.geotools/groupId artifactIdgt-coverage/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-cql/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-data/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-epsg-extension/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-epsg-hsql/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-jdbc/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-main/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-metadata/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-opengis/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-render/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-referencing/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-shapefile/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-swing/artifactId version${geotools.version}/version /dependency /dependencies repositories repository idosgeo/id nameOpen Source Geospatial Foundation Repository/name urlhttp://download.osgeo.org/webdav/geotools//url /repository /repositories /project I tried inserting the Maven Shade plugin, as follows, as the first plugin, but it didn't make any difference. plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-shade-plugin/artifactId version1.3.1/version executions execution phasepackage/phase goals goalshade/goal /goals configuration transformers !-- This bit sets the main class for the executable jar as you otherwise -- !-- would with the assembly plugin -- transformer implementation=org.apache.maven.plugins.shade.resource.ManifestResourceTransformer manifestEntries Main-Classcom.mycompany.mavenproject2.MainApp/Main-Class /manifestEntries /transformer !-- This bit merges the various GeoTools META-INF/services files -- transformer implementation=org.apache.maven.plugins.shade.resource.ServicesResourceTransformer/ /transformers /configuration /execution /executions /plugin Frank On Tue, Nov 26, 2013 at 11:50 AM, Michael Bedward michael.bedw...@gmail.com wrote: Hi Frank, This is just a stab in the dark... Are you using this plugin: http://zenjava.com/javafx/maven/ ? And if so are you also using it to build an executable jar ? The error dump looks like it might be an SPI problem which can happen with GeoTools when module jars are combined into a single uber-jar without taking care to merge the META-INF/services entries properly. There is more info about this, although not in the context of JavaFX, here: http://docs.geotools.org/latest/userguide/faq.html#how-do-i-create-an-executable-jar-for-my-geotools-app Michael On 26 November 2013 08:48, Frank van der Hulst drifter.fr...@gmail.com wrote: Hi all, I'm new to this list, but have been using Geotools with Netbeans and JavaFX2 for some time. Recently I upgraded to Netbeans v7.4 and JDK 1.7u45 and rebuilt my Mapping project to use the newly available Maven
Re: [Geotools-gt2-users] How to write shapefile of type 'Polygon' no 'Polygon ZM' in GT 10.2?
Just in case, does it make any difference if you call the polygon attribute the_geom rather than Extent ? I've been creating shapefiles with Polygon geometry using GT 10.2 and when the geometry attribute was called something other than the_geom it appeared empty when displayed. Michael On 26 November 2013 13:11, Ryan McKinley ryan...@gmail.com wrote: After upgrading an application from 9.x to 10.2 I am hitting an issue with the shape files it create. I am using code similar to: http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html rather than Point, it uses Polygon (from JTS) builder.add( Extent, Polygon.class ); With 9.x this created a shapefile we can easily load in most things. With 10.2, it create one that looks valid, but I don't see any data. In ArcMap I notice the type for 10.2 is Polygon ZM: https://www.monosnap.com/image/NrCKomSD1ZvcdbJ2UyNE0CwDF How do I make this a simple Polygon without ZM support? Thanks Ryan -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] null pointer expection inShapefileFeatureSource
On 20 September 2013 07:58, Andrea Aime andrea.a...@geo-solutions.it wrote: On Thu, Sep 19, 2013 at 10:51 PM, Duane Zamrok zam...@cubrc.org wrote: I’m not sure if Hal was working on the SelectionLab of the Style tutorial (http://docs.geotools.org/latest/userguide/tutorial/map/style.html) or not, but the createStyle method (http://docs.geotools.org/latest/userguide/tutorial/map/style.html#what-features-did-the-user-click-on) contains the following line which is in direct conflict with what Andrea said. Jody, know anything about that filter? Mmm... I think I have to take the blame for that code - it worked fine through quite a few versions. I'd be more than happy to let Jody fix it :) Michael -- LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. http://pubads.g.doubleclick.net/gampad/clk?id=58041151iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Deprecated Methods/Objects?
Hi Philipp, Especially the ‘SelectionLab.java’, which contains two lines using ‘MapContext’ objects, is basically unusable. It sounds like you are looking at an old version of the SelectionLab tutorial code. The current one definitely uses MapContent rather than MapContext: http://docs.geotools.org/latest/userguide/tutorial/map/style.html Michael -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58041391iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] raster image not aligned to shapefile
Hello Hal, I have several shapefiles and a raster (a Hillshade created in ArcMap from elevation data) that align perfectly when I view them in ArcMap (10.0). I then export the hillshade to a tiff file using the extent and CRS of the ArcMap data frame. When I load them into my geotools application, the raster is offset from the shapefile. Offset by how much ? Half a cell width in both directions ? Wildly out of alignment ? Also, how are you displaying the layers in your GeoTools application (ie. gt-swing, gt-swt, custom widgets, StreamingRenderer or custom renderer class). If it's hard to describe the results it may be easier to link to an image in imagebin.org or similar. Michael -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58041391iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Loading EPSG:4326 CRS
On 6 September 2013 08:42, Spencer Bliven sbli...@ucsd.edu wrote: [SOLVED] Thanks for the help, Michael! I think you did all the work Spencer :) Michael -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58041391iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Selecting features on a Raster Map
On 5 September 2013 07:10, David Purdy david.pu...@jjmtechcorp.com wrote: May I ask how you go about implementing the click and drag to establish a rectangle? I have a feature that creates a polygon but requires several clicks, not the click and drag. I'm not looking for the code, just the concept of how its done. You can probably adapt the existing click and drag code for your purposes... https://github.com/geotools/geotools/blob/master/modules/unsupported/swing/src/main/java/org/geotools/swing/MouseDragBox.java Michael -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58041391iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Loading EPSG:4326 CRS
Hi Spencer, Use the maven shade plugin instead of the assembly plugin: http://docs.geotools.org/latest/userguide/build/faq.html#how-do-i-create-an-executable-jar-for-my-geotools-app Michael On 29 August 2013 11:39, Spencer Bliven sbli...@ucsd.edu wrote: Hello, I've run into a problem with loading some SMRT+ data from disk. In my development environment (eclipse) I am able to perfectly load the files and access elevation data. However, I need to deploy the app as a stand-alone jar file (it's a plugin to another system). In the deployment environment I get the exception org.opengis.referencing.NoSuchAuthorityCodeException: No code EPSG:4326 from authority EPSG found for object of type EngineeringCRS. Which traces back to a call CRS.decode(EPSG:4326, true); After some debugging I traced the difference between the environments back to a missing entry in the results from ReferencingFactoryFinder.getCRSAuthorityFactories(hints) In development this method returns 4 factories, while in production it is missing one called 'LongitudeFirstFactory[European Petroleum Survey Group]' which clearly provides the information I need. Could anyone help me figure out why this is not being loaded when run from within another jar rather than being located in the classpath? I assume that some resource file with the EPSG spec is not being loaded correctly, but I'm not sure how to locate said file. BTW, I'm using the maven assembly plugin to generate my jar. It pretty much just combines throws all the classes and resources from dependencies into the target bundle, so it can have problems with common files like META-INF/MANIFEST.MF. I hope that's not a red herring. Thanks! -Spencer -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Geotools 8.0 to 9.4 difference with SimpleFeatureCollection and Map refresh
On 23 August 2013 01:03, Andrea Aime andrea.a...@geo-solutions.it wrote: I believe that functionality was based on the feature collection events, which were dropped because only in memory collections actually implemented them (after several years they were introduced). Yep - that's right. It's a pity, because it was a convenient system for the swing module - but c'est la vie. Perhaps just create a custom feature collection class by raiding the code from previous versions of GeoTools. Michael -- Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] EPSG error
Yes, that's the best way to do it. There is a GeoTools FAQ about this too: http://docs.geotools.org/latest/userguide/faq.html#how-do-i-create-an-executable-jar-for-my-geotools-app Michael On 9 August 2013 07:26, Barret Burke barret.bu...@gmail.com wrote: Regarding Andrea Aime last response: Ah, I think I know it, it's the single jar packaging that's breaking everything. ... Long story short, it's not possible to merge the GeoTools jars in a single jar unless you're also manually editing the files in META-INF/services so that they contain the sum of all same named file contents I had the same problem using the Maven shade plugin, but resolved it using the ServicesResourceTransformer. See http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#ServicesResourceTransformer -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Feature geometry modify and viewer in execution time
Hi Jairo, Can you describe the output that you would like to get in more detail please ? Michael On 2 August 2013 05:15, Jairo de Almeida jairodealme...@gmail.com wrote: Hello, Guys I have implemented a algorithm to union about polygons with restriction. And have some problems to implement the 1.0 version of algorithm http://postimg.org/image/aiqrm7znn/full/ This image represents a union point of crash my logic =/ My question is how to view this iterator union in process time, for example When i execute my source http://pastebin.com/Gta60f90 I can view this little itens of unions when i wait my process flow. Thanks, Jairo. -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope
Could you update the axis order page Ben, for the benefit of future generations (esp. simple folk like me) ? After reading your replies I saw the note about the ogc urn thing, but it is at the very bottom of the page. It should also probably get a mention in the referencing FAQ. cheers Michael On 29 July 2013 15:36, Ben Caradoc-Davies ben.caradoc-dav...@csiro.au wrote: Gaby creating an OGC URN or OGC HTTP URI CRS identifier is as simple as appending the EPSG code to the prefix as below: int epsgCode = 2193; String ogcUrn = urn:ogc:def:crs:EPSG:: + epsgCode; String ogcHttpUri = http://www.opengis.net/def/crs/EPSG/0/; + epsgCode; I missed the double colon :: in my first example, but GeoTools is lenient. An optional database version can go between the colons; :: means none. The HTTP URI /0/ also means no version. These forms should be fine for most users. Gaby, I have had to make changes to the implementation and I have nightmares too! Now we have excellent test coverage, and OGC URN and OGC HTTP URI forms and I sleep better at night. :-) See also: http://jira.codehaus.org/browse/GEOT-4160 HTTP URIs are current OGC policy: In June 2010 OGC revised the naming policy to use http URIs to identify persistent OGC resources instead of URNs. http://www.opengeospatial.org/projects/groups/ogcnasc Whitepaper: OGC Identifiers - the case for http URIs (OGC 10-124r1): https://portal.opengeospatial.org/files/?artifact_id=39467 Kind regards, Ben. On 29/07/13 13:22, gaby wrote: I agree with you Ben, it is not robust at all and it gives me nightmares about other coordinate systems. I will try using the OGC urn code instead. Does anyone have a link for how to come up with the codes? Thanx Gaby -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Need-help-reprojecting-ReferencedEnvelope-tp5069254p5069266.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Ben Caradoc-Davies ben.caradoc-dav...@csiro.au Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Need help reprojecting ReferencedEnvelope
Does this help Gaby ? http://docs.geotools.org/latest/userguide/library/referencing/order.html Michael On 29 July 2013 13:06, gaby g.tu...@niwa.co.nz wrote: I would like to reproject a ReferencedEnvelope from NZMG to NZTM. My code is a follows: ReferencedEnvelope envelope = new ReferencedEnvelope(xmin, xmax, miny, maxy, sourceCRS); In Eclipse I can see it contains the correct bounds and CRS: ReferencedEnvelope[1567451.39 : 1570650.34, 5178586.92 : 5184734.56] PROJCS[NZGD2000 / New Zealand Transverse Mercator 2000, GEOGCS[NZGD2000, DATUM[New Zealand Geodetic Datum 2000, SPHEROID[GRS 1980, 6378137.0, 298.257222101, AUTHORITY[EPSG,7019]], TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], AUTHORITY[EPSG,6167]], PRIMEM[Greenwich, 0.0, AUTHORITY[EPSG,8901]], UNIT[degree, 0.017453292519943295], AXIS[Geodetic latitude, NORTH], AXIS[Geodetic longitude, EAST], AUTHORITY[EPSG,4167]], PROJECTION[Transverse_Mercator, AUTHORITY[EPSG,9807]], PARAMETER[central_meridian, 173.0], PARAMETER[latitude_of_origin, 0.0], PARAMETER[scale_factor, 0.9996], PARAMETER[false_easting, 160.0], PARAMETER[false_northing, 1000.0], UNIT[m, 1.0], AXIS[Northing, NORTH], AXIS[Easting, EAST], AUTHORITY[EPSG,2193]] To transform I use ReferencedEnvelope newEnv = envelope.transform(targetCRS, false) In Eclipse I can see it contains incorrect bounds and right CRS: ReferencedEnvelope[-9.355285704178331E8 : -5.476698694654962E7, 7.380212019166924E7 : 2.0383109009204366E9] PROJCS[NZGD49 / New Zealand Map Grid, GEOGCS[NZGD49, DATUM[New Zealand Geodetic Datum 1949, SPHEROID[International 1924, 6378388.0, 297.0, AUTHORITY[EPSG,7022]], TOWGS84[59.47, -5.04, 187.44, 0.47, 0.1, -1.024, -4.5993], AUTHORITY[EPSG,6272]], PRIMEM[Greenwich, 0.0, AUTHORITY[EPSG,8901]], UNIT[degree, 0.017453292519943295], AXIS[Geodetic latitude, NORTH], AXIS[Geodetic longitude, EAST], AUTHORITY[EPSG,4272]], PROJECTION[New_Zealand_Map_Grid, AUTHORITY[EPSG,9811]], PARAMETER[latitude_of_origin, -41.0], PARAMETER[central_meridian, 173.0], PARAMETER[false_easting, 251.0], PARAMETER[false_northing, 6023150.0], UNIT[m, 1.0], AXIS[Easting, EAST], AXIS[Northing, NORTH], AUTHORITY[EPSG,27200]] What am I doing wrong? Thanx Gaby -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Need-help-reprojecting-ReferencedEnvelope-tp5069254.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Re-centering map on a Coordinate/Point
Hi David, The centering is done by the onMouseClicked method of the zoom in and out tools. It's a pretty simple calculation. Have a look at the source below and you should be able to adapt it to your needs... https://github.com/geotools/geotools/blob/master/modules/unsupported/swing/src/main/java/org/geotools/swing/tool/ZoomInTool.java#L95 Michael On 23 July 2013 11:43, David Purdy david.pu...@jjmtechcorp.com wrote: Hi All, ** ** I have an application where I need to re-center the map when the user requests that action. Something very similar to what happens with the zoom in and zoom out buttons from a JMapFrame. Those buttons zoom in/out but also center on where-ever the user clicks on the map. I would like to do the same but on a current point I have within the app. The following code snippet works but re-positions the map with the current point in the bottom left of the display area: ** ** * public* *void* centerMapOnCurrentPos() { ReferencedEnvelope currentEnvelope = mapFrame .getMapPane().getDisplayArea(); *double* displayWidth = currentEnvelope.getWidth(); *double* displayHeight = currentEnvelope.getHeight(); *double* x = currentPoint.x; *double* y = currentPoint.y; Rectangle2D newArea= *new*Rectangle2D.Double(x,y,displayWidth,displayHeight); GeneralEnvelope envelope = *new* GeneralEnvelope(newArea); mapFrame.getMapPane().setDisplayArea(envelope); } ** ** I tried looking for the source for the zoom in/zoom out buttons but was unable to find what actually does the centering. Anyone have any suggestions? ** ** Thanks so much! ** ** Dave ** ** *David Purdy* *Owner/President* *JJM Technologies Corporation* *Email: david.pu...@jjmtechcorp.com* *[image: signatureLogo]* ** ** -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users image001.gif-- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Re-centering map on a Coordinate/Point
You're welcome David - glad to hear it worked for you. Michael On 23 July 2013 12:32, David Purdy david.pu...@jjmtechcorp.com wrote: Hi Michael, ** ** That is perfect! Thanks so much for the quick response! I put that in place and adapted it to my code and it worked perfectly. Thanks so much!! ** ** David ** ** *From:* Michael Bedward [mailto:michael.bedw...@gmail.com] *Sent:* Monday, July 22, 2013 10:06 PM *To:* David Purdy *Cc:* geotools users *Subject:* Re: [Geotools-gt2-users] Re-centering map on a Coordinate/Point ** ** Hi David, ** ** The centering is done by the onMouseClicked method of the zoom in and out tools. It's a pretty simple calculation. Have a look at the source below and you should be able to adapt it to your needs... ** ** https://github.com/geotools/geotools/blob/master/modules/unsupported/swing/src/main/java/org/geotools/swing/tool/ZoomInTool.java#L95 ** ** Michael ** ** ** ** On 23 July 2013 11:43, David Purdy david.pu...@jjmtechcorp.com wrote:*** * Hi All, I have an application where I need to re-center the map when the user requests that action. Something very similar to what happens with the zoom in and zoom out buttons from a JMapFrame. Those buttons zoom in/out but also center on where-ever the user clicks on the map. I would like to do the same but on a current point I have within the app. The following code snippet works but re-positions the map with the current point in the bottom left of the display area: * public* *void* centerMapOnCurrentPos() { ReferencedEnvelope currentEnvelope = mapFrame .getMapPane().getDisplayArea(); *double* displayWidth = currentEnvelope.getWidth(); *double* displayHeight = currentEnvelope.getHeight(); *double* x = currentPoint.x; *double* y = currentPoint.y; Rectangle2D newArea= *new*Rectangle2D.Double(x,y,displayWidth,displayHeight); GeneralEnvelope envelope = *new* GeneralEnvelope(newArea); mapFrame.getMapPane().setDisplayArea(envelope); } I tried looking for the source for the zoom in/zoom out buttons but was unable to find what actually does the centering. Anyone have any suggestions? Thanks so much! Dave *David Purdy* *Owner/President* *JJM Technologies Corporation* *Email: david.pu...@jjmtechcorp.com* *[image: signatureLogo]* -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users ** ** image001.gif-- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] JMapPane not repainting properly some times
Mmm... while it's ok to call the layerChanged method manually, it should not be unnecessary. That method gets called behind the scenes as part of the event chain when the layer is removed from the MapContent. In your gist, you should really put the code that sets up and displays the JMapFrame inside a SwingUtilities.invokeLayer( ... ) block. This is done for you when you use the static JMapFrame.showMap as you can see in the sources... https://github.com/geotools/geotools/blob/master/modules/unsupported/swing/src/main/java/org/geotools/swing/JMapFrame.java#L140 Swing apps typically misbehave if any widget operations (creation, display, changing properties) are done off the EDT. I don't know if that is causing the repaint problems in Sunish's case, but it's possible. Michael On 17 July 2013 04:40, Oleksandr Huziy guziy.sa...@gmail.com wrote: Sunish: If you want to repaint the whole layer you can use mapFrame.getMapPane().layerChanged(mplle); see the example here: https://github.com/guziy/GeotoolsDemo/blob/master/src/RoughCreatingPoint.java method createFeatures. Cheers 2013/7/16 sunish sunish.ku...@gmail.com Hello, Some times after removing some layers and adding other set of layers JMapPane is not repainting properly. Some times it paints properly, some times partially and some times there is no repainting. Is there any way to force repaint of layers? I tried mapPane.setIgnoreRepaint(true); ... Remove Add Layers mapPane.setIgnoreRepaint(false); mapPane.repaint(); But the repaint was not happening. Can the paintDelay help in this? Thanks for support, Sunish. -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] JMapPane not repainting properly some times
On 17 July 2013 10:55, Michael Bedward michael.bedw...@gmail.com wrote: should not be unnecessary. Oops, I meant should not be necessary. Michael -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Label of removed layer getting painted in JMapPane
Hi Sunish, It's well hidden but you can do this... StreamingRenderer renderer = mapPane.getRenderer(); MapObject, Object hints = renderer.getRendererHints(); LabelCache cache = (LabelCache) hints.get(StreamingRenderer.LABEL_CACHE_KEY); cache.clear(); You could also sub-class JMapPane and access the protected labelCache field. Michael On 15 July 2013 22:52, sunish sunish.ku...@gmail.com wrote: Hello, I am using geotools 10 snapshot. Testing JMapPane. After removing a layer I added a new one. JMapPane is showing labels of both. Is there a way to clear the label cache? Thank You, Sunish -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Get coordinates of square grid
Hello, The answer is it depends :) Each square in the grid is represented by a SimpleFeature having, as its geometry attribute, a JTS Polygon. You can retrieve the vertex coordinates of the polygon using the Polygon.getCoordinates() method... http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Polygon.html#getCoordinates() If you used Grids.createSquareGrid( env, sideLen ) to create the grid, then the polygons will just have corner vertices. However, if you requested densified squares (e.g. suitable for reprojection) using createSquareGrid( env, sideLen, vertexSpacing ) then you will have vertices for corners plus additional vertices along each side. In that case you could just search for the vertex with the minimum X and Y ordinates and just calculate the others with simple arithmetic. The above assumes that the squares are in the same reference system used when creating the grid. However, if you have densified squares which you have re-projected, and you want to be able to query the coordinates of the corners in the new reference system, then it might be easier to create the grid with a custom feature type which includes attributes for the corner coords. There should be enough info in the user manual and the javadocs for you to do this: http://docs.geotools.org/latest/userguide/extension/grid.html#working-with-a-user-defined-feature-type http://docs.geotools.org/latest/javadocs/org/geotools/grid/GridElement.html Hope that helps. Michael On 11 July 2013 00:34, ChangWook Kim hyper...@gmail.com wrote: Hi all, I am trying to get coordinates of vertex for square (latitude, longitude) with createSquareGrid(). Is it possible, and how can I achieve it? Basically, I want to divide U.S land into square and get coordinates of vertex for each square. Regards, Chang Wook -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Get-coordinates-of-square-grid-tp5065446.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Drawing points, lines and polygons on a map
Hi Farrukh, My Bad. I just attached the patch file. I assumed that since one has to click on a feature to get its information, it would be desirable to get all information about the feature (kind of like a Show Details action). If feature info was being dumped for all features then I could see the verbosity of feature details becoming an issue. I defer to your judgment on this though. Thanks for the patch - I'll try to look at it this week. For point geometries or very simple line stings (e.g. urban streets) it would be fine, but for more convoluted features (e.g. highways, regional boundaries) a each case would generate a lot of WKT. On the other hand, if the WKT was displayed in a secondary dialog there could be a 'copy to clipboard' button... Just a random idea, not a plan :) I will be posting a few residual issues later today related to my use of JMapPane / JMapFrame and would be grateful for your help. I'm afraid I can't guarantee assistance in the near future for anything big, but if there are easy bugs / improvements that you identify I'll do my best to look at them. Michael -- Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Drawing points, lines and polygons on a map
Hi Farrukh, Thanks for those kind words about the swing module. It's good to hear that you were able to extend it for your application relatively easily. I just had a quick look at your feature request but don't see your patch. However, my first thought is that the WKT for geometries other than points tends to be really long (commonly tens or hundreds of vertices). So being able to toggle such an option from the GUI or having the option of displaying the WKT in a secondary dialog might be better than having it displayed by default. Michael On 7 April 2013 23:50, Farrukh Najmi farr...@wellfleetsoftware.com wrote: Hi Jodie, Thanks for the high level tips and for the great geotools libraries. OpenJump looks interesting but is not usable in a commercial product due to viral nature of its GPL2 license. I was able to use a JMapFrame extension with some new CursorTool extensions to draw features with Point, LineString and Polygon geometry attributes and add features to the MapPane using a FeatureLayer. I am successfully using this to graphically enter a filter Geometry in WKT form to do spatial filter searches in my application. It is a credit to the good code you, Michael and colleagues wrote on the swing module that I was able to extend it relatively easily along the lines of what you described. In the process I file a relatively simple RFE along with a proposed patch to implement it. Thanks again for your kind help. On 04/06/2013 10:25 PM, Jody Garnett wrote: GeoTools is a spatial library responsible for accessing the data, and drawing it. It does provide a bit of SWT code to help with the tutorials, but that is not intended as a desktop GIS. If you would examples of how to edit as a developer look at the FeatureStore API, you can use it to update the Geometry for a feature. If you need to edit JTS Geometry it is a bit more tricky (often you end up taking a copy of the co-ordinates into your own data structure for interactive editing). Have a look at the Open Jump project (Swing based) and uDig project (SWT based) for examples. Note our gt-swing module does support very simple tools, and you could create edit tools if interested following the above examples. As of yet nobody has volunteered to write this functionally for the community. -- Jody Garnett On Wednesday, 3 April 2013 at 2:54 AM, Farrukh Najmi wrote: OK, how about some high level hints to point me in the right direction? On 04/01/2013 12:19 PM, Farrukh Najmi wrote: Hi Guys, I am wondering if any one has any sample code to share that draws points, lines and polygons on a map and allows basic editing of such geometries (perhaps just dragging and moving them). Here is an example in javascript with openlayers that is very much what I am looking for in Java / geotools: http://openlayers.org/dev/examples/drag-feature.html Thanks for your help. -- Regards, Farrukh Najmi Web: http://www.wellfleetsoftware.com -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] GridCoverage2D MultiplyConst HowTo set parameters
Hi Pablo, Unless you really need to work with the low-level coverage operations and parameters classes I'd avoid them. It is much easier, and better for your sanity, to use the Operations helper class instead. Example... GridCoverage2D cov = ... double[] factor = new double { 42 }; // one value per band of input coverage to be multiplied GridCoverage2D result = Operations.DEFAULT.multiply(cov, factor); Javadocs are here: http://docs.geotools.org/latest/javadocs/org/geotools/coverage/processing/Operations.html Hope this helps, Michael On 7 February 2013 23:22, PabloDR pablo.labor...@gmail.com wrote: Hi list, Can somebody tell me, how I can to set parameters to multiply a raster image by scalar? I know I've to set Source and constants parameters but I don't know how I've to do it. My code is this: public static Coverage multiplyCoverageByScalar(GridCoverage2D sourceImage, double scalar){ MultiplyConst multiply = new MultiplyConst(); ParameterDescriptorGroup paramDescriptor = (new ArcGridFormat()).getReadParameters().getDescriptor(); ParameterGroup params = (ParameterGroup) paramDescriptor.createValue(); params.parameter(Source).setValue(sourceImage); params.parameter(constants).setValue(scalar); Coverage coverage = multiply.doOperation(params, null); return coverage; } This code send me and error when I compile it because can't cast sourceImage from GridCoverage2D to Object. Thank you in advance. -- Pablo Díaz Redondo LaboraTe - USC http://laborate.usc.es pablo.diaz.redo...@usc.es / pablo.labor...@gmail.com Telf.: 982823301 -- Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] GridCoverage2D MultiplyConst HowTo set parameters
Sorry, minor code mistake. Should have been: double[] factor = new double[] { 42 }; On 8 February 2013 13:31, Michael Bedward michael.bedw...@gmail.com wrote: Hi Pablo, Unless you really need to work with the low-level coverage operations and parameters classes I'd avoid them. It is much easier, and better for your sanity, to use the Operations helper class instead. Example... GridCoverage2D cov = ... double[] factor = new double { 42 }; // one value per band of input coverage to be multiplied GridCoverage2D result = Operations.DEFAULT.multiply(cov, factor); Javadocs are here: http://docs.geotools.org/latest/javadocs/org/geotools/coverage/processing/Operations.html Hope this helps, Michael On 7 February 2013 23:22, PabloDR pablo.labor...@gmail.com wrote: Hi list, Can somebody tell me, how I can to set parameters to multiply a raster image by scalar? I know I've to set Source and constants parameters but I don't know how I've to do it. My code is this: public static Coverage multiplyCoverageByScalar(GridCoverage2D sourceImage, double scalar){ MultiplyConst multiply = new MultiplyConst(); ParameterDescriptorGroup paramDescriptor = (new ArcGridFormat()).getReadParameters().getDescriptor(); ParameterGroup params = (ParameterGroup) paramDescriptor.createValue(); params.parameter(Source).setValue(sourceImage); params.parameter(constants).setValue(scalar); Coverage coverage = multiply.doOperation(params, null); return coverage; } This code send me and error when I compile it because can't cast sourceImage from GridCoverage2D to Object. Thank you in advance. -- Pablo Díaz Redondo LaboraTe - USC http://laborate.usc.es pablo.diaz.redo...@usc.es / pablo.labor...@gmail.com Telf.: 982823301 -- Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] 'Point with direction' symbolization
Hi Sergey, Haven't tested this, but it can perhaps be done with the combination of an external graphic for the point symbol with a rotation element in the SLD file linking the angle to your feature attribute: Rotation ogc:PropertyNamedirAttributeName/ogc:PropertyName /Rotation The direction has to be in degrees. Michael On 31 January 2013 17:26, LSA l...@ngs.ru wrote: Hi, I have a point layer with attribute giving a direction vector for every point. Is it possible to create the special symbolization, which will show the direction (arrow) at every point, instead of usual circle, square, star, etc symbolization? Thanks in advance, Sergey -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_jan ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_jan ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Problem in Running the file
Please have a look at the more recent GeoTools Quickstart tutorial. It shows how to load and display a shapefile in a simple manner: http://docs.geotools.org/stable/userguide/tutorial/quickstart/ Michael On 28 January 2013 18:31, PARDHU D dpardhu...@yahoo.in wrote: Hi to all, I have downloaded .java file from the below link but I am unable to run this. https://svn.osgeo.org/geotools/tags/2.7.1/demo/example/src/main/java/org/geotools/demo/swing/ShapefileViewer.java Regards, D Pardhu. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Problem in Running the file
Hello, Please send your questions to the list rather than to me personally. Thanks for your reply. I already use this link and successfully called shape file into program. I am using NetBeans IDE 7.2.1 now I want to call a shape with out JMapFrmae into my program can it is possible? I want to fix shape file into main frame. I'm not sure if I understand your question, but if you mean can you display shapefiles in a general Java / Swing application (not using JMapFrame) the answer is yes. JMapFrame is really just an ordinary JFrame with a few predefined child components. The map display is handled by JMapPane: http://docs.geotools.org/stable/javadocs/org/geotools/swing/JMapPane.html (many of its methods are inherited from the AbstractMapPane base class). JMapPane can be used in the same way that you use a JPanel. You can put it in your own frame class or some other Swing container. On the other hand, if you are developing a NetBeans platform application, the answer is no. NetBeans GUI components are based on Swing but have a separate API (e.g. TopComponent class instead of JPanel). The GeoTools library does not provide support for NetBeans platform classes at present, although you could of course take the gt-swing sources and adapt them. Michael -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Problem in showing Layer on JmapPane
Hello Kapil, Your code is much more complicated that it needs to be and is also using very low-level classes / methods instead of higher-level user-friendly classes. Please study the GeoTools feature tutorial: http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html There you will see a better, easier way to create a SimpleFeatureType: http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html#another-way-to-build-a-simplefeaturetype Also, you should use GeometryFactory methods rather than creating geometries by hand, e.g. to create a MultiPolygon object: http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/GeometryFactory.html#createMultiPolygon(com.vividsolutions.jts.geom.Polygon[]) Michael On 23 January 2013 17:56, kapil kapilsharma...@gmail.com wrote: Hi Michael, Thanks for helping me but i am still unable to solved out my problem in PolygonfeatureHelper class, I make a createPolygonFeature() which return SimpleFeature and this method call createFeatureType() Here is the code public static SimpleFeature createPolyFeature(Geometry geom, String name ) { GeometryFactory gf = new GeometryFactory(); if(geom instanceof Polygon ){ geom = new MultiPolygon(new Polygon[] {(Polygon)geom },new GeometryFactory()); } Object[] featureAttributes = { geom, name }; SimpleFeatureBuilder sfb = new SimpleFeatureBuilder(createFeatureType()); sfb.add(featureAttributes); SimpleFeature f = sfb.buildFeature(null); return f; } public static SimpleFeatureType createFeatureType() { AttributeDescriptor[] typesNew = new AttributeDescriptor[2]; AttributeTypeBuilder build = new AttributeTypeBuilder(); build.setBinding(String.class); build.setNillable(true); build.setLength(48); build.defaultValue(null); build.setName(NAME); AttributeDescriptor descriptor = build.buildDescriptor( NAME ); AttributeTypeBuilder build1 = new AttributeTypeBuilder(); build1.setBinding(MultiPolygon.class); build1.setName(the_geom); GeometryType geometryType = build1.buildGeometryType(); GeometryDescriptor geomdescriptor = build1.buildDescriptor( the_geom, geometryType ); typesNew[0] = descriptor; typesNew[1] = geomdescriptor; SimpleFeatureTypeBuilder sf = new SimpleFeatureTypeBuilder(); sf.addAll(typesNew); sf.setName(Poly); SimpleFeatureType ft = sf.buildFeatureType(); return ft; } -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Problem-in-showing-Layer-on-JmapPane-tp5028912p5029151.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] AutoCommit does not support the getState opperations Error
Sorry - I've never used OMS and only have a dim idea of how it works. I'm copying this reply to someone who has worked with OMS and GeoTools a lot in case he can help. Other than that I guess you have to try the OMS folk at JavaForge (although their discussion forum looks to be ignored). Michael On 24 January 2013 16:23, Alireza Shamakhy alireza.shama...@gmail.com wrote: Hi Michael, Sorry for my late reply. actually my code passes the variable of type SimpleFeatureSource to OMS component and I think in OMS component something happens and the exception fires. the problem related to hash codes of the object of type SimpleFeatureSource, since when I run without or with OMS the hash codes are different. any clue!? Thanks for your consideration. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Problem in showing Layer on JmapPane
Hello Kapil, Looking at the error trace, the problem is with your feature data (java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry). Your FeatureHelper class must need a little help :) Michael On 22 January 2013 20:28, kapil kapilsharma...@gmail.com wrote: Hi List, I want to show a map on JmapPane, but i found exception when i run the code. Here is my code: ResultSet res = stmt.executeQuery(sql); SimpleFeatureCollection col = org.geotools.feature.FeatureCollections.newCollection(); while (res.next()) { col.add(PolygonFeatureHelper.createPolyFeature(new WKTReader().read(res.getString(the_geom)), res.getString(kide))); } StyleBuilder sb = new StyleBuilder(); MapStyleSetings mapSty = new MapStyleSetings(); //.. Irrelevent code // MapContent context = new MapContent(); villageLayer = new FeatureLayer(col, archStyle, Khasra); System.out.println(VILLAGELAYER+villageLayer); context.addLayer(villageLayer); mapPane.setMapContent(context); Jan 22, 2013 2:49:31 PM org.geotools.map.MapContent getMaxBounds WARNING: Unable to determine bounds of org.geotools.map.FeatureLayer[Khasra, VISIBLE] java.lang.ClassCastException: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry at org.geotools.data.collection.CollectionDataStore.getBoundsInternal(CollectionDataStore.java:164) at org.geotools.data.collection.CollectionDataStore.getBounds(CollectionDataStore.java:145) at org.geotools.data.AbstractFeatureSource.getBounds(AbstractFeatureSource.java:318) at org.geotools.data.AbstractFeatureSource.getBounds(AbstractFeatureSource.java:286) at org.geotools.map.FeatureLayer.getBounds(FeatureLayer.java:195) at org.geotools.map.MapContent.getMaxBounds(MapContent.java:600) at org.geotools.map.MapContent.getViewport(MapContent.java:665) at org.geotools.swing.AbstractMapPane.doSetMapContent(AbstractMapPane.java:539) at org.geotools.swing.AbstractMapPane.setMapContent(AbstractMapPane.java:517) at org.geotools.swing.JMapPane.setMapContent(JMapPane.java:86) at in.nic.niccg.lrc.gis.lrcmapmutation.MapFactory.drawVillageMap(MapFactory.java:167) at in.nic.niccg.lrc.gis.lrcmapmutation.VillageMap$ShowMapTask.doInBackground(VillageMap.java:292) at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at org.jdesktop.swingworker.SwingWorker.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Problem-in-showing-Layer-on-JmapPane-tp5028912.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] [Geotools-devel] GeoServer + PostGIS + Raster...
Hi Brett, Mikel, Could other devs please look at org.geotools.coverage.grid.io.AbstractGridCoverage2DReader.decimationOnReadingControl and confirm or deny that there is no possibility of a rounding error, underflow or double to int conversion that results in a negative number! Mikel, it is my feeling that this is the source of the IllegalArgumentException being thrown. It's probably best if you create a new Jira ticket for this so it doesn't get overlooked while the core developers are busy with the current release. Michael -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] generating large map bitmaps?
On 20 January 2013 21:09, Andrea Aime andrea.a...@geo-solutions.it wrote: Hmm... labels are always drawn last, wondering if with bigger images the tiles are getting swapped to disk, and when they are retrieved back to draw the labels for some reason they are not writable anymore. Just a hunch, got nothing better Good theory (even though I hope it's not true :). I'll create a unit test for that in JAITools and see what happens. Michael -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] generating large map bitmaps?
OK - I've just run a test here where a small DiskMemImage is created having 4 tiles, using a DiskMemTileCache that can only hold a single tile in memory. The test gets a Graphics object for the image and draws into each tile in turn It then draws into the tiles again, in the same order as before. This means that each tile will have been flushed to disk with the result of the first draw, then restored to memory to be drawn into again. The result (just displayed on screen by the test at the moment) looks fine to me. So it seems that a tile remains writable after being disk-cached. I actually thought it would be OK since both DiskMemImage and DiskMemTileCache received a lot of testing by several users when first released. Tomorrow (Sydney time) I'll tidy up the unit test and commit it to the jaitools repo. Meanshile, Akos - I'm not sure I understand your idea about the graphics transformations ? is this something else we can add a test for ? Michael On 20 January 2013 21:24, Ákos Maróy a...@maroy.hu wrote: On 20/01/13 11:14, Michael Bedward wrote: On 20 January 2013 21:09, Andrea Aime andrea.a...@geo-solutions.it wrote: Hmm... labels are always drawn last, wondering if with bigger images the tiles are getting swapped to disk, and when they are retrieved back to draw the labels for some reason they are not writable anymore. Just a hunch, got nothing better Good theory (even though I hope it's not true :). I'll create a unit test for that in JAITools and see what happens. thank you! looking at the images, it seems that labels are only drawn on the 'top-left corner' of the image, so my hunch would be that only the 'top-left tile' gets the labels drawn? and that this might be related to the transforms that are added to the Graphics object when drawn? well, it's just wild guessing anyway -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] generating large map bitmaps?
I love it when bugs get fixed while I'm sleeping peacefully :) Thanks for your great detective work Akos - very much appreciated. The patch looks good. The jaitools sources and issues were moved to GitHub last week so I've copied your Google Code issue there: https://github.com/mbedward/jaitools/issues/216 and committed your fix: https://github.com/mbedward/jaitools/commit/master Michael On 21 January 2013 04:48, Ákos Maróy a...@maroy.hu wrote: Michael, I seem to have solved the issue, please see a patch attached to this ticket: http://code.google.com/p/jaitools/issues/detail?id=215thanks=215ts=1358704047 Best regards, Akos -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] generating large map bitmaps?
On 21 January 2013 18:28, Ákos Maróy a...@maroy.hu wrote: and committed your fix: https://github.com/mbedward/jaitools/commit/master excellent. would this mean that this would appear in the -SNAPSHOT version of jaitools soon, through maven repositories? Hi Ákos, Yep - the 1.3 snapshot jars were updated a few hours ago and include your fix. The pom / repo details are here: http://code.google.com/p/jaitools/wiki/Maven#Snapshot_releases cheers Michael -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] generating large map bitmaps?
On 20 January 2013 04:27, Ákos Maróy a...@maroy.hu wrote: On 19/01/13 18:19, Andrea Aime wrote: Interesting. Anyways, if memory serves me right, TiledImage is tiled, but still fully allocated in memory: if I'm right and you're trying to render something that won't fit in memory you're out of luck anyways might be - although TiledImage seems to be able to handle bigger images in the same amount of memory Yep, the standard JAI TiledImage class keeps all of its tiles in memory - that's why DiskMemImage was created. Sorry - no suggestions for what might be happening with batik and the different rendering results. Michael -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122912 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Create memory layer without datasource
Hello Jairo, You have your SimpleFeatureTypeBuilder inside the loop that is creating features. So you are building a new, identical type for each separate feature and ending up with a very confused feature collection. Michael On 18 January 2013 03:02, Jairo de Almeida jairodealme...@gmail.com wrote: I need to create a layer in memory, without datasources, is possible create this, see next link to see the source http://pastebin.com/JEWz4HvN Executing this source shows me this exception, http://pastebin.com/9dCEuK1y there was any way to do this? Thanks. Jairo. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Create memory layer without datasource
Hello again Jairo, Previous comment still applies, but I just had another look at the error trace. It looks like you have not set a MapContent instance for the map frame before trying to add the layer, so the call to mappanel.getMapContent() is returning null. JMapFrame does not create a MapContent instance by default - although I guess it would be easy to add that behaviour without affecting any existing client code. I don't remember anyone asking for it though... Michael On 18 January 2013 11:03, Michael Bedward michael.bedw...@gmail.com wrote: Hello Jairo, You have your SimpleFeatureTypeBuilder inside the loop that is creating features. So you are building a new, identical type for each separate feature and ending up with a very confused feature collection. Michael On 18 January 2013 03:02, Jairo de Almeida jairodealme...@gmail.com wrote: I need to create a layer in memory, without datasources, is possible create this, see next link to see the source http://pastebin.com/JEWz4HvN Executing this source shows me this exception, http://pastebin.com/9dCEuK1y there was any way to do this? Thanks. Jairo. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to add polygons on existing map?
Hello, Thanks for sending the code... i am pasting here the complete code .. In this file i m trying to add a point layer on click of the Viewdata button.. but the point is not added on button click.. instead it gets added on clicking reset button..i hope you can see the problem.. I just compiled and ran your program using the countries shapefile as test data (from http://udig.refractions.net/files/docs/data-v1_1.zip). When I click the Viewdata button a blue dot appears on the map. When I zoom in and out in the neighbourhood of the blue dot it appears to be displayed properly. I think this is what you wanted to happen - yes ? I'm not sure why you are seeing different and incorrect behaviour. I know that we are working on different platforms: I'm using Mac OSX whereas I think you are using Windows (?) - but that shouldn't cause this problem. I used GeoTools version 8.3 - what version are you using ? What is meant to happen, and does when I run the program, is that when your new Layer is added to the MapContent, a layer added event is sent from the MapContent instance to listeners, one of which is the JMapPane. The map pane responds to the event by repainting. I don't see anything in your code that would modify or block that event processing. Sorry, I'm not sure what to suggest right now but will let you know if I have any ideas. Michael -- Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to add polygons on existing map?
On 17 January 2013 04:31, starscream niko...@hotmail.it wrote: I found another example on web: What I wish http://kyle-in-jp.blogspot.it/2012/01/geotools_25.html I'm afraid that is not a good example of how to draw a single graphic element on a map. It would be much easier to use a DirectLayer (sub-class DirectLayer and implement the draw method): http://docs.geotools.org/stable/javadocs/org/geotools/map/DirectLayer.html This has been discussed on the list a number of times: http://osgeo-org.1560.n6.nabble.com/template/NamlServlet.jtp?macro=search_pagenode=4317834query=DirectLayern=4317834 Hope this helps. Also, please read the posting guide for this list: http://docs.geotools.org/latest/userguide/welcome/userlistguide.html Michael -- Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] AutoCommit does not support the getState opperations Error
Hello, If you connect to the shapefile like this... FileDataStore store = FileDataStoreFinder.getDataStore(file); SimpleFeatureSource source = store.getFeatureSource(); ...do you still get the error ? Michael On 17 January 2013 13:23, Alireza Shamakhy alireza.shama...@gmail.com wrote: Hi, I have a simple program that loops through a SimpleFeatureCollection. public SimpleFeatureSource source; public class myclass() { public void execute() { try { SimpleFeatureCollection featuresIn = source.getFeatures(); System.out.println(featuresIn.size()); } catch (Exception e) { e.printStackTrace(); } } } I call execute function from other class like this: public class test() { public static void main(String args[]) { try { File file= new File(C:\\tt\\POA_2011_AUST.shp); Map map = new HashMap(); map.put( url, file.toURL() ); DataStore dataStore = DataStoreFinder.getDataStore( map ); SimpleFeatureSource source; String typeName = dataStore.getTypeNames()[0]; source = dataStore.getFeatureSource(typeName); myclass testclass=new myclass(); testclass.source = source; testclass.execute; } catch (Exception e) { e.printStackTrace(); } } } after running my program it shows: java.lang.UnsupportedOperationException: AutoCommit does not support the getState opperations Could you please have a look and see why it happens? -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] AutoCommit does not support the getState opperations Error
What version of GeoTools are you using ? On 17 January 2013 14:45, Alireza Shamakhy alireza.shama...@gmail.com wrote: Hi Michael, Thanks for your reply. Yes if I use FileDataStore still I get the error. I think the problem occurs when I copy value of SimpleFeatureSource from one class to another class. It is weird since the class type of the variable that holds SimpleFeatureSource in both classes are same, but the hashcode are not same. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to add polygons on existing map?
No worries - thanks for letting us know. Michael On 17 January 2013 17:01, Boided richa...@gmail.com wrote: Hi Michael , I tried my code with (countries.shp) as you did and it worked fine. and then i realised my mistake. i was passing the wrong values to the coordinates. i corrected it and it worked fine.. thanks a lot once again.. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] AutoCommit does not support the getState opperations Error
Mmm... I just read your message again... I think the problem occurs when I copy value of SimpleFeatureSource from one class to another class. It is weird since the class type of the variable that holds SimpleFeatureSource in both classes are same, but the hashcode are not same. Is the code you are running different to the code you posted ? In your post, the feature source is not being copied by value, you are just passing a reference to the other class. It's really no different than if you had done source.getFeatures().size() in the first class and I can't see why this would generate an auto-commit error. Michael -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to add polygons on existing map?
Hello, Sorry, but it's hard to answer your question because you don't describe or show how you are using the Layer that your method creates, or describe the other layers and viewport settings associated with your MapContent. I can't see anything obviously wrong with your method, although I haven't tested it. Michael On 15 January 2013 22:02, Boided richa...@gmail.com wrote: Hi guys, I tried the above example for adding the polygon on a map.. but my new layer is not getting displayed on the map.. instead the point is displayed when i click reset and that too out of the map.. what could be the reason for this? below is the code.. public static Layer getPointLayer(double latitude, double longitude) throws ParseException, SchemaException { 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 ); GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(); SimpleFeatureCollection features = FeatureCollections.newCollection(); float lat = (float) latitude; float lng = (float) longitude; SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName(Location); builder.setCRS(DefaultGeographicCRS.WGS84); // - Coordinate reference system builder.add(Location, Point.class); builder.length(15).add(Name, String.class); // - 15 chars width for name field SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE); com.vividsolutions.jts.geom.Point point = geometryFactory.createPoint(new Coordinate(lng, lat)); featureBuilder.add(point); featureBuilder.add(abc); SimpleFeature feature = featureBuilder.buildFeature(null); features.add(feature); Style style = SLD.createPointStyle(circle, Color.BLUE, Color.BLUE, 0.3f, 30); Layer pointLayer = new FeatureLayer(features, style); return pointLayer; } -- View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-add-polygons-on-existing-map-tp5027259p5027538.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] generating large map bitmaps?
Hi Akos, Andrea, Jody and others here are rendering gurus and I hope they will follow with more expert advice, but I'll get the ball rolling... If the destination image fits into available memory then yes, simply create a Graphics2D instance from the image and pass that to the renderer. If the destination image is way too big for available memory you might have a look at the JAITools DiskMemImage class. This is a tiled image class that caches tiles both in memory and in temporary files on disk. http://jaitools.org/docs/jaitools/stable/apidocs/org/jaitools/tiledimage/DiskMemImage.html You can tune the volume of image data that is stored in memory vs on disk to reduce disk i/o time. However, it will still be a great deal slower than having the entire image in memory. Michael On 16 January 2013 07:35, Ákos Maróy a...@maroy.hu wrote: Hi, I'd like to create considerably large bitmaps by rendering SLD-styled layers using the geotools API. The rendering part looks straightforward, with a DataSource, Style created via SLDParser, StreamingRenderer, FeatureLayer, MapContent, etc. objects. But, it seems that creating large bitmaps using Java is not that simple. Moreover, I see that quite some work has already been done in the geotools library to this extent. Still, looking at the documentation, it's not straightforward for me which way to go. If I already have a MapContent object, with appropriate FeatureLayer objects in it, what would be the intended / suggested way to render it into big bitmaps. Should one simple create a TiledImage, get the Graphics2D object via TiledImage.createGraphics(), and use the StreamingRenderer to render into this Graphics2D object? Or is there a better / more advised way of doing this? by big, I mean for example rendering an area of about 550km x 350km at a scale of 1:500.000, with 600dpi or more - that is images of about 26.000 x 16.000 pixels or more. Best regards, Akos -- Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to add polygons on existing map?
Hello, Again, it's hard to know without knowing more about the other parts of your code and your data. If you can send me a *small* example app (off-list or via a paste site) which displays the problem I'll have a look at it and see if it's a gt-swing problem. Michael On 16 January 2013 16:12, Boided richa...@gmail.com wrote: Hi, Actually after creating the Points layer , I am adding it to my MapContent. I have created this layer on some event (for eg: jump to a particular lat/lon point) and then added this layer to the MapContent by map.addLayer(layer) method.. thats it. do i need to add something else also? -- View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-add-polygons-on-existing-map-tp5027259p5027729.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to add polygons on existing map?
Hello, Firstly, please try to be more specific with your questions: for example, I want to do X but when I run my app it does Y, or my code fails to compile with the following error trace... etc. People here want to help you, but if you just post code with a general please help message you are less likely to get useful answers. I'm not sure what you mean when you say: add some polygons that won't disappear when you zoom. Your getCitiesLayer method seems to be trying to create a layer of points - yes ? As long as you only call that once when you are setting up the layers to display things those points should not disappear. There is a bug in your getCitiesLayer method: you are setting Point and String values when creating a feature but you have forgotten to add the String attribute to your feature type. Please use MapContent in your code instead of the deprecated MapContext / DefaultMapContext classes. It is easier and more reliable. You should also avoid using the deprecated FeatureCollection.add method. For the approach that is now recommended please see the Features tutorial: http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html I hope that helps a bit. Michael On 14 January 2013 20:31, starscream niko...@hotmail.it wrote: Hi all, I'm working on a school project and untill now I have written my code, thanks to geotools tutorials, to build a map, and it works perfectly! Now I want to know how can I add some polygons on the layer of the map without losing them when I zoom in/out? I want to do this because I have an Excel file with some cities coordinates and I want to show them on the map! I've written this code: import java.awt.Color; import java.awt.Point; import java.io.File; import org.geotools.data.FeatureSource; import org.geotools.data.FileDataStore; import org.geotools.data.FileDataStoreFinder; import org.geotools.data.simple.SimpleFeatureCollection; import org.geotools.feature.FeatureCollections; import org.geotools.feature.simple.SimpleFeatureBuilder; import org.geotools.feature.simple.SimpleFeatureTypeBuilder; import org.geotools.geometry.jts.JTSFactoryFinder; import org.geotools.geometry.jts.WKTReader2; import org.geotools.map.DefaultMapContext; import org.geotools.map.FeatureLayer; import org.geotools.map.Layer; import org.geotools.map.MapContext; import org.geotools.referencing.crs.DefaultGeographicCRS; import org.geotools.styling.PolygonSymbolizer; import org.geotools.styling.SLD; import org.geotools.styling.StyleBuilder; import org.geotools.swing.JMapFrame; import org.opengis.feature.simple.SimpleFeatureType; import org.opengis.style.Style; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.io.ParseException; import com.vividsolutions.jts.io.WKTReader; import com.vividsolutions.jts.util.GeometricShapeFactory; public class GIS{ public static void main(String[] args) throws Exception { usingFeatureCaching(); } public static void usingFeatureCaching() throws Exception { File file = new File(C:\\PE\\reg2011_g.shp); FileDataStore store = FileDataStoreFinder.getDataStore(file); FeatureSource featureSource = store.getFeatureSource(); // Creates a map and adds the shape file MapContext map = new DefaultMapContext(); map.setTitle(La mappa dei Comuni d'Italia); //Creates the map style StyleBuilder sb = new StyleBuilder(); PolygonSymbolizer restrictedSymb = sb.createPolygonSymbolizer(Color.LIGHT_GRAY, Color.BLACK, 0); //Sets opacity restrictedSymbreg2011_g.shp.getFill().setOpacity(sb.literalExpression(0.5)); org.geotools.styling.Style restrictedStyle = sb.createStyle(restrictedSymb); //Adds the layer to the map map.addLayer(featureSource, restrictedStyle); map.addLayer(getCitiesLayer()); //? // Visualizza la Mappa JMapFrame.showMap(map); } public static Layer getCitiesLayer(){ SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder(); GeometryFactory geomFactory = new GeometryFactory(); b.setName( pictures ); b.setCRS( DefaultGeographicCRS.WGS84); //picture location b.add( geom, Point.class ); final SimpleFeatureType TYPE = b.buildFeatureType(); SimpleFeatureCollection collection = FeatureCollections.newCollection(internal); WKTReader2 wkt = new WKTReader2(); // Simple point coordinates (is an example) float lat = (float) 508469.7040; float lng = (float) 4358409.7367;
Re: [Geotools-gt2-users] How to add polygons on existing map?
Ah, but you're doing the same thing again :) Before you had a feature type with one attribute but tried to create a feature with two. Now you have a type with two attributes... // add attributes in order builder.add(Location, Point.class); builder.length(15).add(Name, String.class); // - 15 chars width for name field but then you try to add three attributes to your feature... featureBuilder.add(point); featureBuilder.add(Cagliari); featureBuilder.add(12); That is what the error message is telling you. Michael -- Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512 ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Map flickers on panning
Hello, Instead of MapContext / DefaultMapContext, which is deprecated in GeoTools versions 8.x, please try using the newer MapContent class and see if that fixes the problem: http://docs.geotools.org/stable/javadocs/org/geotools/map/MapContent.html Michael On 24 December 2012 16:33, Boided richa...@gmail.com wrote: Hi, Geotools rocks! i jus have a small issue. I am displaying multiple shapefiles. I am adding shapefile layer to MapContext on some event. and removing the layer also on some event. But the problem is the layer doesnt get removed. it gets removed on panning or again doing the event. I m using map.addLayer(layer); // for adding the layer where layer is a MapLayer and map is the instance of DefaultMapContext. and map.removeLayer(layer); // for removing the layer and one more thing.. on Panning the Map flickers a lot... -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Map-flickers-on-panning-tp5024499.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Adding a point on selected lat/lon position
On 24 December 2012 15:59, Boided richa...@gmail.com wrote: Thanks again Michael . It Worked. :) Good to hear - thanks for letting us know. Michael -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Adding a point on selected lat/lon position
On 21 December 2012 21:15, Boided richa...@gmail.com wrote: Can anyone please suggest about how to add a point on the map on a location One question mark is usually enough. More doesn't get you better answers :) You could use a DirectLayer to display your point: http://docs.geotools.org/latest/javadocs/org/geotools/map/DirectLayer.html Sub-class DirectLayer and implement the draw method to display the point by drawing into the Graphics2D object passed to the method. If your application repeatedly moves from point to point you could keep the same DirectLayer in your MapContent and use a setter method or public field to update the point coords. Michael -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Add just some geometries like a layer from a shapefile
Hello Jose, Have a look at the docs for filter which explain how to select subsets features: http://docs.geotools.org/latest/userguide/library/main/filter.html Michael On 12 December 2012 21:23, Jose Angel Jimenez Perez joseangel...@gmail.com wrote: Hello at all, I have a shapefile with above 5.000 objects wich type is multipolygon, but It could be another type. How can I add like a layer to the mapContent just 2 or 3 objects from the shapefile? Thank you very much! Sorry for my english. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] [Help!] Newbie in GeoTools
Hello, It sounds like you are asking about displaying multiple layers and applying map styles (e.g. point symbols) - is that right ? You have already created a FeatureLayer to display your base shapefile. In the same way you can add further layers to your map (e.g. points of interest) by creating a FeatureLayer for each and adding them to the same MapContent instance. Map styling (e.g. setting a point symbol or line style and labels) can be done using an external SLD file or programmatically. The SLD file is probably easiest. The Map Style tutorial explains the basic concepts: http://docs.geotools.org/latest/userguide/tutorial/map/style.html The GeoServer SLD cookbook has lots of good examples of how to set different feature styles: http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/index.html Michael On 10 December 2012 20:31, Jose Angel Jimenez Perez joseangel...@gmail.com wrote: Hello, I´m a newbie programmer and I´m making a Java desktop application as Final Project Degree that implements methods for help decision locating optimist places, such as renewal energies installations, business, etc. I think I´ll use GeoTools. I´m finishing the app and I have the next problem: - I have a whole shapefile, with 3 files: *.shp, *.dbf, *.shx. This is a compound layer, make previously with gvSIG 1.2. - I need to show a map visor with the *.shp map. I have achieved it using the first example from GeoTools´s web (API 8.4). - Next, on this map, I have to show some points or objects from *.dbf file like layers, using map markers. I don´t need anymore, but I´m novice in Java and geo applications. Can you help me about what I need to use in GeoTools API? Sorry for my English, I´m thank you very much. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] gvSIG CE codesprint: geotools integration
Many thanks for the update Fernando. The development path that you describe sounds like a good choice. I'll be following your progress with interest. Michael On 6 December 2012 19:41, Fernando González fergo...@gmail.com wrote: Hi, after some work on this line we are able to share some results. As expected, the task turned to be harder than expected (ha ha), and after struggling with the more than one million lines of code in gvSIG we arrived to a certain methodology that can be described and followed by more than one person. Basically we have created a new empty repository where user interface functionality (UI) is added little by little from the old codebase and the old non-GUI calls are replaced to calls to a new, in-progress Geotools-based library. You can have more information here[1]. The bad thing is that we have a pretty empty gvSIG. The good thing is that we have a gvSIG version that, although totally limited, can be run from the beginning of the project, which is very important. Some of the old functionalities are very easy to include, some require changes to the GT-based library and take more time. In any case, now we can estimate roughly the cost of the integration since we have been tracking the time spent and we know how many functionalities are still to migrate. Anyway, we'll see how many people is interested on it enough to give us a hand and share the effort. We have created a project on github that contains the work in progress[2]. As it can be seen in the developer guide[3], a git clone and a mvn package is enough to make it ready to run. You can find some general description of the project here[4]. As for the future, note that there is no funding for this effort. But at the gvSIG CE team we like a lot the idea of collaborating with geotools, so we're investing some of our time in making this project possible. Personally, my brother and I have already learned some Geotools tricks so we already got something back :) I'll finish by thanking the geotools community for their hard work. Recently I upgraded to 8.3 the geotools dependency on a personal project and not only no test got broken, but some broken tests turned green! Really a pleasure, keep rocking! Cheers. [1] http://gvsigce.blogspot.de/2012/11/geotools-integration-methodology.html [2] https://github.com/gvtools/gvtools [3] https://github.com/gvtools/gvtools/blob/master/doc/source/introduction.rst [4] https://github.com/gvtools/gvtools/blob/master/doc/source/developer_guide.rst On Wed, Sep 5, 2012 at 4:50 PM, Fernando González fergo...@gmail.com wrote: Hi Jody. Cool, I'm looking forward finishing the integration in order to add gvSIGCE to the list but note that success is not guaranteed at all in this first attempt. It's good because it's more thrilling! :) Cheers. On Wed, Sep 5, 2012 at 9:03 AM, Jody Garnett jody.garn...@gmail.com wrote: Sounds like an interesting project. We of course are always keen to see adoption of GeoTools. If you would like to add gvSIGCE to the list of projects on our website we ask for a small welcome page introducing gvSIGCE developers to the GeoTools library. You can see a list of examples under Welcome Developers along the bottom of this page: http://docs.geotools.org Cheers! -- Jody Garnett On Wednesday, 29 August 2012 at 1:49 AM, Fernando González wrote: Hi all, sorry if this is a bit offtopic. Some people around the gvSIGCE project are organizing a code sprint in Munich[1] from the 15th to the 19th of October. For those who don't know, gvSIGCE[2] is a fork of gvSIG[3] and one of the aims of the code sprint is to replace gvSIGCE data access layer, one of the weakest points of gvSIG 1.x series, with Geotools. The global aim is to rely on geotools as much as we can so that we can benefit from it and try to contribute back. This means that if we succeed on integrating GT on the data access layer we will likely try to integrate with other parts of the library. So the point of my message: if any Geotools developer feels like dropping by he/she will be very welcomed (which means some free beer, for sure!). Don't hesitate to update the list of participants in the wiki or asking me to do so. Cheers, Fernando. [1] http://gvsigce.sourceforge.net/wiki/index.php/GvSIG_CE_Code_Sprint_in_Munich [2] http://gvsigce.org/ [3] http://www.gvsig.org/ -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net
Re: [Geotools-gt2-users] Problems to rendering the map using JMapPane
PS. forgot to mention that another, simpler option for doing grid / feature layer creation on a separate thread is to use the Java SwingWorker class On 6 December 2012 16:00, Michael Bedward michael.bedw...@gmail.com wrote: Hi Jairo, I've had a quick look at your program. I don't have time to examine it in detail (MainFrame.java is 1600 lines of code) but here are some general observations which I hope will help to get it working... The code for adding grid layers and updating the MapContent (via your LayerController class) and screen display is very complex and involves multiple repaint() calls in different methods / classes. This code could be refactored to be much simpler with any required repaint requests centralized. JMapPane should repaint automatically when a new layer is added to the map content (unless you override the event system to prevent this) so you might find you don't need to explicitly call repaint. You should always avoid doing processing, such as creating the vector grid and the associated FeatureLayer, on the event dispatch thread. Ideally you would use a separate thread (e.g. provided by an ExecutorService) and pass it a Callable object to do the grid creation etc. If you need to know when the grid layer has been created you can use a CountDownLatch or polling of a Future object (returned when the task is submitted to the executor service). But once again, the map pane should receive an event from MapContent when a layer is added so perhaps you might not need to do any polling other than to set a busy cursor etc. I think if you work on reducing the complexity of the code and keep processing off the event dispatch thread the display problems will be fixed. I'm happy to try to answer further specific questions about it, but don't have time to help you rewrite / refactor the code - that would be a case for commercial support (some links for support options are on the GeoTools web site). Hope that helps a bit, Michael On 6 December 2012 02:31, Jairo de Almeida jairodealme...@gmail.com wrote: Hi Michael Sorry to reply to you directly, I separated a simple project in this link: https://dl.dropbox.com/u/18134762/demo.zip And this link have a data used: https://dl.dropbox.com/u/18134762/Campina.zip I'm creating a rectangles layer with the tool from my application I Created a grid with 200 rows and 200 cols and 10 m Two i create a grid with 10 rows and 10 cols and 200m When i click in the map panel with this grid tool my map renderer don't is completed 2012/12/5 Michael Bedward michael.bedw...@gmail.com Hi Jairo, Please reply to the list, not to me directly You're right, don't is correct repaint panel in paintComponent method, But is this was a crazy tentative to solve this problem The rendering problem persist http://s10.postimage.org/ghj8au16x/geotools_image2.png I don't have any idea to solve this problem, Could you help me? It's hard to say more without being able to reproduce the problem here. If you can provide a *small* example (code plus data) which displays the problem I'll have a look at it. Michael -- Sem mais... Jairo de Almeida email: jairodealme...@gmail.com msn: jairodealme...@msn.com -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Problems to rendering the map using JMapPane
Hi Jairo, You are calling repaint() from within the paintComponent method of your sub-class - I think that could result in an infinite loop in the event dispatch thread and might be the cause of the incomplete renderings. Michael On 4 December 2012 22:22, Jairo de Almeida jairodealme...@gmail.com wrote: Hi group, I'm making a grid layer to overlap my polygon (each block), but i have problem to rendering the map canvas, i'm using a Child of JMapPane to drawing http://pastebin.com/dxSnu8nw and not works fine, my impression is that the panel does not finish drawing the map. follows the image of the drawing, This is a first render working fine http://s9.postimage.org/lfum3iswv/geotools_imagem1.png , and this is a second grid create http://s11.postimage.org/6jz8zzsg3/geotools_image2.png , in this time don't have renderer all the map objects, This error don't shows a exception trace in console, is possible identify him ? Thanks, Jairo. -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Problems to rendering the map using JMapPane
Hi Jairo, Please reply to the list, not to me directly You're right, don't is correct repaint panel in paintComponent method, But is this was a crazy tentative to solve this problem The rendering problem persist http://s10.postimage.org/ghj8au16x/geotools_image2.png I don't have any idea to solve this problem, Could you help me? It's hard to say more without being able to reproduce the problem here. If you can provide a *small* example (code plus data) which displays the problem I'll have a look at it. Michael -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] ShapeFileDataStoreFactory uses createIndex variable to control whether index is used in shapefiles [SEC=UNCLASSIFIED]
Thanks Geoff - I saw your previous message to Andrea too. Looks like things are underway. Always happy to help the met bureau :) Michael On 3 December 2012 17:16, Geoff Williams g.willia...@bom.gov.au wrote: Hi Michael, Thanks for the feedback, I've updated Jira with an updated patch including both of your suggestions. https://jira.codehaus.org/browse/GEOT-4336 - take care of the params map done - include one or more unit tests (if possible, though it might not be obvious how to test in this case) Use instanceof operator to check correct type of class was being returned. Hope this is useful. cheers, Geoff -- Keep yourself connected to Go Parallel: BUILD Helping you discover the best ways to construct your parallel projects. http://goparallel.sourceforge.net ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] ShapeFileDataStoreFactory uses createIndex variable to control whether index is used in shapefiles [SEC=UNCLASSIFIED]
Hi Geoff, Thanks for the bug report and the patch. I've created a Jira issue with your patch attached: https://jira.codehaus.org/browse/GEOT-4336 I'm afraid it's hard to say when this will be looked at. Andrea, who maintains the shapefile module, is one of the most over-worked developers on both GeoTools and GeoServer. However, it will have more chance of being reviewed sooner if you can extend the patch to: - take care of the params map - include one or more unit tests (if possible, though it might not be obvious how to test in this case) cheers Michael On 30 November 2012 18:17, Geoff Williams g.willia...@bom.gov.au wrote: Hi List, I think I've found a bug in the logic of the ShapeFileDataStoreFactory class. In the createNewDataStore() method, I've noticed that the createIndex variable is used to actually control whether the index is used. When enabled, indexes are always (re)created. Here's the relevant code: if (createIndex) { store = new IndexedShapefileDataStore(url, namespace, useMemoryMappedBuffer, cacheMemoryMaps, true, IndexType.QIX, dbfCharset); } else { store = new ShapefileDataStore(url, namespace, useMemoryMappedBuffer, cacheMemoryMaps, dbfCharset); } I've been using GeoTools 8.3 as part of geoserver 2.2.1 to deliver WFS data from shapefiles. I found that under load (generated with jmeter) , the GeoTools check to see if the index was up-to-date was causing my test system to grind to a halt so I disabled index creation/updating in geoserver only to find out that doing so completely disabled the use of the index. I think the above block of code should be changed to introduce a separate new variable to enable use of the index and the createIndex variable should be passed in the place of the hardcoded 'true' argument. I developed a patch against GeoTools 8.3 to enable indexes for local files. I haven't included support for setting the new variable in the params Map but I'd be happy to code this up and make any changes necessary to get this to work with GeoTools 8.4 - any interest? I'd really like to get this fix into GeoTools if possible - for performance reasons, I need to have index updating off but I still need to be able to use the indexes (which I create offline). Thanks, Geoff -- Keep yourself connected to Go Parallel: TUNE You got it built. Now make it sing. Tune shows you how. http://goparallel.sourceforge.net ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Keep yourself connected to Go Parallel: TUNE You got it built. Now make it sing. Tune shows you how. http://goparallel.sourceforge.net ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] GeoTiffReader: check if point is in coverage
Hi Jan, The reader.getOriginalEnvelope method returns a GeneralEnvelope, which provides a contains method with an edgesInclusive arg: http://docs.geotools.org/latest/javadocs/org/geotools/geometry/GeneralEnvelope.html#contains(org.opengis.geometry.Envelope,%20boolean) See if that helps. Michael On 23 November 2012 20:52, Jan Torben jan_key67...@jtheuer.de wrote: Hi, Thanks for your help with GeoTiffReader and InputStream. I use the file approach right now and I'll try to do an in memory version later. At the moment I have the following isse: I create a GeoTiffReader GeoTiffReader reader = new GeoTiffReader(input); GeneralEnvelope envelope = reader.getOriginalEnvelope(); I maintain a set of envelopes to find the correct reader instance for a user coordinate: DirectPosition dp = new DirectPosition2D(crs, x, y); if(envelope.contains(db)) { ...} When I evaluate it later: coverage.evaluate(dp, values); It (sometimes?) fails for the Boundaries: My Tiff files are 1°x1° cells and the exception always contains an integer latitude: org.opengis.coverage.PointOutsideCoverageException: Coordinate (13.457, 51) is outside coverage. Q: Is it correct that GeoTiffReader#getOriginalEnvelope()#contains() is not suitable for checking if #evaluate() will return a proper value? Is there an alternative? Cheers, Jan -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Gdal error while running ImageLab example
You're not having much luck are you :) I just tried the ImageLab app from within NetBeans using GeoTools version 8.0 and there were no errors either building or running it. Below is the pom.xml that I used. Please try another NetBeans / Maven build using this pom in place of your existing pom. If that doesn't work, and you are not using Java 7 as mentioned previously, then we'll have to hope someone else here has another suggestion. Michael 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; modelVersion4.0.0/modelVersion groupIdorg.geotools.tutorial/groupId artifactIdimagelab/artifactId version0.1/version packagingjar/packaging nameImageLab/name descriptionGeoTools image tutorial/description build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId version2.3.2/version configuration source1.6/source target1.6/target /configuration /plugin /plugins /build properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding geotools.version8.0/geotools.version /properties dependencies dependency groupIdorg.geotools/groupId artifactIdgt-shapefile/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-swing/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-epsg-hsql/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-geotiff/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-image/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-wms/artifactId version${geotools.version}/version /dependency /dependencies repositories repository idosgeo/id nameGeoTools repo/name urlhttp://download.osgeo.org/webdav/geotools//url /repository /repositories /project On 22 November 2012 17:13, Boided richa...@gmail.com wrote: Hello again, Actually i have built my complete project without using Maven and it is working perfect. Now i need to open a geotiff file and a shapefile, for this i am trying the ImageLab example. As you said i tried this example with Maven on netbeans. Now this same example is giving me the following errors before compiling: 1) cannot find symbol symbol : constructor KVP(java.lang.String,java.lang.String,java.lang.String,java.lang.String) location: class org.geotools.util.KVP 2) incompatible types found : int required: java.lang.Integer ( for (int i = 0; i numBands; i++) { bandNumbers[i] = i+1; }) 3)cannot find symbol symbol : method showInputDialog(org.geotools.swing.JMapFrame,java.lang.String,java.lang.String,int,nulltype,java.lang.Integer[],int) location: class javax.swing.JOptionPane I didnt got these errors running it without Maven. I am using geotools 8.0 and added all the dependencies according to your dependency tree. Please can you suggest something on this.. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Gdal-error-while-running-ImageLab-example-tp5017554p5018060.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users
Re: [Geotools-gt2-users] Gdal error while running ImageLab example
No worries - glad to hear it's working for you. Michael On 22 November 2012 20:46, Boided richa...@gmail.com wrote: Thanks for the reply.. I shifted from geotools 8.0 to 8.3 and now it is working. Finally :) it is working fine withou Maven also. Thanks a lot for your suggestions. it helped. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Gdal-error-while-running-ImageLab-example-tp5017554p5018107.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Gdal error while running ImageLab example
Hello, I am not using Maven. i am running the project on Netbeans without Maven.. i tried running ImageLab example and included all the dependencies required. Gdal is also installed. I am using a Geotiff image file and a shape file.The CRS for the image file is WGS-84.. please check and tell me is this the reason for the error. I tried it running with the bluemarble.tif and countries.shp also.. getting same error. In that case it is almost certainly a problem with your project setup rather than anything to do with the tutorial code or geotiffs. To check, I just built the ImageLab tutorial with GeoTools 8.3 and displayed the bluemarble image plus countries shapefile (WGS 84) with no problems. It is quite hard to build GeoTools apps without Maven due to the large number of dependencies involved. The list archive is full of posts from people who have tried and failed. Maven integration in NetBeans is excellent, so unless you have a really good reason for not using Maven I would strongly suggest you just go with the flow. If you are determined not to use it, then the listing below (generated with Maven's dependency:tree command) shows the jars required for the ImageLab application. Michael [INFO] [dependency:tree {execution: default-cli}] [INFO] org.cafeanimal:singleapp:jar:1.0-SNAPSHOT [INFO] +- org.geotools:gt-shapefile:jar:8.3:compile [INFO] | +- org.geotools:gt-data:jar:8.3:compile [INFO] | +- org.geotools:gt-referencing:jar:8.3:compile [INFO] | | +- java3d:vecmath:jar:1.3.2:compile [INFO] | | +- commons-pool:commons-pool:jar:1.5.4:compile [INFO] | | +- org.geotools:gt-metadata:jar:8.3:compile [INFO] | | | \- org.geotools:gt-opengis:jar:8.3:compile [INFO] | | | \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile [INFO] | | \- jgridshift:jgridshift:jar:1.0:compile [INFO] | +- jdom:jdom:jar:1.0:compile [INFO] | \- javax.media:jai_core:jar:1.1.3:compile [INFO] +- org.geotools:gt-swing:jar:8.3:compile [INFO] | +- org.geotools:gt-render:jar:8.3:compile [INFO] | | \- org.geotools:gt-cql:jar:8.3:compile [INFO] | \- com.miglayout:miglayout:jar:swing:3.7:compile [INFO] +- org.geotools:gt-epsg-hsql:jar:8.3:compile [INFO] | \- hsqldb:hsqldb:jar:1.8.0.7:compile [INFO] +- org.geotools:gt-geotiff:jar:8.3:compile [INFO] | +- org.geotools:gt-main:jar:8.3:compile [INFO] | | +- org.geotools:gt-api:jar:8.3:compile [INFO] | | \- com.vividsolutions:jts:jar:1.12:compile [INFO] | +- org.geotools:gt-coverage:jar:8.3:compile [INFO] | | +- org.jaitools:jt-zonalstats:jar:1.3.0:compile [INFO] | | \- org.jaitools:jt-utils:jar:1.3.0:compile [INFO] | +- javax.media:jai_imageio:jar:1.1:compile [INFO] | \- it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.1.5:compile [INFO] | +- it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.1.5:compile [INFO] | \- javax.media:jai_codec:jar:1.1.3:compile [INFO] +- org.geotools:gt-image:jar:8.3:compile [INFO] \- org.geotools:gt-wms:jar:8.3:compile [INFO]+- commons-httpclient:commons-httpclient:jar:3.1:compile [INFO]| +- commons-logging:commons-logging:jar:1.0.4:compile [INFO]| \- commons-codec:commons-codec:jar:1.2:compile [INFO]\- org.geotools:gt-xml:jar:8.3:compile -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to add to the jMapanel new geometries?
Please have a look at our tutorials, many of which use the gt-swing classes including JMapFrame / JMapPane, and then return to the list if you have more questions: http://docs.geotools.org/latest/userguide/tutorial/ Also, please see our posting guide: http://docs.geotools.org/latest/userguide/welcome/userlistguide.html Michael On 20 November 2012 23:54, Enrique Villafruela Rodríguez dirudc...@holguin.geocuba.cu wrote: How to add to the jMapanel new geometries? Help me. EVillaR -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Reduce 4D geometry to 2D geometry
Hi Peter, It probably depends on what class(es) you are presently using to represent the geometries (something other than JTS I assume). If you could provide more info about that, someone here might be able to help. Michael On 21 November 2012 03:09, Peter Hopfgartner peter.hopfgart...@r3-gis.com wrote: I do have a SimpleFeature, which contains a 4 dimensional geometry (2 geographical + 1 elevation and 1 time), which I would like to reduce to a 2d geometry. Which is the simplest way to achieve this. Thanks, Peter -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] i want to show in the map is a litle star png
Hello, If you are defining your map style via a SLD file, you can use the ExternalGraphic element to point to your png file. There is an example of this here: http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/points.html#point-as-graphic If instead you want to do this programmatically rather than with a SLD file, let me know and I'll dig out some example code. Michael On 21 November 2012 03:20, Enrique Villafruela Rodríguez dirudc...@holguin.geocuba.cu wrote: Hello every body... I need some help with geotools, my doubt is the next, some days ago i´m trying to shoy some custom point style in my jmapframe, the point that i want to show in the map is a litle star png that previously i create, when i´m trying to show the point in the map the star doesn´t appear in the stage, otherwise a little gray square is shown, can anybody send me an example class to do this... i´ll be grateful. note: the source i´m showing in the map is from spatialite and works OK, and when i used the circle mark or the others by default of geotools works ok too. best regards Please, excuse my English, I speak Spanish. EVillaR -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Gdal error while running ImageLab example
Hello, Not sure what's going on, but ignoring the Kakadu message (which as Simone says is just a warning) it looks like the error is related to decoding the coordinate reference system (CRS) of your image. Firstly, are you building and running the example with Maven ? I ask because this type of error could indicate an essential jar missing from the app classpath. If you are using Maven, and your pom includes all of the dependencies specified in the image tutorial, the next thing to look at is the actual reference system associated with your image. If your image file is a geotiff, please post the details of the CRS used. If your file is a plain tiff, please post the associated world file (.tfw) that you are using. Michael On 20 November 2012 19:45, Boided richa...@gmail.com wrote: Ciao simone, this is the complete warning that i m getting Native library load failed.java.lang.UnsatisfiedLinkError: no gdaljni in java.library.path Nov 19, 2012 12:34:07 PM it.geosolutions.util.KakaduUtilities loadKakadu WARNING: Failed to load the Kakadu native libs. This is not a problem unless you need to use the Kakadu plugin: it won't be enabled. java.lang.UnsatisfiedLinkError: no kdu_jni in java.library.path Exception in thread main java.lang.ExceptionInInitializerError at org.geotools.referencing.crs.DefaultEngineeringCRS.init(DefaultEngineeringCRS.java:136) at org.geotools.referencing.crs.DefaultEngineeringCRS.clinit(DefaultEngineeringCRS.java:88) at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.clinit(CartesianAuthorityFactory.java:61) at org.geotools.coverage.grid.io.AbstractGridFormat.clinit(AbstractGridFormat.java:99) at org.geotools.coverageio.jp2k.JP2KFormatFactory.createFormat(JP2KFormatFactory.java:164) at org.geotools.coverageio.jp2k.JP2KFormatFactory.createFormat(JP2KFormatFactory.java:51) at org.geotools.coverage.grid.io.GridFormatFinder.findFormats(GridFormatFinder.java:185) at org.geotools.coverage.grid.io.GridFormatFinder.findFormat(GridFormatFinder.java:241) at org.geotools.coverage.grid.io.GridFormatFinder.findFormat(GridFormatFinder.java:216) at geodataextraction.ImageLab.displayLayers(ImageLab.java:97) at geodataextraction.ImageLab.getLayersAndDisplay(ImageLab.java:82) at geodataextraction.ImageLab.main(ImageLab.java:56) Caused by: java.util.MissingResourceException: Can't find resource for bundle org.geotools.resources.i18n.Vocabulary, key 252 at java.util.ResourceBundle.getObject(ResourceBundle.java:386) at java.util.ResourceBundle.getObject(ResourceBundle.java:383) at java.util.ResourceBundle.getString(ResourceBundle.java:346) at org.geotools.util.ResourceInternationalString.toString(ResourceInternationalString.java:100) at org.geotools.referencing.datum.AbstractDatum.name(AbstractDatum.java:183) at org.geotools.referencing.datum.DefaultEngineeringDatum.clinit(DefaultEngineeringDatum.java:69) ... 12 more all the native libraries are there..but still it is not getting deployd.. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Gdal-error-while-running-ImageLab-example-tp5017554p5017585.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Cut some polygon with a polygon
Hello, Not sure what you mean by cut the list. If the result should be a list containing those portions of the input polygons that overlap the target polygon, you could call Geometry.intersection on each input polygon in turn: http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html#intersection(com.vividsolutions.jts.geom.Geometry) Note that if an input polygon intersects with the target polygon only at their boundary the intersection will be a LineString or Point rather than a Polygon, so you should check each intersection result for that if only Polygons are desired. Michael On 20 November 2012 09:41, augustodevel augustode...@gmail.com wrote: Hello, I have a list of polygon and one only polygon. I need to cut the list of polygon with the base of the polygon. The image have the example about this. Somebody http://osgeo-org.1560.n6.nabble.com/file/n5017534/example.png help me? Thanks -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Cut-some-polygon-with-a-polygon-tp5017534.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Create a polygon many with points
Hello Augusto, That looks like a Voronoi diagram. Have a look at the VoronoiDiagramBuilder class from the JTS library: http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/triangulate/VoronoiDiagramBuilder.html Initially you could clip the diagram to the bounding envelope of your input polygon, then take each of the result polygons and clip them using the input polygon. Michael On 17 November 2012 06:00, augustodevel augustode...@gmail.com wrote: Hello, I have many points and one polygon. My points are in the polygon and I need to create a grid with this points. I insert one image with a simple example that I am talking. Somebody helpe-me or can say how I do this? Thanks, http://osgeo-org.1560.n6.nabble.com/file/n5016987/polygon.png Augusto -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Create-a-polygon-many-with-points-tp5016987.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Remove the geometry Column from filter
Hello, The table display in the tutorial uses org.geotools.swing.FeatureCollectionTableModel class (gt-swing module) which creates a column for each attribute in the feature type, plus one for feature id. It doesn't provide a mechanism to choose which columns to display - it was really only intended for tutorial use. So you could either sub-class it or (probably easier) hack it directly to add that facility. Michael On 16 November 2012 21:37, Boided richa...@gmail.com wrote: Hi, I am displaying the features/attributes taking QueryLab as example.. everything works fine except that i do not need to display the default geometry and FeatureIdentifier columns. i am using Jtable. Please tell me how to filter out these defaults columns. Thanks -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Remove-the-geometry-Column-from-filter-tp5016894.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Finding the id field for a FeatureType
Hi David, Given a FeatureType instance, is it possible to find out programmatically which field is used for FeatureIds in that FeatureType? After looking on the FeatureType interface itself I'm not sure where I should look. There is no link between FeatureType and FeatureId. Rather, FeatureId is defined at the Feature level. Michael -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Render a GridCoverage2D to a heat map
Hello, The code to retrieve the Style from the SLD file should look more like this... /** * Create a Style object from a definition in a SLD document */ private Style createFromSLD(File sld) { try { SLDParser stylereader = new SLDParser(styleFactory, sld.toURI().toURL()); Style[] style = stylereader.readXML(); return style[0]; } catch (Exception e) { JExceptionReporter.showDialog(e, Problem creating style); } return null; } That is taken from the Map Style tutorial: http://docs.geotools.org/latest/userguide/tutorial/map/style.html Although that particular tutorial deals with vector data, the general procedure for loading a Style from SLD is the same. Hope that helps, Michael On 15 November 2012 01:49, littles silence...@yahoo.com.cn wrote: Hi Michael, Thank you for your reply. I also found those SLD examples, and this is the way I'm using them: HeatmapProcess process = new HeatmapProcess(); GridCoverage2D cov = process.execute(fc, // data 20, //radius null, // weightAttr 1, // pixelsPerCell bounds, // outputEnv 100, // outputWidth 100, // outputHeight monitor // monitor) ); StyledLayerDescriptor sld = getSLD(d:\\HeatmapSLD.xml); Style[] styles = getStyles(d:\\HeatmapSLD.xml); GridCoverageLayer layer3 = new GridCoverageLayer(cov, styles[0]); map.addLayer(layer3); And the SLD file is http://docs.geoserver.org/latest/en/user/_downloads/raster_twocolorgradient.sld. But unfortunately what I get is a green grid with no gradient. And I'm sure nothing is wrong with cov. Is it the wight way to use styles from SLD files? Thank you! -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Render-a-GridCoverage2D-to-a-heat-map-tp5014985p5016286.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] SimpleLine contains some points
Hello Steve, If you can define a tolerance within which geometries should be treated as coincident you could use Geometry.buffer and then test for intersection etc. Michael On 15 November 2012 03:07, Steve Mitchell stevecmitch...@gmail.com wrote: Trying to find the right way to test line overlap when the points are not common. I have a set of lines containing points collected from a GPS receiver. I need to find which of those lines travel a particular stretch of the route. The functions geometryA.contains(geometryB) and geometryB.within(geometryA) only work if all the points in geometryB equal a subset of points in geometryA. How can find the match that I need if the points are not equal? I'm sure this is a common problem people need to solve, I just don't know the right steps to get there. Even geometryA.intersects(geometryB) is unreliable because in some cases geometryA and geometryB have no individual points in common even though both go down the same stretch of road. -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] SimpleLine contains some points
Hi Steve, Is the tolerance that you speak of referring only to Geometry.buffer()? I've tried setting Geometry.buffer but it had no effect on my line string comparison. Calling geomA.buffer(dist) does not modify geomA, it returns a new buffered geometry... double dist = ... Geometry geomB = geomA.buffer(dist) For a LineString input geometry, the output geometry will be a polygon. Suppose you had two LineStrings representing paths down the same route. If they are parallel and slightly offset they will be seen as non-intersecting geometries. If you buffer them by some small amount and then test intersection on the resulting polygons you will get the desired result. How do I know the buffer distance for SRID WGS_84, 8307? I'm assuming it is in meters, but I'm not sure. There are two issues there. Firstly, 8307 (which I don't think is a standard EPSG code) is a flavour of lat-lon data so the distance unit will be decimal degrees. Secondly, the JTS library doesn't do anything special with the SRID attached to a geometry. It just stores it for you. All operations in JTS are done in Cartesian space. If your data are restricted to a small area, treating decimal degrees as cartesian coordinates won't hurt, but over large regions you will run into inaccuracy. Hope that helps. Michael -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to export a executable jar using geotools
On 9 November 2012 19:23, Andrea Aime andrea.a...@geo-solutions.it wrote: Never use the Maven eclipse integration, it's way too slow to handle the 150+ projects one gets by loading all geotools and geoserver in a single IDE instance. Command line for the win! Ah - the IDEs are for wimps school of thought :) Must admit - I always feel like I've come home when I can get back to the command line. Michael -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Render a GridCoverage2D to a heat map
Hello, When you say heat map fashion do you mean how to define a colour gradient for display ? If so, these examples of raster styling (from the GeoServer SLD cookbook) show how to define gradients with a SLD file: http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/rasters.html You can also define those styles programmatically in GeoTools rather than in an SLD file if that is more convenient for your application. Michael On 9 November 2012 09:37, littles silence...@yahoo.com.cn wrote: I'm new to use geotools. Now I need to generate a heat map showing the data density. I found a Kernel density estimation process from here: https://jira.codehaus.org/browse/GEOT-4175, and so far it gives me a heatmap surface over a set of irregular data points as a GridCoverage2D. My question is, how can I display it in a heat map fashion? Thanks a lot!!! -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Render-a-GridCoverage2D-to-a-heat-map-tp5014985.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
[Geotools-gt2-users] GeoTools webstart app [WAS: How to export a executable jar using geotools]
Hello Jairo, Please keep your replies directed to the list - that way you will get the benefit of the collective wisdom there rather than just my feeble brain... I'm not generate a fat jar, now im working with webstart. and set the dependences in jnlp http://pastebin.com/X5y3KTLQ But now i get another problem, this exeption http://pastebin.com/EPuKX43q Im unzip the jar files and the class org.geotools.renderer.lite.StreamingRenderer exists in jars dependences Could i works with geotools in java webstart applications? I've no direct experience with GeoTools / JNLP. A search of the list archives doesn't turn up very much either... http://osgeo-org.1560.n6.nabble.com/template/NamlServlet.jtp?macro=search_pagenode=4317834query=webstartdays=0 ...although the thread there about loading a shapefile suggests someone did have things working. Sorry I can't be more helpful. I've updated the subject in the hope that it will attract advice from others here. Michael -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Advanced linestyles with graphic
The cool cats would probably use a rendering transformation, but a simple cat like me would cheat and create a second layer for the mid-point graphics, e.g could be a DirectLayer which holds a reference to the line FeatureLayer. Or are you looking for a SLD-only solution ? Michael On 9 November 2012 01:56, Ron Lindhoudt rlindho...@yahoo.com wrote: Are there any examples for creating advanced linestyles? Like a linestyle with a symbol only in the middle of a linesegment? With Stroke.setGraphicStroke it is possible to place symbols on a line segment. But they are repeated next to each-other. I want only 1 symbol in the middle or at the end. How do I do this? Ron -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to export a executable jar using geotools
Hi Jairo, Please direct replies to the list rather than to me personally. What happens if you do mvn clean install from the command line ? Nothing, because i don't have mvn mapped in windows system variables, im using maven from m2eclipse eclipse plugin. Would I have to set the environment variable PATH? You would need maven installed on your system (http://maven.apache.org/download.html) and either put it into a directory already on your PATH or append its location to the PATH. Sorry I'm not much help with what's happening from inside Eclipse. I use NetBeans. However, most list members use Eclipse so perhaps someone else can provide guidance. As far as running maven from the command line, your pom sets the shade plugin to run as part of the normal build so just doing mvn clean install should result in the executable jar. Michael -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to export a executable jar using geotools
Hi Jody, Yep, Jairo has included the shade plugin in his project pom and it looks to be set up properly. He's just having problems getting it to work from within Eclipse. Have you any experience with that ? (NetBeans is so much easier :) Michael On 9 November 2012 18:44, Jody Garnett jody.garn...@gmail.com wrote: You may be able to configure your Pom.xml with shade plugin ( and see of eclipse maven support can handle it). Let us know how it goes :) Other thank that merge the service files by hand for the jars you use?! -- Jody Garnett On 07/11/2012, at 10:24 PM, Jairo de Almeida jairodealme...@gmail.com wrote: Hi group, How to export a executable jar using geotools I found this article http://docs.geotools.org/stable/userguide/advanced/build/faq.html But isn't works and shows this error log http://pastebin.com/gLkDcics could i make a executable fat jar file with all META-INF/services merged Thanks guys -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to export a executable jar using geotools
Hello Jairo, Using the maven shade plugin, as detailed in the build FAQ page that you cited, is still the recommended way to produce an executable jar. The shade plugin should indeed merge the individual GeoTools META-INF/services folders properly - at least it has for me many times. The first thing to check is your pom file. If you'd like to post it here we might be able to spot a problem. Michael On 8 November 2012 11:23, Jairo de Almeida jairodealme...@gmail.com wrote: Hi group, How to export a executable jar using geotools I found this article http://docs.geotools.org/stable/userguide/advanced/build/faq.html But isn't works and shows this error log http://pastebin.com/gLkDcics could i make a executable fat jar file with all META-INF/services merged Thanks guys -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Error with WKTParser
Hi Alessandro, The short answer is that you should stick to JTS geometries. As far as I understand it the ISO 19107 geometry implementation in GeoTools is experimental and incomplete (others can correct me if that's not the case). The corresponding code would be something like: String wkt = POINT( 48.44 -123.37); int srid = 4326; GeometryFactory factory = new GeometryFactory(new PrecisionModel(), srid); WKTReader reader = new WKTReader(factory); Geometry geom = reader.read(wkt); Michael On 8 November 2012 13:45, Alessandro Ferrucci alessandroferru...@gmail.com wrote: Hello, I have a very simple use case where I would like to parse WKT to generate Geometries. I'm using geotools 8.3. I have this program: package mojo.testwkt; import java.text.ParseException; import java.util.logging.Level; import java.util.logging.Logger; import org.geotools.geometry.GeometryBuilder; import org.geotools.geometry.text.WKTParser; import org.geotools.referencing.CRS; import org.geotools.referencing.crs.DefaultGeographicCRS; import org.opengis.referencing.crs.CRSAuthorityFactory; import org.opengis.referencing.crs.CoordinateReferenceSystem; public class App { public static void main(String[] args) { String wkt = POINT( 48.44 -123.37); int srid = 4326; CRSAuthorityFactory factory = CRS.getAuthorityFactory(true); CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84; GeometryBuilder builder = new GeometryBuilder(crs); System.out.println(builder: + builder); WKTParser parser = new WKTParser(builder); try { parser.parse(wkt); } catch (ParseException ex) { Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex); } } } I keep getting this exception : builder: org.geotools.geometry.GeometryBuilder@7455d93d Exception in thread main org.geotools.factory.FactoryNotFoundException: No factory of kind GeometryFactory found. at org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:375) at org.geotools.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:145) at org.geotools.geometry.GeometryFactoryFinder.getGeometryFactory(GeometryFactoryFinder.java:94) at org.geotools.geometry.GeometryBuilder.getGeometryFactory(GeometryBuilder.java:207) at org.geotools.geometry.text.WKTParser.init(WKTParser.java:110) at mojo.testwkt.App.main(App.java:30) Here is my pom file 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; modelVersion4.0.0/modelVersion groupIdmojo/groupId artifactIdtestWKT/artifactId version1.0-SNAPSHOT/version packagingjar/packaging nametestWKT/name urlhttp://maven.apache.org/url properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding geotools.version8.3/geotools.version /properties dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version3.8.1/version scopetest/scope /dependency dependency groupIdorg.geotools/groupId artifactIdgt-main/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-epsg-hsql/artifactId version${geotools.version}/version /dependency /dependencies repositories repository idmaven2-repository.dev.java.net/id nameJava.net repository/name urlhttp://download.java.net/maven/2/url /repository repository idosgeo/id nameOpen Source Geospatial Foundation Repository/name urlhttp://download.osgeo.org/webdav/geotools//url /repository /repositories /project Any ideas? I have found this was a bug in pre 2.5 days, but was supposedly fixed back then. -- Signed, Alessandro Ferrucci -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___
Re: [Geotools-gt2-users] Error with WKTParser
Hello again Alessandro, Sorry - I didn't notice your second post when replying... but once again, unless you need features beyond those that JTS offers, using JTS directly will probably be easier and safer. Michael On 8 November 2012 14:00, Alessandro Ferrucci alessandroferru...@gmail.com wrote: Ok I was able to fix this. I was missing dependency groupIdorg.geotools/groupId artifactIdgt-jts-wrapper/artifactId version${geotools.version}/version /dependency in my pom file. Thank you -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to export a executable jar using geotools
The pom looks fine. What happens if you do mvn clean install from the command line ? Michael On 8 November 2012 14:07, Jairo de Almeida jairodealme...@gmail.com wrote: Hello Michael This is my pom.xml file http://pastebin.com/4BbYNnCK To export a executable jar file from eclipse works with : ExportRunnable jar file copy required libraries into a subfolder nex to the generated jar But export fat jar isn't works with : ExportRunnable jar file Extract required libraries into generated jar Thanks to help me 2012/11/7 Michael Bedward michael.bedw...@gmail.com Hello Jairo, Using the maven shade plugin, as detailed in the build FAQ page that you cited, is still the recommended way to produce an executable jar. The shade plugin should indeed merge the individual GeoTools META-INF/services folders properly - at least it has for me many times. The first thing to check is your pom file. If you'd like to post it here we might be able to spot a problem. Michael On 8 November 2012 11:23, Jairo de Almeida jairodealme...@gmail.com wrote: Hi group, How to export a executable jar using geotools I found this article http://docs.geotools.org/stable/userguide/advanced/build/faq.html But isn't works and shows this error log http://pastebin.com/gLkDcics could i make a executable fat jar file with all META-INF/services merged Thanks guys -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Sem mais... Jairo de Almeida email: jairodealme...@gmail.com msn: jairodealme...@msn.com -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] (no subject)
Hi Ratnadeep, The format for world files is detailed here: http://docs.geotools.org/latest/userguide/library/coverage/image.html#world-file Michael On 5 November 2012 01:48, Ratnadeep Raxsith qed...@gmail.com wrote: OK. Now after much banging the head on the wall, I came to realize that my code would only work if I have a .pgw (world) file along with the .png file I get from the WMS server. Now can anyone tell me how do I make a .pgw file from geotools or even geoserver? I am completely stuck :( On Sun, Nov 4, 2012 at 10:36 AM, Ratnadeep Raxsith qed...@gmail.com wrote: I am trying to overlay a shp file on wms layer using the example http://docs.geotools.org/latest/userguide/tutorial/raster/image.html. Each time I want to read the format of the file to get a reader I get this error : Exception in thread main java.lang.UnsupportedOperationException: Trying to get a reader from an unknown format. at org.geotools.coverage.grid.io.UnknownFormat.getReader(UnknownFormat.java:62) at com.qedrix.map.maplotr.Demo1.displayLayers(Demo1.java:127) at com.qedrix.map.maplotr.Demo1.main(Demo1.java:260) My code follows: public void displayLayers() { File rasterFile = fetchWmsImage(); AbstractGridFormat format = GridFormatFinder.findFormat(rasterFile); this.reader = format.getReader(rasterFile); // Initially display the raster in greyscale using the // data from the first image band Style rasterStyle = createRGBStyle(); // Create a basic style with yellow lines and no fill Style shpStyle = SLD.createPointStyle(point, Color.YELLOW, Color.GRAY, 0.0f, 1.5f); MapContent map = new MapContent(); map.setTitle(ImageLab); MapViewport vp = new MapViewport(); org.geotools.map.Layer rasterLayer = new GridReaderLayer(reader, rasterStyle); map.addLayer(rasterLayer); saveImage(map, final.jpeg, 583); } public File fetchWmsImage() { URL url = null; try { url = new URL(http://184.106.187.247:8080/geoserver/rg/wms?version=1.1.0;); } catch (MalformedURLException e) { // will not happen } WebMapServer wms = null; try { wms = new WebMapServer(url); WMSCapabilities capabilities = wms.getCapabilities(); Layer[] layers = WMSUtils.getNamedLayers(capabilities); GetMapRequest request = wms.createGetMapRequest(); request.setFormat(image/png); request.setDimensions(583, 420); request.setTransparent(true); request.setSRS(EPSG:900913); request.setBBox(-13019428.542822,3922163.1648461,-13013051.407366,3929863.8567165); //request.setProperty(isBaseLayer, false); //request.setProperty(opacity, .2); for (Layer layer : WMSUtils.getNamedLayers(capabilities)) { if (layer.getName().equals(rg:parcels)) request.addLayer(layer); } System.out.println(request.getFinalURL()); GetMapResponse response = (GetMapResponse) wms.issueRequest(request); BufferedImage image = ImageIO.read(response.getInputStream()); File rasterFile = new File(C:\\Users\\samabhik\\Workspace\\MAP\\data\\out.png); ImageIO.write(image, png, rasterFile); try{ Thread.sleep(2000); }catch(InterruptedException e){} return rasterFile; } catch (ServiceException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { } return null; } I am using Maven so my dependency is this: dependency groupIdorg.geotools/groupId artifactIdgt-shapefile/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-swing/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-epsg-hsql/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-geotiff/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-image/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-wms/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-coverage/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-imageio-ext-gdal/artifactId version${geotools.version}/version /dependency I have JAI/ImageIO/Gdal native libs installed and using
[Geotools-gt2-users] misleading code in Query tutorial (WAS: SQL 2008R2 readers/iterators being left open)
Hi Andrea, Just following up on this comment... On 6 November 2012 02:11, astewart stew...@navcanada.ca wrote: However, I did track down the 'offending' documentation that should be revised to reflect the use of the setQuery() method. The 'Things to Try' section of the Query tutorial contains a method called *centerFeatures()*. That method contains the misleading code. In the thread the use of FeatureLayer.query was discussed as an alternative to getting a FeatureCollection and an iterator. However the Query tutorial doesn't use layers (no map is displayed) so can you advise on how the tutorial code should be modified ? Michael -- LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] misleading code in Query tutorial (WAS: SQL 2008R2 readers/iterators being left open)
Cool - thanks Andrea. Michael On 6 November 2012 18:21, Andrea Aime andrea.a...@geo-solutions.it wrote: I don't see anything wrong in the tutorial, nor any suggestion that collections should be fed into a layer, I guess that was just the extrapolation of the user. If anything, if there is documentation about the GUI components it should advise against feeding a non in memory feature collection into the map layers Cheers Andrea -- LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Simple intersection
Hello Andre, The answer depends somewhat on how big the polygons are, the details with which they are represented (density of vertices) and what part of the globe you are working in. GeoTools uses the JTS library for geometry operations. JTS itself has no notion of projections, it simply treats all objects as being in a Cartesian coordinate system regardless of what the data really are. If your polygons lie within a relatively small area the errors involved in intersection etc. could be negligible. On the other hand, if you were intersecting very large polygons using lat-lon vertex coordinates, for example to determine the extent of their intersection, the value you arrive will probably be quite different to the true value. The following thread from the list archives talks about converting geometries form lat-long to projected coordinates for area calculations and might provide some helpful background: http://osgeo-org.1560.n6.nabble.com/how-to-calculate-area-of-a-polygon-by-coordinates-td4318327.html Michael On 2 November 2012 07:36, André Fonteles andrefonte...@gmail.com wrote: Hi everybody, I'm new in geotools and I've been reading a lot of posts about intersection using geotools, but I still have a question. Given 2 polygons composed with latitude and longitude points, how can I test if these intersects? Is it just needed to use polygon1.intersects(polygon2) Doesn't it needs to be any reference to WGS84 or CoordinateReferenceSystem? Please, I'm working on it about 2 days and I'm still not sure if it's just simple as this. Thank you, guys, in advance. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] A patch to fix the missing CRS info on the parsed GML2 document
Hi Gerson, Thanks very much for this. Bug fixes and improvements are always welcome ! Given the big workload of the core developers and inevitable delays this leads to in reviewing patches, the best things is for you to go ahead and create an issue in Jira plus an associated pull request citing the issue number. That way it will be on the list for the module maintainer (Justin). Michael On 31 October 2012 15:46, Gerson Galang gerson.sa...@gmail.com wrote: Hi, A month ago, I reported an issue we picked up where the CRS info from the parsed GML document gets lost in the parsing process. Here's a link to my posting again which details the issue I found.. http://osgeo-org.1560.n6.nabble.com/Missing-CRS-on-the-SimpleFeature-objects-td5005105.html After digging into the source code, I found a place where I could insert the missing CRS. My geotools fork contains the patch which fixes the problem.. https://github.com/gerson721/geotools/commit/fd63ce418f459ca31f7a0a42ce7a6678879d3100 Is my fix acceptable with you guys? If it is, I'll add a JIRA entry for it and make a pull request. Regards, Gerson -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Migration of project to geotools 2.2 from geotools 8.2
I think the best place to start is by having a look at a couple of the tutorial applications: http://docs.geotools.org/latest/userguide/tutorial/ Many of them, including the Quickstart app, use the current gt-swing classes for display. They will also give you a gentle introduction to many of the other parts of GeoTools that will have changed a great deal since v2.2. You will also find that the user guide has been greatly improved and expanded in recent times: http://docs.geotools.org/ After absorbing some of that, you can get back to the list with more specific questions if you need to. Michael On 30 October 2012 17:46, kapil kapilsharma...@gmail.com wrote: hi list, I have an project which uses geotools version 2.2 now i want to migrate this project on latest version means Geotools 8.2. but i got so many problems like: 1 how to create scrollpane on jmappane 2 how to get getscalefactor() method of zoompane as it is not present in 8.2 3 how to add NorthArrow layer in jmappane 4 problem regarding OverlayImage class please also tell me that JMapPane is the right substitute of styledmappane or not -- View this message in context: http://osgeo-org.1560.n6.nabble.com/Migration-of-project-to-geotools-2-2-from-geotools-8-2-tp5012146.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Building a GIS Project!
The xml code at the bottom of this message is what your pom should look like. Try putting that code into your pom (replacing the existing contents). Also, the quickstart page suggests running the Update all maven dependcies item from the Project menu in Eclipse. Please try that if you haven't already. Alternatively, open a command/terminal window, navigate to the folder where your application is (the folder containing the pom.xml file) and type: mvn -U clean install Michael 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; modelVersion4.0.0/modelVersion groupIdorg.geotools/groupId artifactIdtutorial/artifactId version0.0.1-SNAPSHOT/version packagingjar/packaging nametutorial/name urlhttp://maven.apache.org/url properties project.build.sourceEncodingUTF-8/project.build.sourceEncoding geotools.version8.2/geotools.version /properties dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version3.8.1/version scopetest/scope /dependency dependency groupIdorg.geotools/groupId artifactIdgt-shapefile/artifactId version${geotools.version}/version /dependency dependency groupIdorg.geotools/groupId artifactIdgt-swing/artifactId version${geotools.version}/version /dependency /dependencies repositories repository idmaven2-repository.dev.java.net/id nameJava.net repository/name urlhttp://download.java.net/maven/2/url /repository repository idosgeo/id nameOpen Source Geospatial Foundation Repository/name urlhttp://download.osgeo.org/webdav/geotools//url /repository /repositories /project -- WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] ogc:Div using non-integer literals?
Hello Akos, Mmm... not sure what the problem is there. I just tested the Divide expression (which is confusingly not a filter function) programmatically with double-valued literals and it worked as expected (see test below). Next I tried it from a SLD file (also below) and got points labelled 42.0. Michael public class DivTest { @Test public void divWithDouble() throws Exception { FilterFactory2 ff2 = CommonFactoryFinder.getFilterFactory2(); Expression div = ff2.divide(ff2.literal(84.0), ff2.literal(2)); Object answer = div.evaluate(null); assertEquals(The answer should be 42, 42.0, ((Number) answer).doubleValue(), 1e-8); } } ?xml version=1.0 encoding=ISO-8859-1? StyledLayerDescriptor version=1.0.0 xsi:schemaLocation=http://www.opengis.net/sld StyledLayerDescriptor.xsd xmlns=http://www.opengis.net/sld; xmlns:ogc=http://www.opengis.net/ogc; xmlns:xlink=http://www.w3.org/1999/xlink; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; NamedLayer NameDivide test/Name UserStyle FeatureTypeStyle Rule PointSymbolizer Graphic Mark WellKnownNamecircle/WellKnownName Fill CssParameter name=fill#FF/CssParameter /Fill /Mark Size6/Size /Graphic /PointSymbolizer TextSymbolizer Label ogc:Div ogc:Literal84.0/ogc:Literal ogc:Literal2/ogc:Literal /ogc:Div /Label Font CssParameter name=font-familyArial/CssParameter CssParameter name=font-size12/CssParameter CssParameter name=font-stylenormal/CssParameter CssParameter name=font-weightbold/CssParameter /Font LabelPlacement PointPlacement AnchorPoint AnchorPointX0.5/AnchorPointX AnchorPointY0.0/AnchorPointY /AnchorPoint Displacement DisplacementX0/DisplacementX DisplacementY5/DisplacementY /Displacement /PointPlacement /LabelPlacement Fill CssParameter name=fill#00/CssParameter /Fill /TextSymbolizer /Rule /FeatureTypeStyle /UserStyle /NamedLayer /StyledLayerDescriptor -- WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users