I am using GeoServer and have a layer in EPSG:900913
("Google Mercator").
I need to "rotate" the map around certain point (say, 1500000, 7000000
) by certain degree (say, 30 degrees clockwise). How could I define such a coordinate system based on EPSG:900913
?
GeoServer's angle
vendor option does not work for my purposes as I need to tile the map later on.
As far as I understand this, my only option is to define an own coordinate system. For GeoServer I'd need to define it in WKT form. The configuration seems to be straightforward, but I have a difficulty defining my rotated CRS in WKT.
I am wondering how to apply a rotation around certain point onto a CRS like Google Mercator:
PROJCS["WGS84 / Google Mercator",
GEOGCS["WGS 84",
DATUM["World Geodetic System 1984",
SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["semi_minor", 6378137.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", 0.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH],
AUTHORITY["EPSG","900913"]]
My questions, specifically:
- How to write a WKT which transform an existing CRS? My guess would be that I need a new
PROJCS
wrapping an existing one and adding aPROJECTION
clause. - How would I found out the projection id (like
Mercator_1SP
above) and the required parameters (thePARAMETER
clauses)? - Can I "reference"
EPSG:900913
in CRS WKT instead of copy-pasting the wholePROJCS
clause?
Answer
Ok, I've figured it out.
It is possible to apply an affine transform onto some existing CRS using FITTED_CS
. Below is an example of rotation of 60 degrees counterclockwise and movement:
FITTED_CS["BPAF",
PARAM_MT["Affine",
PARAMETER["num_row", 3],
PARAMETER["num_col", 3],
PARAMETER["elt_0_0", -0.5],
PARAMETER["elt_0_1", -0.8660254037844386],
PARAMETER["elt_0_2", 1487816.0],
PARAMETER["elt_1_0", 0.8660254037844386],
PARAMETER["elt_1_1", -0.5],
PARAMETER["elt_1_2", 6886579.0]],
PROJCS["WGS84 / Google Mercator",
GEOGCS["WGS 84",
DATUM["World Geodetic System 1984",
SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
UNIT["degree", 0.017453292519943295],
AXIS["Longitude", EAST],
AXIS["Latitude", NORTH],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["semi_minor", 6378137.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", 0.0],
PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["x", EAST],
AXIS["y", NORTH],
AUTHORITY["EPSG","900913"]],
AUTHORITY["EPSG","8011113"]]
However I've found a bug in the current version of GeoTools (class cast exception when parsing this WKT). I've patched it and will also commit the fix.
No comments:
Post a Comment