Skip to content
Prev 2477 / 29559 Next

Units of centroid point coordinates generated byget.Pcent and calcCentroid?

Thank you both for your answers:

Here is what I think that you are trying to convey:

1) The centroid points do not match the map projection because the 
projection attributes for the shapefile are poorly defined.
2) If I correctly define the shape file's projection attributes, then 
both get.Pcent() and calcCentroid() generate centroids
    in units that match the projection of the shape file.
 
One additional fact: this shape file does have a .prj file:

PROJCS["North_America_Albers_Equal_Area_Conic",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["Albers"],PARAMETER["False_Easting",0.0],
PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-96.0],PARAMETER["Standard_Parallel_1",20.0],
PARAMETER["Standard_Parallel_2",60.0],PARAMETER["Latitude_Of_Origin",40.0],UNIT["Meter",1.0]]

I made the assumption that:
MapPolysMapClass = read.shape("FiveNWStateCounties")

...would read the .prj file. I guess not, from reading your message.

Do the projection settings specified by spTransform() override the 
contents of the .prj file (when it exists)? I think the answer is yes.

I will try 1) using the OGR methods, 2) Using the spTransform methods to 
explicitly define the projection parameters.

Regards,
RR
Roger Bivand wrote: