Hi Martin, Hi list,
I was experiment with the grid coverage renderer and I found that the
attached code does not work with the version I have of epsg-hsql and
epsg-access.
Could anyone check it because it might be an issue related to the fact
that I need to udate the coverage branch to the trunk but it might be
a bug as well.
Simone.
--
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
Simone Giannecchini
Software Engineer
Freelance Consultant
http://simboss.wordpress.com/
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
final CoordinateReferenceSystem mapcrs = CRS
.parseWKT("PROJCS[\"NAD_1983_UTM_Zone_10N\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137,298.257222101]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",500000],PARAMETER[\"False_Northing\",0],PARAMETER[\"Central_Meridian\",-123],PARAMETER[\"Scale_Factor\",0.9996],PARAMETER[\"Latitude_Of_Origin\",0],UNIT[\"Meter\",1]]");
GeneralEnvelope firstEnvelope = new GeneralEnvelope(new
double[] { 42,
9 }, new double[] { 43, 11 });
firstEnvelope.setCoordinateReferenceSystem(CRS.decode("EPSG:4326"));
final MathTransform crsTransform = CRS.transform(CRS
.decode("EPSG:4326"), mapcrs, true);
final GeneralEnvelope transformedEnvelope;
if (!crsTransform.isIdentity()) {
transformedEnvelope =
CRSUtilities.transform(crsTransform,
firstEnvelope);
transformedEnvelope.setCoordinateReferenceSystem(mapcrs);
} else
transformedEnvelope = new
GeneralEnvelope(firstEnvelope);
final GeneralEnvelope oldEnvelope =
CRSUtilities.transform(crsTransform
.inverse(), transformedEnvelope);
oldEnvelope.setCoordinateReferenceSystem(CRS.decode("EPSG:4326"));
if (!oldEnvelope.equals(firstEnvelope))
assertNotNull(null);