Thanks Jody for the very helpful response. I am unclear about one important conceptual understanding though. You said that "JTS does not care (or use) the SRID value". So what does JTS use for its internal CoordinateReferenceSystem? Does that mean that before geometry objects are stored using JTS they are normalized to that JTS internal CoordinateReferenceSystem? How else could JTS do spatial operations on geometry objects that use different SRID values?
Said another way, geotools allows apps to use a large number of CoordinateReferenceSystems among different geometry objects. I had assumed JTS did the same and the only difference between the two was use of SRID vs. CoordinateReferenceSystem with some mapping between the two. Your statement "JTS does not care (or use) the SRID value" puts in doubt my understanding of how CoordinateReferenceSystems are handled in the two libraries. TIA for clearing my confusion. Jody Garnett wrote: > There are a couple ways of talking about the same thing - use the CRS > utility class to figure it out. SRID is kind of meaningless; or at > least the meaning is defined by you for your application; I personally > use SRID to mean "EPSG:<code>" and use the SRID number as my <code>. > You will find that often the PostGIS spatial_ref_sys table is set up > in this manner as well. > > srsName is used when communicating with WFS and WMS; it is often a > string for the form: "EPSG:4326", or it could be more complicated, the > GeoTools library does a pretty good job of handling this for you using > CRS.decode( ... ) method. > > Farrukh Najmi wrote: >> Current code base allows lookup of a JTS GeometryFactory using an >> SRID using the following: >> >> http://javadoc.geotools.fr/2.5/org/geotools/factory/Hints.html#JTS_SRID >> >> Problem is I only have an srsName to start with. >> > Don't worry about it too much; JTS does not care (or use) the SRID > value; try and keep track of a CoordinateReferenceSystem object instead. >> Thus, I am looking for a way to get an SRID from a srsName. >> >> How can I do this using geotools? If geotools does not support this, >> how can I use the spatial_ref_sys in postgis to do the lookup. Thanks >> for any advice. >> > You can query the table yourself and use CRS.fromWKT( ... ) - this is > how the the PostGISDataStore returns your features with the correct > CoordinateReferneceSystem. > > Here are the docs for CRS: > - http://docs.codehaus.org/display/GEOTDOC/01+CRS+Helper+Class > > Cheers, > Jody > -- Regards, Farrukh Najmi Web: http://www.wellfleetsoftware.com ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Geotools-gt2-users mailing list Geotools-gt2-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users