I’d like to use PROJ4J to project wgs84 lat lons to the Equal-Area Scalable Earth (EASE) 2.0 Grid.
It seems the EASE 2.0 grid uses the Behrmann projection which is just an Cylindrical equal-area projection that uses a 30 degree standard latitude.
with the following code:
final String paramString = "+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +datum=WGS84 +ellps=WGS84 +units=m +no_defs"; CoordinateReferenceSystem crs = csFactory.createFromParameters("MyEase", paramString);
I get the following exception which I don’t know how to fix, other paramStrings do work for me:
[java] java.lang.IllegalAccessException: Class org.osgeo.proj4j.Registry can not access a member of class org.osgeo.proj4j.proj.Projection with modifiers "protected"
And with the following approach:
CylindricalEqualAreaProjection ceq = new CylindricalEqualAreaProjection(0, 0, 30); ProjCoordinate input = new ProjCoordinate(-71.006, 42.363); // Boston Airport ProjCoordinate result = new ProjCoordinate(); ceq.project(input, result); String resultString = ProjectionUtil.toString(result); System.out.println(result);
I get a result (-1217895, 27830839) but when I overlay it in Arcmap on a layer/dataframe in the “World_Behrmann WKID: 54017 Authority: ESRI” it is way off the world map.
Lastly, if I change all the parameters to 0 in the construction of the projection this should result in the Lambert Cylindrical Equal-Area Projection. When I project my coordinate and overlay it in Arcmap on layer/dataframe in the “World_Cylindrical_Equal_Area WKID: 54034 Authority: ESRI” projection the location appears about 17 km to the north east of the true location.
Any suggestions on how to get this working in proj4j or some other java based solutions?