Contour lines generator – contours for any area as DXF or shapefile

Click on the map, choose the size of the area and the contour interval, and the tool draws contour lines from open elevation data and lets you download them as DXF for AutoCAD or other CAD programs, a shapefile, GeoJSON or KML. Each line carries its height. The data is typically 10–30 m resolution, accurate to a few metres where lidar is behind it, so the contours suit sketches, site plans and models, not survey work. Nothing is uploaded.

Click on the map to place the centre of the area. Drag the centre to move it.

GeoJSON and KML are always in WGS 84 longitude/latitude. Each line has its height in the field elev.

Need another format? Convert the shapefile on FileReshape.

Map and data: OpenFreeMap, MapLibre GL JS, Terrain Tiles (Mapzen / Tilezen on AWS Open Data), GeoNames (via all-the-cities), Proj4js, EPSG Geodetic Parameter Dataset (via epsg.io and epsg-index) – all data sources.

Key facts

Architects, landscape designers, planners and model builders often need the contour lines of a site before any survey exists: to place a house on a slope, sketch a garden, plan a path or cut the layers of a terrain model. GIS software can make them from an elevation model, but that means finding the right data, installing a program and learning it. This tool does it in the browser. Search for a place or click on the map, and a square of 500 m to 5 km around that point is filled with contour lines. The heights come from Terrain Tiles, a free worldwide elevation dataset that combines national lidar models, EU-DEM, SRTM and others. They are read onto a regular grid in the area's UTM zone, smoothed a little if you want, and traced into lines at every multiple of the interval. Every fifth line is an index contour, drawn thicker and labelled on the map. The lines download as DXF with each polyline at its own elevation, as a shapefile with the height in the field elev, or as GeoJSON and KML for QGIS and Google Earth. One click shows them in 3D in the GeoDrafter 3D viewer, on top of the terrain they came from.

How to use it

  1. Search for a town or postcode, or click on the map where the area should be centred.
  2. Choose the size of the area, from 500 × 500 m to 5 × 5 km.
  3. Keep the automatic interval, which gives about 25 contours over the relief, or choose your own, in metres or feet.
  4. Choose how much to smooth the terrain; light smoothing removes the small zigzags of the elevation data.
  5. Choose the coordinate system for the DXF and the shapefile, UTM is the default, then download the format you need.
  6. Click "Show in the 3D viewer" to see the contours in 3D, or copy the share link to come back to the same area.

How accurate is it?

Where the heights come from and how fine they are

Terrain Tiles mix the best open elevation model for each place. In England the source is the Environment Agency's 2 m lidar model, in the United States USGS 3DEP at about 10 m and finer, in Austria and Norway 10 m national models, in New Zealand 8 m and in large parts of Australia 5 m. Most of the rest of Europe comes from EU-DEM at 25 m, and much of the world from SRTM at about 30 m. The tool reads the tiles at the finest level that matches its grid, but it cannot add detail that the source does not have: on a 25 m or 30 m source a small terrace, a ditch or a road cutting is simply not there, and the contours follow a softened surface.

The grid and the lines

The area is turned into a square grid in its UTM zone with at most 400 cells along each side: about 1.3 m cells for 500 m, 5 m for 2 km and 12.5 m for 5 km, never finer than one pixel of the tiles. Each contour is traced with the marching squares method: where the height crosses the contour value between two grid points, the crossing is placed by linear interpolation, and the crossings are joined into continuous polylines, closed around hills and hollows. Lines are thinned where they are almost straight, by at most a fifth of a grid cell, so the files stay small without moving the lines.

How exact the heights are

On lidar sources the ground is usually within half a metre to a metre of the truth; on EU-DEM and SRTM the error is often 3–10 m and larger on steep slopes and in forest, because SRTM's radar partly measured the tree canopy. A 1 m interval on such data draws lines that look precise but are not, so the automatic interval grows with the relief. Use the contours for sketches, site analysis, presentation plans, 3D models and laser cut terrain models. For a building permit, earthworks or a drainage design, use a survey or your national elevation model: Denmark's DHM, France's RGE ALTI, Germany's state DGM1 or Spain's CNIG MDT.

Coordinates in the files

The DXF and the shapefile are written in the UTM zone of the area on WGS 84 by default, in metres, which CAD programs need for correct distances. You can choose WGS 84 longitude and latitude or any EPSG code, for example 25832 for ETRS89 / UTM 32N or 2154 for Lambert-93; the lines are then converted with proj4js. GeoJSON and KML are always longitude and latitude. Heights are above sea level in metres or feet, as chosen.

Good to know

An interval finer than the data

Choosing 0.5 m on flat land with a 25 m source gives many wiggly lines that show noise rather than terrain. As a rule, an interval below the vertical accuracy of the data adds no information. Try light or strong smoothing, or a larger interval, and compare with a map you trust.

Lakes, the sea and missing tiles

Water surfaces are flat in the data, so a lake has no contours inside it and the shore may get a ragged line. At sea the height is the sea floor in some sources and 0 m in others. If a tile cannot be loaded, that part of the area is filled with the average height and the panel says so.

Buildings, trees and recent works

The elevation models are mostly bare ground and several years old. New roads, quarries, embankments and building plots dug since then are not in them, and in forest SRTM can lift the contours by part of the tree height.

Frequently asked questions

How do I get contour lines for my site?

Search for the place or click on the map, choose the size of the area and the interval, and download the contours as DXF, shapefile, GeoJSON or KML. The share link stores the area and settings.

Can I open the contours in AutoCAD or another CAD program?

Yes. The DXF is in the R12 format that every CAD program reads, with each contour as a polyline at its own elevation on the layers CONTOUR and CONTOUR_INDEX, in metres in the UTM zone or the EPSG code you chose. AutoCAD, BricsCAD, ArchiCAD, Vectorworks, SketchUp with a DXF importer and Rhino all open it.

Which contour interval should I choose?

Choose about one contour per 1–5 % of the relief in the area. The automatic choice aims at about 25 lines: 1 m on gently rolling land, 5–10 m in hills and 20–50 m in mountains. Use a finer interval only where the data comes from lidar.

How accurate are the contour lines?

As accurate as the elevation data: within about a metre where lidar is the source, as in England, Austria, Norway and much of the USA, and often within 3–10 m elsewhere. They are fine for sketches and models, not for survey or engineering work.

What is an index contour?

Every fifth contour, drawn thicker and labelled with its height so the map can be read quickly. In the files the index contours are on their own layer (DXF) or have index = 1 (shapefile, GeoJSON), so they can be styled differently.

Can I get contours for a larger area?

The tool is limited to 5 × 5 km so the grid stays fine enough and the download small. Make several squares side by side and join them in your CAD or GIS program, or use GDAL's gdal_contour on a national elevation model for whole regions.

Something wrong or missing? E-mail [email protected] and it will be fixed.