Hello,

Mike, Martin gave you a strategy to extract just the referencing
information you need since you don't want to have the whole database in
your application. 

To use the EPSG referencing information, one can either:
1) use one of the databases in the geotools based application
2) extract the needed information and construct programmatically the
referencing object one wants. 

For (2), you can use Geotools and the EPSG database to extract the
information you want while you are coding your program. Your code will
then use this extracted information to build up the runtime CRS info you
will need to perform the transformations. What Martin gave you was a way
to run a main() method on one of the classes in the Geotools CRS and
pull out the info for the two CRSs that interest you. The main method
goes into the EPSG database and dumps out the info as WKT to your
console. You can then cut and paste that information into your app to
create the CRS your app will need.

The epsg-scripts don't need to be run since the databases are already
populated. Geotools gives you four EPGS databases, one of which is based
on an in memory model. 

I'm blanking on how to find the code for your particular CRSs and have
not yet written that into the user guide. I would try google to find
that info. Failing that, look at EPSG and then the code in the CRS
classes. Some of the classes have main() methods that dump out a bunch
of info. Or ask on this list with the name of the magic two CRSs that
interest you.

good luck,
adrian

On Tue, 2007-02-20 at 08:58 +0100, Mike Lehmann wrote:
> Thanks for your response. Shouldn't between 1) and 2) the epsg-scripts be 
> executed to fill the database? Where I can find the EPSG code for the source 
> and target coordinate systems? Is there a list available for the WKTs of all 
> coordinate systems?
> 
> --
> Mike
> 
> 
> Martin Desruisseaux schrieb:
> > Le lundi 19 février 2007 à 17:39 +0100, Mike Lehmann a écrit :
> >> The last hours I read a lot of documentation about setting up CRS with
> >> geotools. Unfortunately, it seems to require a database. We only want to
> >> transform between two coordinate systems WGS84 (latitude, longitude) and
> >> Gauss-Krüger (Germany, chooseable center-meridian stripe). Is it really
> >> necessary to set up a database for this transformation?
> > 
> > You can process with the following steps:
> > 
> > 1) Temporarily put "gt2-epsg-hsql.jar" in your classpath:
> > 
> > 2) Execute the following command from the command line, where <code>
> >    is the EPSG code for your coordinate reference system:
> > 
> >    java org.geotools.referencing.factory.epsg.DefaultFactory <code>
> > 
> >    Note: on Geotools 2.4, this command will be replaced by a slightly
> >    more generic one there (not limited to EPSG codes):
> > 
> >    java org.geotools.referencing.CRS <code>
> > 
> > 3) The above-command should print the Well Known Text (WKT) for your
> >    CRS. Copy and paste the WKT as a String constant in your code.
> > 
> > 4) You can remove the "gt2-epsg-hsql.jar" file from your classpath.
> > 
> > 5) In your code, use
> > 
> >    CoordinateReferenceSystem crs = CRS.parseWKT(theWktString);
> > 
> >     Martin
> > 
> > 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to