[R-sig-Geo] Shifting a spatial object by (dx,dy)

David Forrest drf5n at maplepark.com
Wed Feb 7 19:53:59 CET 2007


On Wed, 7 Feb 2007, Roger Bivand wrote:

> On Wed, 7 Feb 2007, David Forrest wrote:
>
>> Hi,
>>
>> I've got a mis-projected UTM zone 18 polygon shapefile, the coordinates of
>> which need a transformation of (+287.4395, -77.5542) added to them to be
>> in WGS84/NAD83 UTM 18.  Since this is a non-standard CRS / non-EPSG CRS,
>> I'm not sure about the best way to fix it.
>>
>> Is there some function that would add this offset to the component
>> polygon coordinates, bbox, and labpts data?
>
> No, although it could be done by picking things apart and shifting them
> point for point. My first choice would be to hand-craft a +proj=tmerc CRS
> for the shifted data and use spTransform() in rgdal to move it, probably
> by making the modifications in +x_0= and +y_0= in relation to the correct
> ones for the UTM zone. When the differences between the bounding boxes or
> label points of the input and output data are correct, the fake CRS will
> be the right one.

Fiddling with UTM's +x_0 and +y_0 options sounds good -- I tried a optim() 
over the towgs84 parameter space to minimizes the errors on my small set 
known points and thought it was doing some rotations I didn't trust..

Thanks,
-- 
  Dr. David Forrest
  drf at vims.edu                                    (804)684-7900w
  drf5n at maplepark.com                             (804)642-0662h
                                    http://maplepark.com/~drf5n/




More information about the R-sig-Geo mailing list