Questions tagged [gdal-contour]

Command line utility to generate vector contour lines from a raster elevation model.

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

Improving use of QGIS GDAL Contour Polygon function

I'm trying to extract vector contour polygons from a DEM, but it always takes a long time. While the Line function can finish the DEM in an hour at most, with the same parameters, the Polygon function ...
8 votes
1 answer
398 views

Avoiding too curly contours in QGIS

I had point data in DXF and generated contours using QGIS. The contours had smaller islands and the contours in itself are too curly. I smoothed the contours too and I could avoid that unwanted island ...
  • 105
1 vote
1 answer
86 views

Flipped Contour Polygons from GDAL

UPDATE # 01 : Links to related past questions: Mirrored Contours from DEM in QGIS gdal_translate creates images that are mirrored This question has been asked before, but I can't fix my personal ...
2 votes
1 answer
568 views

Why is QGIS contour generating tool not working with my DEM tiff file?

First a note about previous data processing. My original data (from a LIDAR scan) is a text .asc file with the internal structure looking like this: 457758.77;110272.34;353.89 457758.77;110273.34;353....
  • 123
1 vote
1 answer
174 views

Batch Processing Contour Lines in QGIS

I'm trying to create contour lines at 40 meter intervals from 60 different DEM Contour Shaded files. Rather than doing them 1 by 1 I have tried using the batch process but I don't get any results as I ...
0 votes
0 answers
359 views

gdal_contour: Specifying index contour lines

I'm building an application where I need to programmatically generate contour lines(and export to a .dxf) from a raster terrain data-set(DTM specifically). What I've tried: Using gdal_contour, I've ...
  • 101
3 votes
1 answer
259 views

Creating Contours from Raster using PyQGIS

I am trying to create contours from a raster layer I have loaded in my QGIS project as below using gdal from qgis.core import QgsProject import processing ## QgsVectorLayer('Coordinate','Layer name','...
3 votes
1 answer
204 views

Generating vector slope maps using GDAL

I have a DEM file that I created a slope map of using gdaldem slope. This works fine and if I view and colorize it, I can now see how steep a hill is but now I'd love to create a shapefile out of that....
  • 971
1 vote
0 answers
160 views

GDAL warp & GDAL contour inconsistent results

I am creating 2 output contours based on the same input DEM, one is clipped to a smaller grid feature (green line) while the other is clipped to a larger irregular polygon (blue line). The problem is ...
  • 547
1 vote
1 answer
86 views

No Option to 'Extract' under 'Raster' tab

So I'm running an earlier version of QGIS (3.4.6, as it is supposed to be more stable I'm told) for a Field Geology course, however after installing it and adding DEM data I am unable to 'Extract>...
  • 11
2 votes
2 answers
567 views

Error exporting contour lines from Google Earth Engine

I would like to export these contour lines as .SHP but GEE says that variable collection must be a FeatureCollection. Here is the complete code
2 votes
0 answers
264 views

Using of ContourGenerate in PyQGIS

Can anyone help explain me how to use the ContourGenerate method of GDAL. The official documentation states two sets of arguments for the method, with one being ContourGenerate ( **args, ***kwargs ) ...
5 votes
3 answers
1k views

QGIS alternatives to GDAL contours to polygons

I have Windows 7 running 3.10.2-A Coruña. The only success I have had in creating nested polygons from a raster dataset is using GDAL with -p to create polygons. However, I recently cancelled the ...
2 votes
1 answer
149 views

Batch import of DEM tiles (with shapefiles) into PostGIS creates non continuous contour lines

I want to import a large amount of ASTER DEM data into PostGIS (covering Europe). I use this script: https://wiki.openstreetmap.org/wiki/Contour_relief_maps_using_mapnik#Importing_ASTER_GDEMv2_data ...
  • 53
2 votes
1 answer
731 views

Extracting contours as shapefile from DTM (tif) in QGIS?

I am looking to convert a tif. file from the Scottish Remote Sensing Portal (Scottish LiDAR) into contours which can be used for a surface in civils 3D. I have tried this myself with a full DTM and a ...
2 votes
1 answer
383 views

QGIS gdal_contour not respecting scale_factor/offset for netCDF

I am working with some netCDF files and want to import netCDF parameter's data as a Raster and build a contour layer for it. I am using gdal_contour for this. When I import the netCDF and choose a ...
1 vote
2 answers
319 views

Split long lines in PostGIS

I would like to render contours using Mapnik. The problem is that some contours are very long which makes rendering too slow and so I decided to spling long contours to multiple smaller segments. ...
2 votes
2 answers
204 views

How to use gdal_contour to APPEND data?

I'm trying to import contours from SRTM HGT files. First try (nice): gdal_contour -f PostgreSQL -a elevation -i 10 srtm/S01W069.hgt "PG:host=volcano-db user=postgres password=guesswhat dbname=...
  • 1,900
1 vote
1 answer
465 views

File not found error using Contour in QGIS 3.4

CSV file load failure in "Contour" procedure, even though the same file will load and display from Layers>Add Layer>. This has not previously been true. The problem could be related to the use of ...
2 votes
0 answers
1k views

