FAQ Database Discussion Community


Django SerializerDoesNotExist 'geojson'?

django,serialization,geojson,gdal
I'm trying to serialize data in the geojson format however whenever I use json = serialize("geojson", coordinate.objects.all()) response = HttpResponse(json) return response django gives me SerializerDoesNotExist at /getmarkers/ 'geojson' this works fine json = serialize("json", coordinate.objects.all()) surely anyone else who has tried using the geojson serializer has ran into the...

Missing projection file in R's rgdal package for geospatial analysis

r,rstudio,gdal,rgdal
I'm having a problem I can't solve with rgdal in which the projection file seems to be missing. This is the error I get: proj4string(d) <- CRS("+init=epsg:28992") Error in CRS("+init=epsg:28992") : no system list, errno: 2 It's confusing because when I load the package, it seems to successfully autodetect the...

max() implemented with basic operators

algorithm,math,gdal
I'm wrangling some bad data in a raster image using GDAL with gdal_calc.py. I'm trying to clip value A at -100 like this: max(A, -100) However, only basic operators (+-/*) and logical operators (><, these return 0 or 1) are allowed. Is there a way to implement this? Got as...

Reprojecting coordinates using GDAL library

c++,gdal,coordinate-systems,mingw-w64
I'm trying to reproject a lat/lon coordinate in the WGS84 system to an UTM one in the SIRGAS 2000 coord system. Using GDAL, I started with changing a known utm coordinate to the lat/lon counterpart in the same coordinate system (29 N), just to check that I wrote the right...

unable to install rgdal in ubuntu 14.04 (undefined to reference to 'pj_ctx_fclose')

r,gdal,rgdal,proj4
I tried to install rgdal with configure.args but no luck. Installed gdal version: gdal-config --version 1.11.2 ogrinfo --version GDAL 1.11.2, released 2015/02/10 found gdal binary tools: ls /usr/bin | grep gdal gdal2tiles.py gdal2xyz.py gdaladdo gdal_auth.py gdalbuildvrt gdal_calc.py gdalchksum.py gdalcompare.py gdal-config gdal_contour gdaldem gdal_edit.py gdalenhance gdal_fillnodata.py gdal_grid gdalident.py gdalimport.py gdalinfo gdallocationinfo...

Installing GDAL with ECW support

gdal
Most (all?) information online is outdated since ECW (Hexagon Geospatial/Intergraph) has recently released new versions with breaking changes (5.0, 5.1 and 5.2). Most instructions result in errors like: checking for libNCSEcw.so or libecwj2... configure: error: not found in /usr/local/lib or /usr/local/bin ...

How to convert point data collected at grid interval to a georeferenced dataset in r?

r,ggplot2,gdal
I have this dataset: https://www.dropbox.com/s/k06n9l05t25r6x2/newdata.csv?dl=0 (Sample) "","row","col","flagrv" "1",2361,530,2 "2",2378,531,2 "3",2360,531,2 "4",2355,531,2 "5",2363,532,2 "6",2359,532,2 "7",2368,533,2 "8",2367,533,2 "10",2359,533,2 And if I plot using this code: gs.pal <- colorRampPalette(c("blue", "green","yellow","orange","red"),bias=1,space="rgb") ggplot(data=ndata,aes(x=col,y=row,color=flagrv)) + geom_point(size = 0.01)+ scale_colour_gradientn(name = "Scale",colours = gs.pal(5))+ xlab('Longitude')+...

Writing compressed netCDF4 files with raster

r,raster,gdal,rgdal
I want to write compressed netCDF4 files using the raster package. ncdf4 and rgdal are installed correctly. The following, however, fails to return a netCDF4 compressed file: library(raster) r <- raster() <- runif(86400) r[] <- <- runif(86400) writeRaster(r, "test.nc", options=c("COMPRESS=DEFLATE", "FORMAT=NC4")) In fact it just returns a standard netCDF file:...

Error in using gdal java binding

java,transformation,gdal,coordinate-systems
I am using the java binding of gdal to project a set of coordinate points from UTM to lat/log using the CoordinateTransformation Class of gdal. I have written the code as follows: SpatialReference oUTM = new SpatialReference(); SpatialReference oLatLog = new SpatialReference(); oUTM.SetProjCS("UTM 44/ WGS84"); oUTM.SetWellKnownGeogCS("WGS84"); oUTM.SetUTM(44, 1); oLatLog =...

Convert features of a 'multifeature' GeoJSON into R spatial objects

r,geojson,gdal,rgdal
Normally you can read geojson files into R with trusty readOGR, as illustrated here. However, this fails for multifeature geojsons. Reproducible example: downloader::download("https://github.com/Robinlovelace/Creating-maps-in-R/raw/master/data/test-multifeature.geojson", "test.geojson") test <- rgdal::readOGR("test.geojson", "OGRGeoJSON") # fails with: Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : Multiple incompatible geometries: wkbPoint:...

No module named osgeo.ogr

python,virtualenv,gdal
I need to import osgeo.ogr module to virtualenv python program. Global python has this module: [email protected]:~/$ python Python 2.7.8 (default, Oct 20 2014, 15:05:19) [GCC 4.9.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import osgeo >>> But into virtualenv (without --no-site-packages): [email protected]:~$ temp/bin/python Python 2.7.8...