All Questions
1,068 questions
2
votes
1
answer
2k
views
Count number of points within multipolygon shapefile using OGR
I have two shapefiles: 1) consists of points (hundreds of entries) and 2) multi polygons (tens of thousands of entries).
I simply need to count the total number of points contained within the ...
2
votes
0
answers
2k
views
Error While installing GDAL in Ubuntu 12.04
I am trying to set CartoDB in Ubuntu 12.04. I am trying to install Python dependencies as a part of my installation. I am installing with below commands
export CPLUS_INCLUDE_PATH=/usr/include/gdal
...
2
votes
1
answer
1k
views
How to transform any GeoTIFF to Lambert Azimuthal Equal Area with GDAL?
I am trying to transform a GeoTIFF EPSG:4326 +proj=longlat +datum=WGS84 +no_defs
and a GeoTIFF EPSG:31982 +proj=utm +zone=22 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs both to EPSG:...
2
votes
1
answer
632
views
gdal.py as part of bat script in windows 7
I need to run the following bat file from a MS4W shell which has gdal_retile.py as the final option. I have added C:\ms4w\python\gdal to my pythonpath but within a pyscripter shell I can not import ...
2
votes
2
answers
2k
views
How to produce a mean raster file based on other raster files? [duplicate]
Possible Duplicate:
Tools to flatten the jp2 to a single band (average the bands)?
I have a number of raster files from a same area, that coordinates of corresponding pixels perfectly match one ...
2
votes
1
answer
627
views
GDAL 1.9.1 ogr2ogr KML to PostGIS not incuding ExtendedData
I have a KML file utilizing a Schema in the document and ExtendedData in each placemark. The ExtendedData does not seem to pass in conversion to PostGIS or shapefile.
2
votes
2
answers
6k
views
How do you open shapefiles with ogr2ogr [closed]
I'm following along the D3 tutorial, and on this line:
ogr2ogr \
-f GeoJSON \
-where "adm0_a3 IN ('GBR', 'IRL')" \
subunits.json \
ne_10m_admin_0_map_subunits.shp
run into the following ...
2
votes
1
answer
767
views
MapServer ESRI personal geodabase.mdb
I'm trying to read ESRI personal geodabase.mdb through OGR. I have my driver "PGeo" but when I write
ogrinfo INFLOR090812.mdb
I have this bug:
ERROR 1: Unable to initialize ODBC connection to ...
2
votes
1
answer
6k
views
Transform World data from EPSG:4326 to EPSG:3857
I have tried different open source tools to transform a world data shapefile from EPSG:4326 to EPSG:3857 but I always have an error. I'm not sure, but is it because of Antarctica?
I have tried with ...
2
votes
1
answer
1k
views
python gdal_polygonize error
I am trying to use gdal_polygonize to create a polygon from a binary raster.
My code is:
os.system('gdal_polygonize.py ' + filename + ' -f ESRI Shapefile ' + shapefile)
where filename is a string ...
2
votes
3
answers
5k
views
How to re-project the EASE (Equal Area Scalable Earth) grid with a ~25 km cylindrical projection to WGS84 0.25 degree?
I have nc files. from the metadata ,the projection is cylindrical and the resolution is 25 km:
indrical
NC_GLOBAL#ease_resolution=25
NC_GLOBAL#history=...
2
votes
1
answer
1k
views
Finding lat/lon of corners of geotiff file
I just recently managed to turn a GeoTIFF file into a .bmp file using gdal_translate. Now I need to find the latitude/longitude coordinates of the corners. I would prefer to use more of the gdal ...
2
votes
1
answer
1k
views
Converting CIB data to Google Tiles with GDAL
I'm trying to convert CIB map data into Google compatible Tiles through the following process (in Linux, GDAL compiled from source):
gdalbuildvrt data.vrt A.TOC
gdal_translate -of VRT -expand rgba ...
2
votes
1
answer
5k
views
What are the appropriate parameters to convert .asc file to geotiff using gdal_translate?
My starting file of interest is an ASC file with the following gdalinfo
Driver: AAIGrid/Arc/Info ASCII Grid
Files: sd_1_3_110805.asc
Size is 11880, 9720
Coordinate System is `'
Origin = (-117....
2
votes
2
answers
2k
views
Automate creating Rectified files from georeferenced images
A python 2.6.5 / ArcGIS 10 solution is preferred.
UPDATE:
I found a tool to do this "Create Ortho Corrected Raster Dataset" but the python script for it gives errors when I try.
import arcpy
import ...
2
votes
1
answer
4k
views
GDAL: Raster Intersection
I have two raster layers.
(A) is state-sized, 30m.
(B) is county-sized, 3m.
I'd like to get a new raster (C) which is the part of (A) which coincides with (B), preferably scaled to the same ...
2
votes
2
answers
2k
views
GDAL Clipping (hack)
I am trying to use the python script from http://www.sparkgeo.com/labs/2010/07/07/gdal-clipping-hack/ to clip a raster based on many shapefiles. The script is using a mysql database an i would like to ...
2
votes
1
answer
3k
views
Choose what zoomlevel to read from for mbtiles file in GDAL
GDAL is supposed to read MBTiles files and to do so, it selects the highest zoomlevel available. However, is there a way to choose another zoomlevel? i.e. override the default and go for a lower one?
...
2
votes
0
answers
527
views
Preserve GCP's after gdalwarp
I'm trying to figure out how I can preserve my GCP's after a gdalwarp. I need the georeferenced GCP's data, so I can calculate the Root Mean Squared Error.
Is there a way to preserve this data, and ...
2
votes
3
answers
2k
views
Convert .tiff data to bitmap just when rendering and at runtime by visualC++ code
I need to convert a .tiff image to a bitmap one without saving the bitmap. I know that I should use GDAL_translate but because I'm new, this function's interface is a little complicated for me. Could ...
2
votes
0
answers
2k
views
Use GDAL/Python to add rasters (tiff) to an ESRI File Geodatabase
I'm using GDAL python to create a bunch of tiff files from a netcdf file.
def modelout_to_geotif(netcdfile, outdir, VarName):
""" Given the path to the netcdf output,
produces geotiffs for ...
2
votes
3
answers
4k
views
Removing z & m coordinates from KML files [closed]
I've recently received some parcel data in shapefile format that has z & m coordinates (all = 0.0). The WKT for a typical parcel looks like this:
"MULTIPOLYGON (((2672464.560700002 711396....
2
votes
1
answer
407
views
file geodatabase api on osx mavericks via brewed gdal
I've got a new machine with a fresh install of OSX 10.9, and am having trouble getting esri's file geodatabase api to work correctly with my brewed gdal.
This is a known issue, noted here:
http://...
2
votes
1
answer
716
views
gdal2tiles.py generating black tiles from .img file
I have a source HFA Erdas Imagine (.img) file which I'm trying to convert into tiles using gdal2tiles.py. I'm running:
gdal2tiles.py -w google -g GOOGLEKEY input_file.img
The HTML is generated ...
2
votes
2
answers
4k
views
Python - GDAL : Polygon to point shapefile
I want to read all the points in a polygon shapefile and use their coordinates to make a new point shapefile, then find the min and max of the X coordinates. So here is the code I wrote for the first ...
2
votes
1
answer
2k
views
Python and GDAL: NoneType error while reading shapefile
I am a newbie to GDAL. I have a shapefile of Britain which I want to rasterize. This file can be obtained from here selecting United Kingdom as Country and Administrative areas as Subject.
Following ...
2
votes
1
answer
5k
views
ValueError: array larger than output file, or offset off edge Python GDAL
I have been working on this iterator that would count instances where data conformed to a set of conditions over a number of rasters. I had people help me with other aspects of this script (Counting ...
2
votes
2
answers
5k
views
Python/GDAL--Handling Big Rasters and avoid MemoryErrors?
I am using python 2.7.10.
I am trying to read a big Raster with gdal and numpy array.
But it show In MemoreErrors when i use this:
band. ReadAsArray()
Note: this error occurs when input raster is ...
2
votes
2
answers
9k
views
ImportError: DLL load failed with error code when I try to import GDAL from the Python console
I've installed GDAL from the wheel files available here on Python 3.4. I'm using an old version of Python because one of the packages I need doesn't work yet on Python 3.6.
When I try to import gdal ...
2
votes
1
answer
3k
views
ERROR 4: Unable to open EPSG support file with gdal warp?
I'm trying to clip a raster with a polygon layer containing multiple features. To achieve my goal I'm trying to execute those commands lines on a batch file :
C:
cd C:\Program Files\QGIS 2.18\bin
...
2
votes
7
answers
18k
views
Install GDAL Python binding on mac
When I try to install gdal (on OSX 10.11.6) with pip install gdal (or easy_install) the installation fails with following error
extensions/gdal_wrap.cpp:3085:10: fatal error: 'cpl_port.h' file not ...
2
votes
1
answer
8k
views
Extract time series values from a 3D (lon,lat,time) NetCDF file using Python
I want to extract time series from a variable in a 3D (lon,lat,time) netcdf file at specific lon/lat points. The raster is a nc file where:
cell: 1.5°×1.5°
time step: 1 month
lat extension: (0.75,89....
2
votes
0
answers
103
views
QGIS 2.18: Error in NUMPY and GDAL 2.1 [duplicate]
I recently upgraded to Ubuntu 16.0 and installed QGIS 2.18. As I tried it, this error came:
ERROR 1: NUMPY driver was compiled against GDAL 2.1 but current library version is 1.11
Segmentation fault ...
2
votes
2
answers
4k
views
OGR Filter Vector Layer by a List of Feature ID's
I often use GDAL/OGR via their python bindings.
I know of the very useful ogr.Layer.SetAttributeFilter() command. However I am hoping to filter by feature ID's, rather than attributes. Also, I don't ...
2
votes
2
answers
4k
views
Rotate raster (asc) by degree in QGIS
my plugin creates an ASC file that I can load in QGIS as raster.
Sometimes I need to load the raster with an additional rotation.
The only solution I can think is to warp the raster by a custom ...
2
votes
0
answers
824
views
JPEG2000 Image Mosaic with GeoServer
Using GeoServer 2.8.4, I have been successful at creating JPEG2000 image mosaics with OpenJDK 1.7.0. I use the gdal plugin and jp2k plugin and JPEG2000 images are loaded with Kakadu. I explicitly set ...
2
votes
0
answers
2k
views
Create map (image) from raster and vector in Python - problem with big files
I wrote function which allows me to plot raster and (optionally) plot vector on the same image.
It works for small files, but in case of big rasters, I receive memmory error.
I've tried to add ...
2
votes
3
answers
3k
views
Removing black pixels of georeferenced image without affecting interior pixels using GDAL?
I am looking for an algorithm or function in GDAL that can remove black pixels out of image boundaries. Note that I've tried gdal_fillnodata (gdal.FillNoData) and the result was good in most cases; ...
2
votes
0
answers
655
views
Georeferencer on QGIS3 missing? [duplicate]
I'm not finding Georeferencer on QGIS3. In version QGIS2 it was found under Raster > Georeferencer > Georeferencer (the only option available).
Forgot to say I'm on a Mac using the http://www....
2
votes
1
answer
3k
views
Python, creating layers and rasterizing polygons in GDAL
Trying to figure out how to rasterize in GDAL.
I have two problems (see example code below):
1) Even creating the raster layer with the gdal.GDT_Float32 type option, the resulting layer ('s bands) ...
2
votes
1
answer
4k
views
GDAL Changing Values
For context I am working with a .tif file that I have warped and changed all nodata values to -9999.
Is there any way with GDAL to take all values from this .tif file that are greater than -9999 and ...
2
votes
1
answer
771
views
How to unzip .gz files via gdal?
I have a lot of .gz files that contain imagery and I'm going to unzip them.
I was wondering if that could be done via GDAL.
2
votes
1
answer
2k
views
Converting GeoTIFF with GCPs into PROJCS with python/GDAL?
I have some data with the following projected coordinate system (obtained via gdalinfo)
PROJCS["WGS 84 / UTM zone 11N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298....
2
votes
2
answers
2k
views
How can I pass geotransform to gdalwarp to handle ungeoreferenced image as georeferenced
I'm trying to read ROIs from Landsat-8 overview using GDAL /vsicurl/ , but the image is ungeoreferenced. I have geotransform from full size image, which I can copy. Is there a way to pass geotransform ...
2
votes
1
answer
798
views
Channel swap when reading created image with Gdal
I use a function on python (3.5) to create GTIFF with GDAL:
def array2raster2(fname, matriz, geot, proj):
drv = gdal.GetDriverByName("GTiff")
dst_ds = drv.Create(fname, matriz.shape[1], ...
2
votes
1
answer
3k
views
In gdal how to save 3 dimensional array as stacked raster image?
I have constructed a 3-dimensional numpy array by stacking multiple 2-dimentional rasters.
>>> print arr_list_stack.shape
(30L, 370L, 400L)
As the arr_list_stack.shape shows that this 3-...
2
votes
2
answers
1k
views
Extract corner coordinates of polygon extent in PyQGIS / GDAL
My goal is to extract corner coordinates (i.e. UpperLeft, UpperRight, LowerRight, LowerLeft) from polygon extent using PyQGIS or GDAL.
In ArcPy there is a handy property of an extent class (i.e. ...
2
votes
1
answer
1k
views
Tiled Map Service (TMS) in QGIS not showing highest resolution?
I've added a Tiled Map Service (TMS) in QGIS, but when i try and look at the highest zoom levels, the highest resolution I can see is level 19. When I add the service as a WMS, I can get the full ...
2
votes
1
answer
4k
views
Set raster metadata in gdal and view in GIS software
Using gdal, where (and how) do I store raster metadata so that it can be viewed in ArcGIS (or similar)?
Gdal datasources and raster band objects have the methods SetMetadata and GetMetadata. These ...
2
votes
2
answers
1k
views
Mapbox Studio for macOS renders GeoTiff into webp with black background - suggestions?
We are converting a 11 MB GeoTiff, 324511630_Descanso_FSTopo.tif,
to post to Mapbox, using Mapbox Studio Classic macOS.
The issue is when the Mapbox tileset is posted in Mapbox.com/studio, there is a ...