Removing contour artifacts from low slope regions

I am generating contour lines from a DEM using QGIS and the python console. The process generates many small circles in regions of low slope (little black circles) that detract from the long connected ...
  • 1,441
0 votes
0 answers
615 views

How could I avoid extracting incorrectly closed contours from a raster with angled sides?

I'm updating a Python script which currently calls gdal_contour as a subprocess to extract contours. I'd like to replace gdal_contour with skimage.find_contours. However the output of the GDAL script ...
2 votes
1 answer
306 views

Correctly scale topographic SRTM data in OSM

I am trying to create contour maps in OSM with scales of 1:50,000 and 1:250,000 using 30-meter NASA SRTM data from here. Examples of what I'm trying to achieve can be seen on LINZ NZ Contours 1:50k ...
4 votes
2 answers
5k views

How can I extract contours from a raster with Python?

I currently run gdal_contour as a Python subprocess to extract contours from a raster file, but would like to achieve the same function with a combination of Rasterio, Shapely and Fiona. However, ...
0 votes
0 answers
140 views

How to cut contour lines at coast line?

I have successful created a shapefile from an island with contours by downloading the data from http://srtm.csi.cgiar.org, converted it with gdal and imported it in TileMill. Everything is working ...
  • 101
8 votes
0 answers
518 views

GDAL contour line generation at DEM edges

In a Python application I use gdal.ContourGenerate() to generate contour lines (GDAL version 1.11.4 and 2.2.1) from DTED tiles. DTED tiles overlap at the top and the right with neighboring tiles. ...
  • 4,520
3 votes
1 answer
2k views

Calling Gdal contour from python/ipython

Hello I am trying to patch process a folder full of ASCs to contours using Gdal from python. here is my code; import os import glob PATH1 = raw_input("folder containing ASCs path please:") ...
3 votes
0 answers
192 views

gdal_translate bilevel tiff output

I have a geotiff image that rings in at about 290MB. However, once I smooth it using a gaussian filter I'm unable to get it back to that size, it ends up being 1720MB. The size isn't really the ...
  • 41
1 vote
0 answers
290 views

How can I render heatmap contours from QGIS into tiles?

I have a heatmap and contours in QGIS, and I want to export these heatmaps as tiles. This works well with tiff, but I want to include contours into images, to make them look better. In QGIS, I can ...
  • 2,314
1 vote
1 answer
963 views

Grid-type shapefile from raster GeoTIFF

I need to produce a shapefile from a raster. I need to be able to specify either an interval, or manually define the intervals. The input file is a GeoTIFF. I would like to use GDAL and/or Python. ...
  • 13
1 vote
1 answer
183 views

How to cut contour lines at the edge of a data source

I have calculated some contour-lines using gdal-contour for two elevation model into a Postgis database. One is high res and the other lower res. Now I am seeing problems at the edge of my high ...
  • 971
1 vote
1 answer
368 views

gdal_contour is missing lines below a certain elevation

I have a very strange problem with gdal_contour. I have a very large GeoTif of Europe and would like to generate contour-lines for that region. Everything worked fine when I had lines every 25m but ...
  • 971
1 vote
1 answer
2k views

Convert .xyz to contours?

Can anyone help me convert .xyz file to a contours? I have recieved some .xyz files from the local council and am hoping to turn them into a terrain for 3d modelling. I have tried the ASCII to feature ...
6 votes
1 answer
786 views

Merging GeoTiffs with GDAL causes grid-like artifacts?

I'm processing ASTER DEM tiles, merging them into larger blocks (to minimize visible tile edges) and importing the contours into a postgis database. Workflow: gdal_merge.py -of GTiff -o merged.tif ...
5 votes
1 answer
495 views

artifacts in SRTM contour layers processed with GDAL tools and rendered with mapnik?

Here is my workflow for importing individual SRTM tiles into postgis using the GDAL utils and rendering a png using mapnik: gdal_fillnodata.py -srcnodata -32768 gdal_contour -i 10 -a ele -snodata -...
2 votes
2 answers
563 views

QGIS Contour plugin: Creating complex isolines leads to isolated areas

I use the contour plugin (v1.1) within QGIS 2.4 to create contour lines. I have streets with different travel costs. I observe problems for streets with low travel costs if they are surrounded by ...
  • 371
5 votes
2 answers
652 views

Optimize Tilemill export of project with contour-lines (and fix out of memory problems)

I have a project in Tilemill (based on OSM-Bright) that covers Europe and also displays Contour-Lines. My problem is that the performance of Tilemill is pretty bad when displaying the contour lines ...
  • 971
1 vote
1 answer
123 views

gdalcontour output not aligned with the DEM

I use gdalcontour to generate the contour lines of a DEM in shapefile format. However the shapefile is not aligned with the DEM. Someone have a solution for this? GDAL version is 1.10 im using thins ...
4 votes
1 answer
359 views

Suggestions for vector format for contour map

I've been trying to create a contour map of a DEM and I've been running into some technical problems. I want to avoid artifacts, so I'm using a DEM of the entire area. This means the size is rather ...