1

I'm trying to plot some points on a raster (which has a OSGB36 projection), but the points x and y positions are in a different extent to the plotted raster. How can I get the points to be in the same coordinate system/extent as the raster, so they appear on the raster.

The raster layer crs:

extent      : 420000, 480000, 440000, 5e+05  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +datum=OSGB36 +units=m +no_defs +ellps=airy +towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894 

plotted raster:

enter image description here

Yet the x/y positions of the points (which are also in OSGB6) are:

54, -1.3

Any ideas on what I may have done wrong/how to fix it?

Thanks!

Sébastien Rochette
  • 6,536
  • 2
  • 22
  • 43
user3384265
  • 173
  • 11
  • Just looking at your raster extent: 420000, 480000, 440000, 5e+05 and your point coordinates: 54, -1.3 You can see something is wrong here, since the value ranges don't match at all. In a desktop GIS software, do these two layers overlay? – maRtin May 21 '17 at 11:52
  • Yes. I've got the points and raster to overlay properly. However, when I create the coordinates of the points using the geometry calculation in ArcGIS, it calculates the 54, -1.3 x/y coordinates, which is not in the same projection. Is it a problem with how the raster is plotted? How is the extent calculated? From the CRS? – user3384265 May 21 '17 at 12:11

1 Answers1

1

Your point seems to be in wgs84 geographical coordinates and not in projected Osgb6. You probably misspecified the crs in Arcgis. You need to modify the crs of your point. I assume your raster is called r:

pt <- data.frame(x=54,y= -1.3)
coordinates(pt) <- ~x+y
projection(pt) <- "+init:epsg=4326"
pt_osgb <- spTransform(pt, CRS(projection(r)))

By the way, you know that you can get coordinates of a point in R while using function locator(sp=TRUE).

Sorry, I am with my smartphone, I cannot test this script but I think this may be the reason...

Sébastien Rochette
  • 6,536
  • 2
  • 22
  • 43
  • Thank you! I've done the spTransform with the raster as the coordinate specifier. Works now! I didn't know about locator, so I'll make sure to remember that. Solved! – user3384265 May 23 '17 at 10:03