Amy Johnson ha scritto:
I am attempting to translate a projection and it does not seem to be working correctly. It is a map of North America, and here is what I built to include in the epsg.properties file:
69036406=PROJCS["Lambert Azimuthal Equal Area", GEOGCS["NAD83", DATUM["North_American_Datum_1983", SPHEROID["GRS 1980", 6378137,298.257222],TOWGS84[1.0, 1.0, -1.0, 0.0, 0.0, 0.0, 0.0]], PRIMEM["Greenwich",0], UNIT["Meter",1]], PROJECTION["Lambert_Azimuthal_Equal_Area"], PARAMETER["False_Easting",0], PARAMETER["False_Northing",0], PARAMETER["Latitude_Of_Origin",45],UNIT["Meter",1],AUTHORITY["EPSG","69036406"]]
Ok, it took me some code debugging to understand the issue but
I now understand what's going on.
The trouble lies in the unit you declared in the Datum, which is meter,
and does not make sense for an ellipsoid (should be either radians or degrees).
I think the WKT parser falls back on the default, which is radians, and that's why it chokes when it parses the latitude of origin, 45 in radians does not make sense.
The following amended definition works (remember to type it in
a single line in the property file):
PROJCS["Lambert Azimuthal Equal Area",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980", 6378137.0, 298.257222],
TOWGS84[1.0, 1.0, -1.0, 0.0, 0.0, 0.0, 0.0]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH]],
PROJECTION["Lambert_Azimuthal_Equal_Area"],
PARAMETER["latitude_of_center", 45.0],
PARAMETER["longitude_of_center", 0.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH],
AUTHORITY["EPSG","69036406"]]
As for how to build up a proper WKT definition, I frankly usually
pick up one that looks like the one I want from the GeoServer
SRS list and then alter it slightly.
You can also find a formal definition here:
http://geoapi.sourceforge.net/2.0/javadoc/org/opengis/referencing/doc-files/WKT.html
Hope this helps
Cheers
Andrea