Using r.in.gdal, how to specify band to extract?
I want to use r.in.gdal to extract a single channel from a multi-channel image. The man page indicates that I can specify which band to extract using the argument “band=” followed by a number in the...
View ArticleGDAL local files VS ftp files
I can successfully get raster information when the raster file is located on my local file system: import gdal from gdalconst import * filename= "MOD11A1.A2012193.h11v11.005.2012196013534.hdf" dataset...
View Articlegdallocationinfo is not recognized
I tried to run gdallocationinfo from my FWTools shell and got a message saying: “gdallocationinfo is not recognized as an internal or external command, operable program or batch file”. So I checked the...
View ArticleHow can I dynamically trim the informational border off of FAA sectional...
I’m trying to write a script that can automatically use GDAL to crop the informational border from the FAA’s published sectional charts (GeoTIFF) found here: I know that I can use gdal_translate...
View ArticleSetColorInterpretation() for a GeoTiff using GDAL not working
I have a single band image which I would like to copy to a 3 bands of a new image and set the ColorInterpretation to red, green and blue respectively. I have tried two approaches, one using the GTiff...
View ArticleWriting array to vrt
I would like to write an array from a single band image to a 3 band vrt where each band has the ColorInterpretation() tag of red, green, blue respectively. My code below; from osgeo import gdal import...
View ArticleIn Python, reading a GDAL raster from memory instead of a file
I’d like to analyze some raster data in Python using NumPy. This data doesn’t necessarily exist as a file on the filesystem, it could be the result of a query against PostGIS, or something transferred...
View ArticleConvert timeseries stack of GTiff raster to single NetCDF
Moving from gdal-dev mailing list: On Mon, Sep 2, 2013 at 7:09 PM, David Shean wrote: Hi list, I’m trying to package a timeseries of GTiff rasters with identical projection/extent/resolution as a...
View Articlegdal2tiles flipping tile .pngs upside down [closed]
I have a geotiff generated with togeo.py, and when I put it through gdal2tile.py, the .pngs flip upside down. I don’t mean that tiles on the north appear on the south — I know that’s just a matter of...
View Articlegdal_translate produces tif with different colors as original
I am using SDE as my raster data source with the ultimate goal to tile this dataset: I am running the following gdal_translate command to generate the initial VRT: gdal_translate -projwin 390605...
View ArticleHow to open OSM file in Python with GDAL
I am trying to open a *.osm file in Python with GDAL. But I doesn’t work. What am I doing wrong? import ogr driver = ogr.GetDriverByName('OSM') datasource = driver.Open('map.osm') layer =...
View ArticleKML to Shapefile using GDAL (LIBKML) – MultiGeometry data not transforming
I am trying to convert a KML file to Shapefile using GDAL (ogr2ogr). Regular KML files convert fine but KML files containing MultiGeometry features (eg: Geometry containing both Point and Polygon) do...
View ArticleFortifying re-projected shapefile for ggplot2 in R
I have a shapefile of US county boundaries which I got from the NHGIS. I can load the file using the rgdal package and see information about it: library(rgdal) shp_1860 <- readOGR("shp",...
View ArticleInformations about API in GDAL for geocoding
I write to ask you if did you ever used the new API in GDAL for geocoding. (Link for description: http://www.gdal.org/ogr/ogr__geocoding_8h.html#a2b0382ceb7e3935d7fe1da2adada564e ). Do you know what is...
View ArticleHow to extract subdataset from HDF raster?
I am trying to extract a subdataset from HDF raster. Later on, I intend to make operations such as mosaicking and extracting raster averages from the extracted subdataset. The following code is...
View Articledisplay GeoReferencing image through MapServer
I have a tiff image and got the world file which contains the needed information for GeoReferenceing, how to start add this image on Mapserver ? if I use C# and use GMAP API to call the google server...
View ArticleHow to run OGR in ArcGIS Scripts?
When I run my script outside ArcGIS it works because during execution script uses a GDAL and OGR modules from osgeo. When I use script as a tool in ArcGIS it does not work. In PySripter I can import...
View ArticleHow to average a set of n rasters using gdal or other GRASS module? [duplicate]
This question already has an answer here: Tools to flatten the jp2 to a single band (average the bands)? 1 answer How to produce a mean raster file based on other raster files? [duplicate] 2 answers
View ArticleOGR FeatureCount returns '-1' with OSM data
I am trying to read in an OSM file with OGR. import ogr driverOSM = ogr.GetDriverByName('OSM') roadsDs = driverOSM.Open('data/map.osm', 0) roadsLayer = roadsDs.GetLayer() The feature count returns -1...
View Articlegdal2tiles doesn't use resampling method correct?
I’m using gdal2tiles to create tiles from MODIS satellite imagery (250 m resolution) and I have noticed that I get the same bad result if I use -r near or -r bilinear (or lanczos for that matter). See...
View Article