Hi

Eric, I think you might want:

_ShapefileDataStore.getSchema().getDefaultGeometry().getCoordinateSystem
(); 

At least it works for the data I am trying to create an image of. I am
using 2.3.1.

Andy
http://www.geog.leeds.ac.uk/people/a.turner/
 
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Adrian Custer
Sent: 24 May 2007 10:31
To: Eric Lemoine
Cc: geotools-gt2-users@lists.sourceforge.net
Subject: Re: [Geotools-gt2-users] get coordinate system from geometries

On Thu, 2007-05-24 at 10:48 +0200, Eric Lemoine wrote:
> On 5/23/07, Andy Turner <[EMAIL PROTECTED]> wrote:
> > Hi Eric,
> >
> > I think the answer is no, you can only guess it. Where did the given

> > Geometry come from?
> 
> I read a shapefile using ShapefileDataStore, and this actually gives 
> me JTS geometries. Is this behavior expected?

Yes. What else could you expect?

> 
> My ultimate goal is to read some data from a shapefile, reproject it, 
> and write it back to another shapefile. At first, I thought I could 
> get the original CRS from the geometries read from the input 
> shapefile. As it turns out, I cannot. Now my question is how can I get

> the CRS associated with my input shapefile? Shall I directly read it 
> from myshapefile.prj? Is there a GeoTools class or method to do that?

If you can get the Features, you should be able to get the CRS from the
metadata. The demo code in demo/introduction should tell you where it
hides. I can't remember it off the top of my head and you can look at
the code as easily as I can. ;-)

> 
> Thanks a lot,
> 

--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

-------------------------------------------------------------------------
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

Reply via email to