[R-sig-Geo] Read shapefile with correct proj4string for the data

Roger Bivand Roger.Bivand at nhh.no
Sat Apr 25 15:04:08 CEST 2009


On Fri, 24 Apr 2009, Jim Burke wrote:

> Hi I have a shapefile that I open successfully
> but incorrectly (data is not in lat long format)
> with the following. I am curious what the correct
> proj4string would be given the "prj" file below.
>
> my_map_sp <- readShapePoly("my_shape_file.shp",
> IDvar="ID", proj4string=CRS("+proj=aea
> +ellps=GRS80 +datum=WGS84"))
>
> What is the correct "proj4string" format
> given the below?
>
> PROJCS["NAD_1983_StatePlane_Texas_North_Central_FIPS_4202_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",1968500.0],
> PARAMETER["False_Northing",6561666.666666666],
> PARAMETER["Central_Meridian",-98.5],
> PARAMETER["Standard_Parallel_1",32.13333333333333],
> PARAMETER["Standard_Parallel_2",33.96666666666667],
> PARAMETER["Latitude_Of_Origin",31.66666666666667],
> UNIT["Foot_US",0.3048006096012192]]

library(rgdal)
EPSG <- make_EPSG()
EPSG[grep("Texas North Central", EPSG$note),]

so most likely CRS("+init=epsg:2276")

(the offsets are given in ftUS in your source, in m in EPSG)

Using readOGR() in rgdal would read the *.prj file too, but readOGR() 
doesn't (yet) handle as many DBF field types as readShapeSpatial() in 
maptools (dates are a problem).

Hope this helps,

Roger

>
> Thanks,
> Jim Burke
>
> _______________________________________________
> 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