I had a quick Google and came across this post which suggests this was an OS X error where the packages were built incorrectly. On my Mac system, I wasn't able to reproduce your error, so for what it's worth I installed my versions of rgdal and rgeos from http://www.kyngchaos.com/software:frameworks...
Finally, I sovled this issue . Firstly, removing proj4-4.8 by apt-get. sudo apt-get remove libproj-dev Secondly, adding my compiled proj4-4.9 lib path into a new conf file (such as rgdal.conf) under the path of '/etc/ld.so.conf.d/'. cd /etc/ld.so.conf.d sudo touch rgdal.conf echo 'the lib path of proj4-4.9' | sudo tee -a...
Would something like this work? library(sp) pts <- SpatialPoints(cbind(c(1, 1, 1, 2, 3, 4), c(1, 1, 1, 4, 2, 4))) pts <- SpatialPointsDataFrame(pts, data=data.frame(id = c(1, 2, 2, 3, 4, 5))) ## All points pts ## No spatial duplicates remove.duplicates(pts) ## No duplicates in attributes pts[which(!duplicated(pts$id)), ] ## Combination pts[which(!duplicated(as.data.frame(pts))),...
Choose "ASCII Grid and GML (Grid)" as download format for the "OS Terrain 50" product, and download the file. This will give you a zip file containing many directories of zip files, each of which contains portions of a 50 m elevation grid of the UK (the portion I looked...
Use raster::projectRaster() or (not in R) gdalwarp to transform raster.
I'm not 100% sure, but I think this is all that is needed: names([email protected])[names([email protected])=="STATE_NAME"] <- "NAME" You should then be able to join the data sets with provinces_and_states <- rbind(state.sub, provinces.sub) Alternatively, you could probably get the data from Natural Earth....
Edit (2015-03-10): If one simply wants to crop out a subset of an existing GeoTIFF and save the cropped part to a new *.tif file, using gdalUtils::gdal_translate() may be the most straightforward solution: library(raster) # For extent(), xmin(), ymax(), et al. library(gdalUtils) # For gdal_translate() inFile <- "C:/files/krel_1129_2012_254dpi_LZW.tif" outFile <-...
I think this should work: writeRaster(stk, "BIP_test", format="ENVI", options="INTERLEAVE=BIP", overwrite=TRUE) per the GDAL formats page on the ENVI format, "BIP" (not "PIXEL") is the argument to "INTERLEAVE". Based on my reading of the WriteRaster helpfile, bandorder='BIP' only works for the raster packages native file format....
The general advice is to read shapefiles with rgdal::readOGR, as in library(rgdal) city = readOGR(".", "City_Boundary") That will not only give city its proper CRS: proj4string(city) [1] "+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs +ellps=GRS80 +towgs84=0,0,0" but also warn you if you want to change it without reprojecting:...
Just add verbose=FALSE to the readOGR call to suppress the messages (which are helpful during an interactive session but are cruft when in scripts or notebooks).
I would recommend to "project" (i.e. multiply by -1) the points in the -180.0000, -90.0000, 180.0000, 90.0000 bounds, as they are lying in the southern and western hemispheres. library(sp) pasaporte <- structure(list(Latitud = c(13.84778, 13.01667, 13.15722), Longitud = c(73.75333, 75.08333, 74.22278)), .Names = c("Latitud", "Longitud"), class = "data.frame", row.names =...
You can use the require_geomType parameter for various GDAL functions to extract the features that you need: library(rgdal) ogrListLayers("test.geojson") ## [1] "OGRGeoJSON" ## attr(,"driver") ## [1] "GeoJSON" ## attr(,"nlayers") ## [1] 1 # This fails but you can at least see the geoms it whines about ogrInfo("test.geojson", "OGRGeoJSON") ## Error...
ncdf files are not written via GDAL because the rgdal package (at least the binary version on windows) does not come with the ncdf driver. Instead, writeRaster uses package ncdf or (preferably) ncdf4, so you would have to use arguments provided by the ncdf4 package (in the ncvar_def function). That...