[R-sig-Geo] "Flipping" coverages and/or shapefiles

Roger Bivand Roger.Bivand at nhh.no
Thu Nov 1 08:38:12 CET 2007


On Wed, 31 Oct 2007, Levi Rose wrote:

> Hello everyone,
>
> I have coverages and shapefiles that are oriented incorrectly.  I need to be
> able to reorient the datasets by turning them over, from top to bottom,
> along the horizontal axis.  ArcToolbox has an exact function for Raster data
> in Data Management (Flip), with command line syntax for scripting.  I know
> how to manually flip the shapefiles and coverages, but I have around 1000
> files to transform, so it would be much more efficient to run a script. Does
> anyone know of command line syntax for a similar function with vector data?
>
> I have come very close to "flipping" the coverage files, but I'm stuck on
> how to update/change the x,y coordinates in tic files.  The RArcInfo package
> will allow you to read tic files via the "get.tabledata" function, but does
> not have a write table function that I'm aware of.  I would greatly
> appreciate any input or strategies to unravel this mystery.

Could you look at elide() in the maptools package? It isn't exactly what 
you are asking for, but probably quite close:

library(maptools)
xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
  IDvar="FIPSNO")
par(opar)
opar <- par(mfrow=c(2,1))
plot(xx, axes=TRUE)
plot(elide(xx, reflect=c(FALSE, TRUE)), axes=TRUE)

Looking at the code in elide should provide what you need to make a more 
exact fit.

Roger

>
> Cheers,
> Levi
>
>
> Research Assistant
> Dept. of Watershed Sciences
> Utah State University
> 5210 Old Main
> Logan, Utah 84322
> (740)-591-1750
> LeviDRose at gmail.com
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list