Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
4 votes
5 answers
5k views

Get vector features inside a specific extent

The problem: I have a very large vector layer with many features and a much smaller raster layer in a defined region. I want to get only those vector features which are within the raster layers ...
Curlew's user avatar
  • 8,180
4 votes
2 answers
2k views

ogr2ogr can't append shapefile to existing Postgres table

Using ogr2ogr within python (and Windows 10), I can upload a shapefile to Postgres as a new table. However, my shapefile is made of 10 parts (10 shapefiles). I can upload the first .shp but when ...
Theo F's user avatar
  • 1,859
4 votes
5 answers
7k views

Proper gdaltransform syntax to transform a list of coordinates?

this is probably a very simple question, but I'm very new to GIS so I just need one last nudge. I've got a sense of the Linux utility gdaltransform and I am feeding it coordinate pairs in line-by-...
Adam Friedman's user avatar
4 votes
3 answers
3k views

Installing gdal in CentOS without Root?

I have been struggling to get python setup to do some image processing, so I really need the http://www.gdal.org/ GDAL libraries installed on CentOS 6.5. I want to install the package in a local ...
jakebrinkmann's user avatar
4 votes
2 answers
3k views

Gdal Python Bindings and File Geodatabase API

I'm trying to get python 2.7 to work with GDAL/OGR and an ESRI file geodatabase. There have been a few similar questions asked but the answers don't fully resolve my situation. I have installed the ...
user19466's user avatar
  • 111
4 votes
1 answer
1k views

GDAL Rasterize with "where" option in Python

I've got a shapefile with set of points with a column "test_class" of String type in the attribute table. I need to rasterize these points with setting pixel's value for each class and ...
rybomar's user avatar
  • 43
4 votes
1 answer
1k views

Does gdal_calc only support 26 input raster files at a time?

In gdal_calc.py, input files are specified with letters A-Z. Here are two files, input.tif and input2.tif, being averaged into result.tif: gdal_calc.py -A input.tif -B input2.tif --outfile=result....
Martin Burch's user avatar
4 votes
1 answer
2k views

Grid registration issue converting from GeoTIFF to Esri ASCII Raster format?

I've got a 3 arc second digital terrain model represented as a 32-bit GeoTIFF that looks like this: $ gdal_info gom03_v1_0.tif Driver: GTiff/GeoTIFF Files: gom03_v1_0.tif Size is 10200, 7800 ...
Rich Signell's user avatar
  • 2,272
4 votes
1 answer
2k views

Changing projection from 0 360 to -180 180 for a simple raster

I'm trying to convert a raster with projections of (0, 360) to (-180, 180), and I've tried various SO solutions such as this, but it gave me a cropped output that doesn't have the western hemisphere. ...
Ali Abbas's user avatar
4 votes
1 answer
2k views

Using the C++ GDAL API how do I set the GDAL_DATA path?

If I want to change the directory of the GDAL_DATA path or point to a different version of a csv file for EPSG numbers how do I do that using the C++ API?
David's user avatar
  • 183
4 votes
2 answers
21k views

gdal_rasterize error: "attempt to create 0x0 dataset is illegal.."

I'm trying to use gdal_rasterize to convert a polygon shapefile into a raster, where the value comes from the 'COVTYPE' attribute. I try calling gdal rasterize like so (I'm calling from within a ...
user20408's user avatar
  • 1,545
4 votes
0 answers
194 views

Using an input string in a file path for a input vector layer in QGIS model

I am building a QGIS model to perform field calculations on a large number of .shp files containing environmental information of different waterbodies. This model should be global for the different ...
Leesbiology's user avatar
4 votes
1 answer
467 views

What is the gdal_translate scale exponent option for?

