I think you have the correct idea down. I usually refer to the stages as 1) data CRS 2) world CRS 3) screen
This is usually covered in the training materials for: - http://udig.refractions.net/confluence/display/DEV/1+Coordinate+MapGraphic - http://udig.refractions.net/confluence/display/DEV/3+Render (You can review the source code of those tutorials for source code examples). I would note that rotating is usually an "affine transform" so to get the effect you want you need to a) find te centroid of the geometry (cx,cy) b) translate the geometry to the origin translate(-cx,-cy) c) rotate( theta ) d) translate the geometry back translate(cx,cy) If not your geometry "rotates" with respect to the origin; resulting in it moving away from the place you expect -- Jody Garnett On Thursday, 29 September 2011 at 10:27 PM, Trupti Pol wrote: > Hi, > > We have a rotateGeom service implemented as follows > 1)select the geom, get its coordinates > 2)convert them to screen coordinates > 3)rotate > 4)convert back to world coordinates > 5)finally build the resultant geometry. > > Now this rotateGeom works fine if map CRS and Layer CRS is same. > But if Map CRS is polyconic and say layer CRS is geographic then it is not > giving me the correct output. > > Here i understand the fact that geometry processes as > 1) Geom in LayerCRS > 2) Geom in MAP CRS > 3) Geom in Screen Coordinates > 4) rotate in Screen Coordinates > 5) Rotated Geom in MAP CRS > > So i added one more step > 6) transform rotated geometry from MAP CRS to layer CRS > > But still i am getting the rotated geometry placed somewhere else on the map > and not restoring its original position. > > Please suggest me what can be done further to solve this or correct me if i > am doing some mistake in overall process. > > > > > -- > View this message in context: > http://udig-devel.19327.n5.nabble.com/Unable-to-rotate-geom-if-map-crs-and-layer-crs-is-different-tp4852872p4852872.html > Sent from the udig-devel mailing list archive at Nabble.com > (http://Nabble.com). > _______________________________________________ > User-friendly Desktop Internet GIS (uDig) > http://udig.refractions.net > http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel
