I have a polygon feature on map to which I need to transform the coordinates to local coordinate system with respect to new origin while keeping the same datum.
So far using the Proj4 library and by defining the custom map origin I could able to re-project/transform my global coordinates to local as follows
+proj=etmerc +lat_0=52.481392 +lon_0=13.355795 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
--Using this Proj4 definition
Here in the image you can see the marker with name "New Origin" is the one I want to keep at center and transform the coordinates of highlighted polygons to local coordinate system
These are the original coordinates of selected polygons
These are the transformed coordinates of same polygon w.r.t. new map origin
What I am looking forward now is the case of rotated map origin, as of now the current map origin is facing northwards i.e. to north pole, which I need to be rotated by around 90 degrees. Ideally this rotation should effect coordinates of the polygon (as those -ve now may get positive and vice versa).
+proj=omerc +lat_0=52.481392 +lonc=13.355795 +alpha=90.0 +k=1.0 +x_0=0 +y_0=0 +no_uoff +gamma=90.0 +ellps=WGS84 +units=m +no_defs
--New definition I am trying
Regarding the same, I found this question helpful and thought to try the Oblique Mercator projection, however the results are not changing when I did the 90 degree rotation for alpha and gamma
alpha
andgamma
it sets the missing one to the explicitly defined one. Set the+gamma=0
to work in the rotated coordinates, otherwise, gamma=alpha will keep your coordinates aligned with the original azimuth