6

I have a problem which many ArcGIS, QGIS and R users from Czech Republic and Slovakia may encounter. In ArcGIS, I am working EPSG: 5514, Projected Coordinate System, defined as:

S-JTSK_Krovak_East_North
WKID: 5514 Authority: EPSG

Projection: Krovak
False_Easting: 0.0
False_Northing: 0.0
Pseudo_Standard_Parallel_1: 78.5
Scale_Factor: 0.9999
Azimuth: 30.28813975277778
Longitude_Of_Center: 24.83333333333333
Latitude_Of_Center: 49.5
X_Scale: -1.0
Y_Scale: 1.0
XY_Plane_Rotation: 90.0
Linear Unit: Meter (1.0)

Geographic Coordinate System: GCS_S_JTSK
Angular Unit: Degree (0.0174532925199433)
Prime Meridian: Greenwich (0.0)
Datum: D_S_JTSK
  Spheroid: Bessel_1841
    Semimajor Axis: 6377397.155
    Semiminor Axis: 6356078.962818189
    Inverse Flattening: 299.1528128

When I load my file in R, my proj4string(data_in_5514) shows:

 "+proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +units=m +no_defs"

I've got the same information when I export my files from R using writeRaster() function from raster package. However, when I want to open my data modified in R again in ArcGIS, my ArcGIS crashes, and if I am lucky, I've got a warning message :

Warning, inconsistent extent!

which means (http://support.esri.com/em/knowledgebase/techarticles/detail/37732):

This error message is returned if the data has an incorrect projection definition.

Specifically, the data is in a projected coordinate system with units of feet, meters or other linear units, but the projection has been defined with a Geographic Coordinate System (GCS) that has units in decimal degrees.

Thus, obviously the projection of my data has changed, but when and how ???

How can I correctly transfer data between R and ArcGIS using Krovak EPSG 5514? I've also found, that this one PCS is also listed as EPSG: 102067 under ArcGIS, however, R doesn't recognize this code.

EDIT :

sample data: http://ulozto.sk/xNHrBv2D/r3-zip

as an output I was using several formats. I was able to opet Gtiff once, .img neidther one time, .grd seems not to be directly recognized by ArcGIS.

export data:

writeRaster(aaa, filename="r3.img", format="HFA", overwrite=TRUE)
# export data
writeRaster(aaa, filename="r3.tif", format="GTiff", overwrite=TRUE)
# export data
writeRaster(aaa, filename="r3", overwrite=TRUE)  # creates a .grd
  • Since writeRaster can output to several formats, it would be helpful to know the format you are using, whether you have tried other formats, and see the exact writeRaster statement. It would also be helpful to see the workflow (abbreviated if necessary), i.e. loading from disk, the operation (or some operation) that alters the data, and writing to desk. – Lee Hachadoorian May 3 '16 at 21:18
  • Please make your problem is reproducible by providing sample code you have tried so far and/or sample data. If you can not share the original data, use the data that comes with the packages. – Farid Cheraghi May 4 '16 at 4:32
  • What version of GDAL do you have in R? There were some improvements for Krovak projections for GDAL 2.0. – Mike T May 4 '16 at 4:42
  • It is far from perfect but using formats for conversion between the various software which discards datum/projection information completely is also a way to go to overcome this. – Miro May 4 '16 at 5:01
  • I'd remove projection from output raster and see what happens. You can always define it later in ArcGis – FelixIP May 4 '16 at 5:52
2
+50

I suggest to remove projection information in R output raster and open it in ArcGIS. If successful, define projection from within latter.

I applied this trick with vectors coming from MapInfo to ESRI products. Slight difference in projection naming by these two packages had devastating result with points being 200 m away from their true position. Good example of it is projection called GD_1949_New_Zealand_Map_Grid in ArcGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.