Skip to content
Prev 3767 / 29559 Next

[OT] Coordinates and pojection problems

Hi,

You need to find out what the projection of the shapefile is, the 
ogrinfo does not give this information for your file as you probably do 
not have the .prj file. The R function spTransform needs the projection 
info in a so called proj4string. The easiest way to define such a string 
is through the epsg code, this code enables proj (the projection library 
used in R) to find the parameter it needs. For example, the proj4string 
for the Dutch national projection is:

"+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 
+k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m 
+towgs84=565.04,49.91,465.84,-0.409394387,0.35970519561,-1.868491,4.0772 
+no_defs"

using epsg codes:

"+init=epsg:28992"

The bottomline is to find the projection of your second shapefile as 
this is the most likely candidate to cause the difference. A good place 
to ask questions regarding projections is the proj4-mailing list 
(http://lists.maptools.org/mailman/listinfo/proj).

hth and cheers,
Paul
Julien Barnier wrote: