There are some instructions about setting up geotools; however can I ask you to 
move to the user list (the developer list is for people working on the library 
:-) )

The various tutorials point out that you only can use one of the gt-epsg jars 
(hsql, h2, postgres, etc...) at a time; the gt-epsg-hsql is recommended; 
gt-epsg-postgres is used when you have set up a local posgres database (perhaps 
for use by a team?) and they would all like to share a database of epsg codes.

Jody

On 14/01/2011, at 11:50 PM, phantom1...@gmx.de wrote:

> 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 <jody.garn...@gmail.com>
>> An: phantom1...@gmx.de
>> CC: "geotools geotools-gt2-users@lists.sourceforge.net" 
>> <geotools-gt2-users@lists.sourceforge.net>
>> 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, phantom1...@gmx.de 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
>>> geotools-de...@lists.sourceforge.net
>>> 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
> geotools-de...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel


------------------------------------------------------------------------------
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-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to