|
From: pilloff <pi...@gm...> - 2008-01-22 20:57:22
|
Martin Desruisseaux-2 wrote:
>=20
> pilloff a =C3=A9crit :
>> Can the shapefile reader look in the .prj file
>> and the GeoTools supplied CRS database and determine the best match
>> automatically?
>=20
> You may read the content of .prj file as WKT and gives it to
>=20
> CRS.parseWKT(String)
>=20
> If you really need an EPSG code, it may be worth to try
> CRS.lookupIdentifier.
>=20
> =09Martin
>=20
>=20
Thanks for the reply. I had tried using
dataStore.getSchema().getPrimaryGeometry().getCoordinateSystem() which
returned a CRS object. However the .prj has no Bursa Wolf parameters so
CRS.findMathTransform failed with an operationNotFoundException.
Following your advice, I tried CRS.lookupIdentifier now but I get:
org.opengis.referencing.FactoryException: Geotools extension required for
"getIdentifiedObjectFinder" operation.
For reference, this is what I see when a print the CRS object returned by
getCoordinateSystem().
PROJCS["NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001",
GEOGCS["GCS_North_American_1983",
DATUM["D_North_American_1983",
SPHEROID["GRS_1980", 6378137.0, 298.257222101]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH]],
PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["central_meridian", -71.5],
PARAMETER["latitude_of_origin", 41.0],
PARAMETER["standard_parallel_1", 41.71666666666667],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 200000.0],
PARAMETER["false_northing", 750000.0],
PARAMETER["standard_parallel_2", 42.68333333333334],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH]]
It seems I need something reasonably clever to take just these raw names an=
d
extract a CRS usable for transformations. Any suggestions?
Thanks,
Mark
--=20
View this message in context: http://www.nabble.com/Automatically-parsing-.=
prj-files--tp15026215p15028239.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
|