1
Python and Java API / CRS coordinates to Region coordinates
« on: March 29, 2021, 01:23:50 PM »
Hello everyone,
I have a bunding box of which the following quantities are known: center coordinates (northing and easting), width, height and rotation angle, as shown below:
The problem is that all the quantities (center, size) are expressed in the chunk's geographic coordinate system (in this case EPSG:7416).
I would like to set the reconstruction region (chunk.region) using this rectangle, but the units need to be converted to the local reference system first. Furthermore, the rotation angle needs to be converted into a rotation matrix, by assuming that the rotation around the other axes is zero (there is rotation only on the xy plane).
Does anyone have any idea of how to perform (using Python) this conversion, so that I can set:
starting from a rectangle expressed in the geographic CRS?
The region center.z value, and the size.z value should remain unchanged, only the xy values must be changed according to the rectangle.
I would like to thank anyone in advance,
Andrea
I have a bunding box of which the following quantities are known: center coordinates (northing and easting), width, height and rotation angle, as shown below:
The problem is that all the quantities (center, size) are expressed in the chunk's geographic coordinate system (in this case EPSG:7416).
I would like to set the reconstruction region (chunk.region) using this rectangle, but the units need to be converted to the local reference system first. Furthermore, the rotation angle needs to be converted into a rotation matrix, by assuming that the rotation around the other axes is zero (there is rotation only on the xy plane).
Does anyone have any idea of how to perform (using Python) this conversion, so that I can set:
- chunk.region.center
- chunk.region.size
- chunk.region.rot
starting from a rectangle expressed in the geographic CRS?
The region center.z value, and the size.z value should remain unchanged, only the xy values must be changed according to the rectangle.
I would like to thank anyone in advance,
Andrea