Skip to content

Plotting gps coordinates on Shapefile

2 messages · L S, MacQueen, Don

#
Your shapefile should include specifications for its coordinate system.
Look for a file names maryland.prj in the same directory as maryland.shp.
And that coordinate system should be included in your 'border' object. You
might need to change to using readOGR() to load the shapefile into R. Use

  str(border)

to find out.

If your border object does in fact include its projection, then you can
use spTransform(), as Barry suggested, to transform it to lat/long. Then
your overlay should succeed.

And I second Barry's recommendation to ask this kind of question on
r-sig-geo.


You will need to learn how to specify coordinate systems; a starting point
is
  ?proj4string
(from the sp package). r-sig-geo is definitely a good place to get help
for that.
I myself have used QGIS (Quantum GIS) to look up projection specs, as it
has a nice listing which you can search by name; in your case I'd search
for 'Maryland'. 

-Don