[R-sig-Geo] Help with project function in rgdal library

Michael Sumner mdsumner at gmail.com
Tue Jul 12 01:23:53 CEST 2011


At least one way is to put the CRS text into a .prj file and read it
in and see what rgdal gives.

I created a dummy shapefile, and put your text into dummy.prj:

It may well be that this is not enough and you need to delve deeper,
but it's an easy starting point to start cross-checking the WKT
against other formats:

library(rgdal)
x <- SpatialPointsDataFrame(SpatialPoints(matrix(rnorm(10), ncol =
2)), data.frame(x = 1:5))
writeOGR(x, ".", "dummy", "ESRI Shapefile")

x <- readOGR(".", "dummy")
proj4string(x)

[1] " +proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333
+lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80
+datum=NAD83 +units=us-ft +no_defs +towgs84=0,0,0"

Cheers, Mike.

On Tue, Jul 12, 2011 at 3:10 AM, Patrick Leahy <pleahy at law.stanford.edu> wrote:
> Hi,
>
> I'm trying to plot a set of geographical coordinates over the polygons
> in a shapefile, so I need to transform the coordinates to the same
> projection. I'm currently using the project function in the rgdal
> library, but I can't seem to figure out how to format the proj string
> argument correctly. (I made a couple attempts using
> http://www.remotesensing.org/geotiff/proj_list/ as a reference.) The
> text of the .prj file is included below. Any help would be greatly
> appreciated!
>
> Patrick
>
> PROJCS["NAD_1983_StatePlane_New_York_Long_Island_FIPS_3104_Feet",
> GEOGCS["GCS_North_American_1983",
> DATUM["D_North_American_1983",
> SPHEROID["GRS_1980",6378137.0,298.257222101]],
> PRIMEM["Greenwich",0.0],
> UNIT["Degree",0.0174532925199433]],
> PROJECTION["Lambert_Conformal_Conic"],
> PARAMETER["False_Easting",984250.0],
> PARAMETER["False_Northing",0.0],
> PARAMETER["Central_Meridian",-74.0],
> PARAMETER["Standard_Parallel_1",40.66666666666666],
> PARAMETER["Standard_Parallel_2",41.03333333333333],
> PARAMETER["Latitude_Of_Origin",40.16666666666666],
> UNIT["Foot_US",0.3048006096012192]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list