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
1answer
54 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
0answers
49 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 ...
3
votes
1answer
90 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
1answer
93 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....
0
votes
0answers
29 views

GDAL transform DTED to contour KML : gdal_contour coordinates are swapped in KML file

Using GDAL 3.1.3 (installed using Anaconda) command line tools, I'm trying to convert a DTED file to KML contours. gdal_contour -f KML -i 250 e068n36.dt1 e068n36.kml However, the KML file is wrong ...
1
vote
0answers
62 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 ...
1
vote
1answer
40 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>...
2
votes
2answers
339 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
0answers
114 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 ) ...
4
votes
3answers
831 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
1answer
111 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 ...
2
votes
1answer
344 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 ...
0
votes
1answer
233 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
2answers
217 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. ...
1
vote
2answers
122 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
vote
1answer
263 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
0answers
929 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 ...
0
votes
0answers
488 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
1answer
231 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 ...
3
votes
2answers
4k 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
0answers
105 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 ...
7
votes
0answers
411 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. ...
3
votes
1answer
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
0answers
166 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 ...
1
vote
0answers
260 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 ...
1
vote
1answer
867 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. ...
1
vote
1answer
158 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 ...
1
vote
1answer
320 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 ...
1
vote
1answer
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
1answer
705 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
1answer
442 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
2answers
513 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 ...
5
votes
2answers
618 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 ...
1
vote
1answer
112 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
1answer
340 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 ...