[Geoserver-devel] Exception with user-defined EPSG

Hello,

I am trying to define my own EPSG. It is:

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"]]

This is the more readable format. I include the following in my 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"]]

When I try to set the EPSG to this, I get the following error:

GeoServer - Exception

The following exception was thrown:
/|java.lang.reflect.InvocationTargetException

|/|I'm guessing I'm doing something wrong but I'm not sure what it is. Any help would be greatly appreciated.

Amy

Hi Amy,

(This sort of question is more suitable for the users list. You will get a better answer there.)

Looking into this, it appears that geotools projection code expects the "Latitude_Of_Origin to be specified in radians, not in degrees for this projection. I am not sure if that makes sense in this case or not.

Others know the referencing stuff much better than I but if you specify the above in radians, it should get picked up by GeoServer.

-Justin

Amy Johnson wrote:

Hello,

I am trying to define my own EPSG. It is:

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"]]

This is the more readable format. I include the following in my 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"]]

When I try to set the EPSG to this, I get the following error:

GeoServer - Exception

The following exception was thrown:
/|java.lang.reflect.InvocationTargetException

|/|I'm guessing I'm doing something wrong but I'm not sure what it is. Any help would be greatly appreciated.

Amy

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,47dae57964767082231907!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Justin Deoliveira a écrit :

Looking into this, it appears that geotools projection code expects the "Latitude_Of_Origin to be specified in radians, not in degrees for this projection. I am not sure if that makes sense in this case or not.

GeoTools expects the angle to be in the units declared in the UNIT[...] element which is inside GEOGCS[...]. In the supplied WKT it is defined as:

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]],
  ... etc ...

which is incorrect. The unit inside GEOGCS should be UNIT["degree", 0.017453292519943295], where the number is the factor relative to radians.

GeoTools has interpreted the angle in radians because the above factor was 1, which is the correct behavior if it wasn't for the "m" just before.... GeoTools should have complained that a GEOGCS can't have linear units (meters) - an exception should have been thrown. It would be nice if you could open a bug report on JIRA so we can add this check...

  Martin