Questions tagged [gdal]

GDAL (Geospatial Data Abstraction Library) is a library for reading and writing raster geospatial data formats.

GDAL (Geospatial Data Abstraction Library) is a library for reading and writing raster geospatial data formats.

2184 questions
8
votes
2 answers

How can I change the resolution of a raster using GDAL?

I am looking for the best way to change the resolution of a GDAL raster dataset. For example, I have a raster that has a pixel size of (30, -30), and I would like to change the pixel size to (5, -5), interpolating all values for a given pixel into…
James
  • 1,485
  • 2
  • 16
  • 21
8
votes
3 answers

Error building pygdal: Unknown distribution option: 'use_2to3_fixers' and 'use_2to3_exclude_fixers'

Solution provided below: Started getting errors when building pygdal on Ubuntu 20.04: # Command python3 -m pip install --no-cache-dir pygdal==3.0.4.* produces the following output Collecting pygdal==3.0.4.* Downloading pygdal-3.0.4.6.tar.gz (458…
ChrisSc
  • 276
  • 2
  • 9
8
votes
1 answer

How to install gdal with 'pipenv install' using CFLAGS and CXXFLAGS

If I mention "gdal = '2.2.3'" in the Pipfile and launch the instruction pipenv install, the install fails. If I launch the instruction CFLAGS="-I /usr/include/gdal" CXXFLAGS="-I /usr/include/gdal" pipenv install GDAL==2.2.3 the install succeed. Is…
8
votes
1 answer

rasterio and gdal DLL load fail in PyCharm

I have a conda environment with rasterio installed and a whole load of other libraries, including gdal. When I do: import rasterio on jupyter notebook, it loads fine and I can utilise it's methods etc.. When I do exactly the same thing on PyCharm,…
arsenal88
  • 1,040
  • 2
  • 15
  • 32
8
votes
2 answers

Interpolated results from gdallocationinfo?

This: gdallocationinfo -valonly -wgs84 file longitude latitude provides the value from the file at the resolved pixel. Is there a gdal function that can provide an interpolated value from the neighbouring pixels? For example these calls read…
Simon Nuttall
  • 394
  • 1
  • 3
  • 12
8
votes
1 answer

How to find the number of bands in gdal in python?

i'm read tiff data using under code. ds = 'path' , gdal.GA_ReadOnly) and i find gdal API, i cna't find to read number of bands. (ex) i have a 3 bands image, then read number of bands and return 3 in case) is a any way to find number of bands?
송준석
  • 991
  • 1
  • 16
  • 32
8
votes
5 answers

Configure error in rgdal "gdal-config"

I am currently running some species distribution modelling and richness mapping in R on a linux cluster. In order to run my analyses I need to install rgdal so that the raster function in my modelling package works correctly. I have installed proj4…
8
votes
3 answers

Cropping a raster file using GDAL w/ Python

EDIT: PARTIAL SOLUTION Using gdal_translate in the command line seems to do the trick, even though the Python binding doesn't work. This worked to crop a GeoTiff removing 300 pixel padding from top and left and keeping the next 2000x2000 pixels.…
PAL
  • 81
  • 1
  • 1
  • 4
8
votes
2 answers

Dissolve Overlapping Polygons (with GDAL/OGR) while keeping non-connected results distinct

Is there any way to dissolve (merge) overlapping polygons, using any GDAL/OGR API or command line tool, while keeping the resulting non overlapping areas distinct? I have searched a lot and I cannot find anything resembling what need. However, I…
StarSheriff
  • 1,477
  • 2
  • 17
  • 23
8
votes
4 answers

Installing gdal-config on my linux

I search the entire net could not find a guide to get gdal-config. I have yum but yum does not have gdal-config, i already installed gdal. I just need to be able to do this on shell - gdal-config and not get a command not found error. My distro is…
David
  • 4,235
  • 12
  • 44
  • 52
8
votes
1 answer

R: how to write a raster to disk without auxiliary file?

I'm writing a dataset to file in ERMapper format (.ers) using the Raster package in R, but I'm having issues with the resulting .aux.xml auxiliary file (which I'm actually not interested in). Simple example: rst <-…
dsp542
  • 83
  • 3
8
votes
1 answer

Django SerializerDoesNotExist 'geojson'?

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…
Groovietunes
  • 633
  • 1
  • 9
  • 17
8
votes
1 answer

cant connect to postgres with GDAL ogr2ogr remotely

I am trying to insert a shapefile into PostgreSQL via Gdal ogr2ogr, the command looks like this: ogr2ogr -f 'PostgreSQL' PG:dbname='dbname',user='user',host='172.17.2.176',password='password',port='5432' shapefile -nln 'cities' However, ogr2ogr…
Marcus Ruddick
  • 9,795
  • 7
  • 28
  • 43
8
votes
3 answers

Python GDAL: pip install --no-install GDAL fails

I am trying to install GDAL in virtual environment based on the various solutions out there. However the download itself already fails: $ pip install --no-install GDAL Here is the…
ustroetz
  • 5,802
  • 16
  • 47
  • 74
8
votes
7 answers

Encoding problems with ogr2ogr and Postgis/PostgreSQL database

In our organization, we handle GIS content in different file formats. I need to put these files into a PostGIS database, and that is done using ogr2ogr. The problem is, that the database is UTF8 encoded, and the files might have a different…
Chau
  • 5,540
  • 9
  • 65
  • 95