[Geotools-gt2-users] get coordinate system from geometries
Hello gt2 users, Given a geometry (com.vividsolutions.jts.geom.Geometry) can I get the associated EPSG code to ultimately get a CoordinateReferenceSystem object? FYI, I'm trying to reproject geometries which I don't know the current coordinate system. That's why I'm trying to get the current coordinate system from the geometres themselves. Please tell me if I'm going the wrong way... Thanks, -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 96 Mail : [EMAIL PROTECTED] http://www.camptocamp.com - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] DataStore factory
Hello, I'm coming back with my problem with WFS DataStore. I tried to contact David Zwiers with his address on gmail but no reply so far. Anyway I'm investigating the issue which really looks like a serious bug. I remind that the only solution I have found to perform different queries *on different feature types* is to recreate a new FeatureSource and even a new DataStore (!) for each new request! This workaround is obvliously desastrous for performances. From what I can understand the problem seems to come from the following method: SchemaFactory.getRealInstance(URI targetNamespace2, InputStream is1, Level level) Line 344 (version 3.2.1) there is: schemas.put(targetNamespace, contentHandler.getSchema()); But it should be: schemas.put(targetNamespace, schema); To take in care the new merged schema. Maybe someone could confirm me? Thanks, Vincent. -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de zze-M2S FRISON V ext RD-BIZZ Envoyé : vendredi 9 mars 2007 12:20 À : geotools-gt2-users@lists.sourceforge.net; Jody Garnett; Andrea Aime Objet : Re: [Geotools-gt2-users] DataStore factory Nevertheless I really think there's something weird about WFSDataStore/FeatureStore. I don't speak about concurrency but just about side effects on sequential operations on differents feature types. I will try to contact dzwiers, who seems to be the WFS geotools plugin maintener, to help me to solve it. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ 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 coordinate system from geometries
Hello, All JTS geometries are implicitly (because the library handles nothing else) cartesian 2D. JTS does nothing with the third coordinate but keep track of it---it could just as easily be a temperature as a height. JTS therefore does not deal with CRS information. It does have a field to keep track of SRID but that's generally not used. In order to work with CRS's you will have to work with the geoapi interfaces and the geotools implementation. You will have to figure out what the coordinates you have actually mean and define a CRS for the coordinates (or use a pre-defined CRS in the geotools org.geotools.referencing.CRS.java class in the referencing module). So, no, you cannot go from JTS to a CRS since JTS generally doesn't keep track of that information and certainly using the CRS'es used by the rest of geotools. hope that helps, --adrian On Tue, 2007-05-22 at 14:49 +0200, Eric Lemoine wrote: Hello gt2 users, Given a geometry (com.vividsolutions.jts.geom.Geometry) can I get the associated EPSG code to ultimately get a CoordinateReferenceSystem object? FYI, I'm trying to reproject geometries which I don't know the current coordinate system. That's why I'm trying to get the current coordinate system from the geometres themselves. Please tell me if I'm going the wrong way... Thanks, - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] What to use instead of Filter?
On 5/10/07, Justin Deoliveira [EMAIL PROTECTED] wrote: Hi Ian, Were you creating the geoapi filters using the FilterFactory? I believe you are correct in that that interface has a dependency on geoapi geometry. However the FilterFactory2 interface is an extension which allows you to create filters without geoapi geometries. I realize that isn;t exactly intuitive. We should really clean that up before our 2.4 release... OK I found some time to go back to geotools today and try this. As you say it lacks intuitiveness and documentation, so I'm guessing I do something like Filter f = ff.contains(ff.literal(geomName),ff.literal(geometry)); where ff is a FilterFactory2. when I do a toString on my filter all looks fine with something like [ the_geom contains POINT (-109.59193420410156 57.7642822265625) ] being returned, sadly the filter never seems to return any features when I query a featureSource with it. So am I missing something obvious or do I need to start stepping through in a debugger to see whats really happening in side. Ian -- Ian Turton http://www.geotools.org http://pennspace.blogspot.com/ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ 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 coordinate system from geometries
On Tue, 2007-05-22 at 22:20 +0200, Eric Lemoine wrote: Let me ask another question: I read my shapefile using ShapefileDataStore and stuff, now how can I get the coordinate system used in that shapefie? If you mean the Coordinate Reference System, that will depend on the file in the shapefile group that ends in .prj I'm not certain what the allowable formats are for that file but a simple WKT string works. For example, if you have GPS data, you can generate a WKT string from the CRS class, put in in a file, rename the file shapefilename.prj and use that directly to reference your data. If your shapefile cluster doesn't have that data, then you'll have to guess the Reference System according to the contents. --adrian - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users