epsg code from ShapeFile

Thanks for help.
I get now the EPSG-Code, but also an error message for Postgres connection:

org.geotools.referencing.factory.epsg.ThreadedPostgreSQLEpsgFactory isAvailable
WARNUNG: Unavailable authority factory: European Petroleum Survey Group
org.opengis.referencing.FactoryException: Failed to connect to the EPSG 
database.
...
Caused by: java.net.ConnectException: Connection refused: connect
...

Why? 

I have used as follows:
CoordinateReferenceSystem crs = 
ds.getSchema().getGeometryDescriptor().getCoordinateReferenceSystem();
int epsgCode = CRS.lookupEpsgCode(crs, true);

Andy

-------- Original-Nachricht --------
> Datum: Fri, 14 Jan 2011 09:45:16 +1000
> Von: Jody Garnett <[email protected]>
> An: [email protected]
> CC: "geotools [email protected]" 
> <[email protected]>
> Betreff: Re: [Geotools-devel] epsg code from ShapeFile

> The projection that comes with a shapefile is captured as a "prj" file -
> and does not actually have an EPSG code.
> But you can figure out which EPSG code matches.
> 
> Grab your CoordinateReferenceSystem from you Shapefile; it is available in
> the FeatureSource.getSchema() information. From there look up a matching
> EPSG code using the CRS utility class.
> 
> Jody
> 
> On 14/01/2011, at 2:02 AM, [email protected] wrote:
> 
> > Hi,
> > 
> > how do I get epsgCode from the shapeFile?
> > 
> > I get coordinate system on the method
> "geometryDescriptor.getCoordinateReferenceSystem()", but not epsgCode.
> > 
> > Andy
> > -- 
> > Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> > belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> > 
> >
> ------------------------------------------------------------------------------
> > Protect Your Site and Customers from Malware Attacks
> > Learn about various malware tactics and how to avoid them. Understand 
> > malware threats, the impact they can have on your business, and how you 
> > can protect your company and customers by using code signing.
> > http://p.sf.net/sfu/oracle-sfdevnl
> > _______________________________________________
> > Geotools-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/geotools-devel
> 

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail


-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!                       
Jetzt informieren: http://www.gmx.net/de/go/freephone

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to