Peter Zankl a écrit :
I need to transform some given data from "Lambert 2 étendu" to WGS84.
[...snip...] Further reading: there is the EPSG database describing coordinate
systems containing an entry
INSERT INTO epsg_alias VALUES ( [...snip...], 'NTF (Paris) / Lambert zone II
etendu');
which is the closest match I can find.
2 questions:
a) can anyone confirm that relating "Lambert 2 étendu" to the EPSG entry
does make sense ?
b) where do I find the WKT string? Do I really have to install the whole
EPSG thing (including MS Access) to extract this single line of text ?
WKT and EPSG are two unrelated things. In order to get yours Coordinate
Reference System (CRS) objects, you need to describe the CRS as a "Well
Known Text" (WKT), or you need its EPSG code. But you don't need both.
WKT is flexible and do not requires any database at all. EPSG codes put
more constraints (you need an EPSG database, and you can't create a CRS
which is not defined in this database), but is easier to use if you know
the CRS code. In some cases, it allows more accurate transformations
than WKT.
The EPSG database is available in various forms. You can download it in
MS-Access format from http://www.epsg.org (MS-Access is the primary
distribution format for this database). You can also install it on a
PostgreSQL database, etc.
Geotools provides different EPSG plugins, each of them for a different
connection mechanism to an EPSG database. The "epsg-access" plugin
search for an MS-Access database registered under the "EPSG" name in the
"ODBC Sources" folder in the control panel. If you have a MS-Access
software on yours machine, I recommand this approach since it allows you
to browse the EPSG database in order to find the EPSG code for yours CRS.
An other Geotools plugin is "epsg-hsql", which is bundled with a copy of
the EPSG 6.7 database. Using the "epsg-hsql" plugin, you don't need to
download the EPSG database. Just put the "epsg-hsql.jar" file in yours
classpath, and everything should work. But you need to download the HSQL
database engine first...
For searching an EPSG code for a CRS, "Alias" is not the right table to
look into. You need to search in the "Coordinate Reference System"
table. For example the code 27572 is for "NTF (Paris) / Lambert zone
II". But there is a lot of "NTF (Paris)" CRS. Maybe you should look in
the EPSG database by yours self in order to be sure to pick the one you
want.
You can tests yours EPSG code with the following line from the command
line (assuming that the Geotools JAR are in yours classpath, including
at least one of the EPSG plugins):
java org.geotools.referencing.factory.epsg.DefaultFactory 27572
You should get the WKT for the EPSG:27572 CRS, which is:
PROJCS["NTF (Paris) / Lambert zone II",
GEOGCS["NTF (Paris)",
DATUM["Nouvelle Triangulation Francaise (Paris)",
SPHEROID["Clarke 1880 (IGN)", 6378249.2, 293.4660212936269,
AUTHORITY["EPSG","7011"]],
AUTHORITY["EPSG","6807"]],
PRIMEM["Paris", 2.5969213, AUTHORITY["EPSG","8903"]],
UNIT["grade", 0.015707963267948967],
AXIS["Geodetic latitude", NORTH],
AXIS["Geodetic longitude", EAST],
AUTHORITY["EPSG","4807"]],
PROJECTION["Lambert Conic Conformal (1SP)", AUTHORITY["EPSG","9801"]],
PARAMETER["central_meridian", 0.0],
PARAMETER["latitude_of_origin", 52.0],
PARAMETER["scale_factor", 0.99987742],
PARAMETER["false_easting", 600000.0],
PARAMETER["false_northing", 2200000.0],
UNIT["m", 1.0],
AXIS["Easting", EAST],
AXIS["Northing", NORTH],
AUTHORITY["EPSG","27572"]]
But you don't really need this WKT. In yours code, just write:
CRSAuthorityFactory f = FactoryFinder.getCRSAuthorityFactory("EPSG");
CoordinateReferenceSystem crs =
f.createCoordinateReferenceSystem("27572");
and you got yours CRS.
Martin.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users