Questions tagged [gdal-python-binding]

A Python package with extensions and tools for programming and manipulating both GDAL (raster) and OGR (vector) data.

Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

GDAL's Python wrappers don't load correct asc header informaton

I have a Python script that I am using to load .asc raster files and then work with the contents therein. However, it isn't loading the correct information that is specified in the headers. The .asc ...
1
vote
1answer
78 views

GDAL Python API - statistics valid percent information

I would like to know if the STATISTICS_VALID_PERCENT (percentage of valid (not nodata) pixels) information is accessible through the GDAL Python API? It seems to be missing from the GetStatistics ...
0
votes
0answers
61 views

ERROR 1: gdal_translate was compiled against GDAL 2.0, but the current library version is 2.2

I have tried to uninstalled both version but failed. both version were installed from source. How can I remove both version or point to 2.0 version.
0
votes
0answers
92 views

gdal.Warp workingType option default

I have been using gdal.Warp() in Python 3.6 for some time now and have just noticed the workingType option (see here for gdal.WarpOptions()). From its definition: workingType --- working type (...
2
votes
2answers
81 views

can't calculate numeric field with ogr python

I have created two functions: one to add a field to a layer and one to calculate a field. I am having issues with the calculate field function when trying to calculate values for a numeric column. I ...
4
votes
1answer
409 views

Compress GTiff External Overviews with GDAL API

Is it possible to build compressed external overviews with the gdal API? I see examples of using gdaladdo with a COMPRESS_OVERVIEW option passed to the configure flag, but I don't see an equivalent in ...
4
votes
1answer
853 views

How to let ogr/gdal CreateLayer() create a `geom` field instead of `wkb_geometry`?

When creating a new table (PostGIS) using OGR/GDAL (2.1+), is there a way to select a specific name for the geometry field (such as geom), rather than using the default name? I created a new table ...
2
votes
1answer
699 views

Can I find the pixels of tiff file for given lat long if I have this information?

Driver: GTiff/GeoTIFF Files: correctly_merged.tif Size is 44835, 26402 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, ...
1
vote
0answers
146 views

Unable to update features in tables without FID: How to use gid field as the FID column with ogr/gdal python?

I'm trying to update a PostGIS table using the SetField() method in python. The table is imported from a shapefile with pgsql2shp so it has a gid field, which can be used as FID or primary key. ...
0
votes
1answer
703 views

Module has no attribute Warp?

I'm using GDAL v2.14 on my Windows 10 machine. In that environment, I have two gdal python bindings. One is import gdal, the other is import osgeo. I installed Python's gdal using http://www.lfd.uci....
4
votes
2answers
543 views

How to merge 2 tile sets?

How to merge 2 overlapping tile sets into one tile set? What gdal utils can be used for that? By tile set I mean folder with tiles produced by gdal2tiles If it matters tiles are in .png format.
0
votes
1answer
562 views

Installing Python bindings for 64-bit Python on Windows

I installed GDAL and its Python bindings from GISInternals. While I believe that GDAL was installed correctly, the Python bindings have an issue. After opening a file with gdal.open I cannot read ...
1
vote
1answer
346 views

Using GDAL's Python Bindings, how can I download an entire Layer?

I'm trying to write a Script, which will download an entire WFS layer to Disk. The output format could be GeoJSON, Spatilite or even Shapefile. I know how to do this using ogr2ogr, but I need to use ...
9
votes
0answers
268 views

Cannot Open VRT of Sentinel2 image created by AutoCreateWarpedVRT

I am trying to create a warped VirtualRaster of a Sentinel2 image. Here the Python code I tried: from osgeo import gdal, osr srs = osr.SpatialReference() srs.SetFromUserInput('EPSG:32632') gdal....
3
votes
2answers
8k views

gdal_merge.py can't find libgdal.so.20

I am having some trouble with GDAL (v2.1-dev). I build it from source today using Poppler and OpenJPEG. All the command line utilities work fine, but none of the Python plugins work at all, ...
1
vote
0answers
508 views

How to build gdal_calc.py from source in MinGW

I was wondering how to build the gdal python binding from source using MinGW. In particular, I need to install python utility scripts such as gdal_calc.py. I've searched around and found this ...