How do I import an openstreetmaps shape file in R and extract lat/long centroids?
问题 I am trying to import an openstreetmaps shape file in R using the rgdal package. The shape file I downloaded has 5 components in it: places.cpg places.dbf places.prj places.shp places.shx The files can be accessed at the following location: https://drive.google.com/open?id=0B1ITb_7lHh1EUFVfVWc4ekRfSnc I have to do the following: 1) Import the shape file 2) Extract lat/long of the point or centroid of shape in case of polygon 3) Attach the lat/long pair to the dbf file to do some analysis I am