Skip to main content

Questions tagged [pygdal]

Use this tag when referring to alternate version GDAL python bindings, pygdal

Filter by
Sorted by
Tagged with
3 votes
1 answer
656 views

How do I stop gdal.Warp() in Python increasing a raster's extent when clipping to a shapefile with a greater extent

I have a set of GeoTIFFs each covering a subset of a country that I want to clip to the coastline of that country. I have a single shapefile that defines the coastline of the country. As I have a ...
SteveES's user avatar
  • 133
1 vote
1 answer
366 views

How to detect if a binary raster bitmask and a polygon intersect using GDAL?

I am wondering how to efficiently solve the following problem. Given 1 bit georeferenced raster data that represents a bitmask, and a polygon - detect whether the area defined by the polygon covers ...
Alan's user avatar
  • 11
0 votes
1 answer
982 views

GDAL Delete geopackage layer

This seems like it ought to be straightforward: from osgeo import gdal gpkg = gdal.OpenEx('path_to_gpk',gdal.OF_VERBOSE_ERROR,allowed_drivers=['GPKG']) error = gpkg.DeleteLayer(0) After running this ...
Stev_k's user avatar
  • 6,699
3 votes
1 answer
2k views

GDAL polygonize only particular values

I want to polygonize .tiff raster file for specific values. For example, using one method I firstly reclassified the raster by gdal_calc.py --calc="A*logical_and(A>0,A<1)" then used gdal....
Ermek Ermek's user avatar
2 votes
0 answers
1k views

ERROR 6: EPSG PCS/GCS code 102027 not found in EPSG support files

I am trying to insert spatial data from GeoJSON to PostgreSQL database and before it I am to reproject geom from EPSG:4326 to EPSG:102027. When working on Windows there were no problems with CRS, but ...
Jane's user avatar
  • 1,076
4 votes
1 answer
3k views

Writing style information into geopackage with python and GDAL

I managed to generate geopackage with GDAL/OGR Python API using this example from the official website. However, there's no information on how to write style information into the geopackage file. Any ...
Basile's user avatar
  • 3,573
2 votes
1 answer
4k views

Install legacy versions of GDAL with Homebrew

I have installed, on a MacOSX, GDAL2 from homebrew with: brew tap osgeo/osgeo4mac && brew tap --repair brew install gdal2 --with-complete And then the python binding: brew install gdal2-...
Duccio A's user avatar
  • 427
2 votes
1 answer
960 views

Set or change the geometry type of an empty point shapefile using Python with GDAL/OGR

I'm automatically creating a point shapefile from a postgreSQL point table (having a geometry field called "geo" defined as geo geometry(Point,4258)) for a spesific flatenr (%%a) using ogr2ogr --...
9ls1's user avatar
  • 1,427
5 votes
1 answer
681 views

How to Add FileGDB driver to PyGDAL installation

I installed ArcGIS 10.0 and it installed Python 2.6.5 with it. Later, I installed pyGDAL using the windows installer within that Python installation. I cannot find a specific place where GDAL is ...
Brian's user avatar
  • 4,219
3 votes
1 answer
397 views

Problem with precision when convert from WKT to shapefile

I have a problem with converting from WKT to shapefile in pygdal. In wkt I have fields with precision (for example real 7.2). When I create a shapefile I have field numeric with no precision (numeric ...
Charls2012's user avatar