gdal_translate has the option -exponent <exp_val> to use in conjunction with -scale that will apply non-linear scaling with a power function. exp_val is the exponent of the power function (must ...
matt wilkie's user avatar
  • 28.3k
4 votes
2 answers
2k views

ogr2ogr MSSQL BCP import failing with "connection not enabled for BCP"

I am trying to import a plain text file with approx. 8Mio rows without geometry into SQL Server 2016 via the following ogr2ogr command ogr2ogr -progress -append -nln dgi.te_import -f MSSQLSpatial &...
Jürgen Zornig's user avatar
4 votes
2 answers
1k views

GDAL_merge - Stacking Files - Nodata Value wrong

I masked a large raster stack by separating the stack in 18 chunks, masking each and writing each chunk to a file (due to memory problems). Then, I use gdal_merge to stack the 18 GTiff files. All ...
bask0's user avatar
  • 143
4 votes
1 answer
2k views

How to make 'gdalUtils' package in R to use GDAL installed in OSGeo's directory instead of QGIS's directory

I have GDAL installed through QGIS and OSGeo in the directories: C:\Program Files\QGIS 3.6\bin\gdalinfo.exe C:\OSGeo4W64\bin\gdalinfo.exe My gdalUtils package uses GDAL installed in QGIS and I want ...
BetterCallMe's user avatar
4 votes
1 answer
3k views

QGIS 2.0 Plugin error: Unable to load GdalTools plugin?

I just used the osgeo4w exe to install QGIS and all the other software included in the basic setup. When I open QGIS, I get the following error: Plugin error Unable to load GdalTools plugin. The ...
ianbroad's user avatar
  • 9,141
4 votes
4 answers
4k views

How to save raster with projection into Python

I applied a raster processing that is already in a known coordinate system with this code, import cv2 import numpy as np from matplotlib import pyplot as src img = cv2.imread(r'E:\2_PROJETS_DISK_E\...
hamza's user avatar
  • 61
4 votes
2 answers
2k views

Can GDAL extract a raster window from disk without loading the whole file to memory?

I have a 500MB GeoTIFF with 3 bands on disk. I can easily read a very small, 25x25-pixel subwindow using GDAL like so: gdal_translate -srcwin 600 550 25 25 hugeimage.tif smallwindow.tif Does this ...
Jeff G's user avatar
  • 399
4 votes
1 answer
2k views

Clip and copy files to same directory structure using OGR/GDAL with Python

We need to clip all our data (many TB) by a new boundary and save it while maintaining the same data structure. I want to use OGR/GDAL as the data is in shp/tab/kml/geoTif/ecw etc. I can find the ...
GeorgeC's user avatar
  • 8,298
4 votes
2 answers
683 views

Clip raster by mask layer returns error "wrong number of parameters"

Using Python for QGIS 2.14 Essen i try to clip a raster by a Polygon, as indicated here: http://docs.qgis.org/2.6/de/docs/user_manual/processing_algs/gdalogr/gdal_extraction/cliprasterbymasklayer.html ...
Philipp Dahlem's user avatar
4 votes
1 answer
1k views

How to write a single pixel or a line of pixels to GeoTIFF using GDAL/Python

Let's say I want to write a single pixel or a 1D array of pixels (e.g.all at the same latitude) of pixels to a single-band of a Float32 GeoTIFF using the Python GDAL bindings. How can I do so? Or is ...
ksed's user avatar
  • 213
4 votes
1 answer
3k views

How to create dataset in python with creation options like in ogr2ogr with -dsco options

In ogr2ogr there is dsco option (data source creation option). e.g. ogr2ogr -f DXF -dsco trailer=trailer_buildings.dxf -dsco header=header_buildings.dxf out.dxf test_buldings_shp.shp. It works well, ...
Dmitriy Litvinov's user avatar
4 votes
1 answer
1k views

Merge overlapping DEMs with irregular boundaries

I have a 10m DEM covering part of a state, a 20m DEM covering the whole state, and a 90m DEM covering the whole country. How can I merge them together, getting the best quality available in each area? ...
Steve Bennett's user avatar
4 votes
3 answers
2k views

DXF to georeferenced SHP

I know how to set projection and georeference bounds of scanned TIFF file, by using gdal, but I don't know how to do the same for vector file. For example I georeferenced TIFF file by using this ...
zetah's user avatar
  • 843
4 votes
1 answer
969 views

OGR - Weird GeomType -2147483645 on polygon shapefile

I am trying to import a shapefile (multipolygon) in an app with ogr but I got an error about invalid geom type. If I inspect the data with ogr like this: datasource = ogr.Open("c:\\temp\\data.shp") ...
Below the Radar's user avatar
4 votes
1 answer
2k views

gdal_merge not working in GDAL 201 windows install

I realise this looks like a duplicate of https://stackoverflow.com/questions/31174320/gdal-merge-py-not-working-after-gdal-and-it-python-bindings-have-been-installed, but I think the problem is a bit ...
Freeze's user avatar
  • 694
3 votes
2 answers
554 views

Aerial imagery showing in different colour while pan/zoom GeoServer

I have image/tiff files of a small aerial imagery. I published it under ImageMosaic plugin (GDAL plugin installed), but when I pan or zoom the map in OpenLayers preview I am getting different colour ...
Anas A's user avatar
  • 171
3 votes
2 answers
690 views

Geodetic transformation with Mars data: 'ographic to 'ocentric latitude

Introduction I am working with a few raster datasets covering the south polar region of Mars. Some use a coordinate system with aerographic latitudes, which are equivalent in concept to geodetic ...
Sam's user avatar
  • 51
3 votes
1 answer
2k views

Where is official documentation of gdal/ogr?

Where can I find the official docs for gdal/ogr python API? I am looking for something comprehensive which shows all the classes with descriptions of their attributes, methods and input/output types....
user32882's user avatar
  • 3,574
3 votes
1 answer
819 views

GeoTIFF is stretched sideway when translating CRS to EPSG:4326 from EPSG:32654

I want to convert a GeoTIFF's coordinate reference system to EPSG:4326 from EPSG:32654. But the output image is stretched to the side. I have tried two different methods (gdalwarp and rasterio), but ...
satsuki's user avatar
  • 41
3 votes
1 answer
2k views

ogrinfo - specify what information you want returned

I am using ogrinfo to find out information about a shapefile ogrinfo -so -al 'C:/test/test_shapefile.shp' This obviously gives me a large summary, but I'm wondering is there any way to specify that I ...
fuzzy_raster9873's user avatar
3 votes
1 answer
2k views

gdalwarp from epsg:4326 to epsg:3413; error: Too many points failed to transform, unable to compute output bounds

GDAL ver     : GDAL 3.1.1, released 2020/06/22 Python         : 3.8.0 OS:               : windows 10 Input file       : 7200 x 3600 GeoTIF in epsg:4326 File link        : [https://www.dropbox.com/s/...
PDash's user avatar
  • 383
3 votes
3 answers
15k views

Convert Lambert Conformal Conic to WGS84

I am trying to convert my "Lambert Conformal Conic map with 2 standard parallels" to the basic/standard WGS84 projection that Google Maps use. I have 30 of these maps which I need to convert. They ...
Pangolin's user avatar
  • 139
3 votes
1 answer
3k views

Determining the Unit of Spatial Resolution of a raster image in Python

I have some raster images, and I would like to determine the GSD using Python. I know that I can use rasterio.transform() or gdal.GetGeoTransform() to extract the spatial resolution of the image. ...
A Merii's user avatar
  • 143
3 votes
1 answer
839 views

Cropping raster file with GDAL warp C++ API

I need to crop a DEM raster file with a shapefile. This shapefile has many polygons. I need to calculate several variables after the crop operation. The algorithm is written in C++ so I want to call ...
Chang's user avatar
  • 310
3 votes
1 answer
727 views

ogr2ogr too many GCP points - exceeds maximum number of characters in the command line

I am trying to adjust a vector polygon dataset using ogr2ogr spline transformation with cmd commands like: C:\\OSGeo4W64\\bin\\ogr2ogr.exe -f "ESRI Shapefile" C:\\path\\output.shp -order 3 -tps -gcp ...
nadya's user avatar
  • 2,491
3 votes
1 answer
2k views

gdal_grid problem reading vrt file

I am trying to parse csv file and visualize it as geotiff using gdal_grid but I keep getting this error: C:\work\testgdal1>gdal_grid -ot Float32 -l test test.vrt dona.tif ERROR 1: Failed to ...
Lydon Ch's user avatar
  • 511
3 votes
2 answers
7k views

Hyperlink relative paths to files in points layer in QGIS?

I would like to add hyperlinks to each point in a points layer in QGIS 1.7.0 running on Mac OS X 10.6.7, but I have several requirements: (1) Each hyperlink has to be a relative path to the linked ...
hpy's user avatar
  • 3,195
3 votes
2 answers
5k views

Get extent of Georeferenced Rasters in Python and output to polygon shapefile

I would like to create a shapefile containing the extents of each of the rasters in a directory. Is it possible to capture the extent of a raster using Python? I have tried extent1=...
GeorgeC's user avatar
  • 8,298
3 votes
1 answer
732 views

Reprojecting MODIS Ice Sea Temperature products with gdalwarp

I have problems projecting MODIS Ice Sea Temperature (IST) products to EPSG:3031 (Antartic Polar Stereographic) using gdalwarp. The product I'm working with is MOD29E1D, documented here, p33: The ...
Pierre's user avatar
  • 308
3 votes
1 answer
17k views

QGIS polygonize error 4 "file does not exist in the file system"?

When I try to convert a raster DEM (in .asc or geotiff format) to polygons I get the error below: ERROR 4: `Y:/GIS/oversvmmelser/tmp/out.tif' does not exist in the file system, and is not ...
HC Haase's user avatar
  • 467
3 votes
1 answer
9k views

Convert polygons in shapefile to a NumPy array?

I have a shapefile containing a number of polygons and all attributes being text. I'm trying to import the polygons into NumPy as an array where each polygon is represented as unique values. I ...
brorfred's user avatar
  • 133
3 votes
4 answers
3k views

Rasterizing polygons in shapefile using GDAL

I have the following polygons shapefile consisting of polygons of the five boroughs of New York City from "NYC Open Data", linked here: https://data.cityofnewyork.us/City-Government/Borough-...
LostinSpatialAnalysis's user avatar
3 votes
1 answer
748 views

How to close open files after processing.runalg() command (Qgis: Error No 24)

I'm creating a pyqgis script. In this script I use the processing.runalg command several times. The problem is that these processes are within a for loop. After several iterations, the error number 24 ...
Domenico Fuoco's user avatar
3 votes
2 answers
1k views

GDAL Conversion of US Topo GeoPDFs

I've used GDAL_translate with "--config GDAL_PDF_LAYERS" option to convert US Topo GeoPDFs to GeoTIFF and it works great for creating collarless topos based on the new format. However, I can't get it ...
JRigs's user avatar
  • 31
3 votes
1 answer
2k views

GDAL/OGR ogrinfo for shapefiles in python

This might be a dumb question, but I wasn't able to find the answer anywhere. Reading the metadata of a raster file in Python using GDAL is as easy as: result = str(gdal.Info(raster.tif)) print ...
Iridium's user avatar
  • 229
3 votes
1 answer
1k views

PostGIS ST_Distance in meters discrepancy

Could someone please explain why there is such a significant difference between the results of this query: SELECT ST_Distance(ST_Transform(previous_geom,3857), ST_Transform(current_geom,3857)) ...
Nona Bene's user avatar
3 votes
1 answer
1k views

.prj for NAD_1983_Canada_Atlas_Lambert not recognized correctly

I'm a fairly new user of QGIS and I've run into an issue that I can't seem to solve on my own. I'm trying to work with the NRCan Atlas of Canada Waterbodies SHP file but I'm having an issues re-...
chatty's user avatar
  • 133
3 votes
1 answer
2k views

How to use GDAL from within a Python program

I have a fairly complex Python program that needs to use a single command of GDAL. Currently I'm using os.popen to call the command gdalwarp from Python. This works, but is an ugly approach, so I'd ...
Pythonist's user avatar
  • 389

1
12 13
14
15 16
22