1 of 41

Improving OSM lake polygons using LiDAR data

by Jake Low @ State of the Map US 2025

2 of 41

3 of 41

4 of 41

Problem: poor quality lake polygons

5 of 41

6 of 41

7 of 41

8 of 41

Elevation data

9 of 41

10 of 41

~500 ft

Traditional DEM

LiDAR DEM

~500 ft

11 of 41

Generating better

lake polygons

12 of 41

Input DEM

13 of 41

Hillshaded

gdaldem hillshade -igor dem.tif hillshade.tif

14 of 41

Slope map

gdaldem slope dem.tif slope.tif

15 of 41

Flat areas

gdal_calc.py -A slope.tif --calc 'numpy.where(A < 1.0, 1, 0) \

--type Byte --creation-option NBITS=1 --outfile flat.tif

16 of 41

Dilated

magick flat.tif -morphology dilate octagon dilated.tif

17 of 41

Flat areas (close up)

18 of 41

Dilated (close up)

19 of 41

20 of 41

21 of 41

22 of 41

23 of 41

Dilated

magick flat.tif -morphology dilate octagon dilated.tif

24 of 41

Vectorized

gdal_contour -fl 0 flat.tif vectorized.geojson

25 of 41

Vectorized (close up)

gdal_contour -fl 0 flat.tif vectorized.geojson

~100 ft

26 of 41

Smoothed

cat vectorized.geojson \

| python geosmooth.py taubin \

| python geosimplify.py 0.000005 \

> lakes-final.geojson

27 of 41

Results

28 of 41

29 of 41

30 of 41

31 of 41

Importing with JOSM

32 of 41

33 of 41

34 of 41

35 of 41

36 of 41

37 of 41

https://tasks.openstreetmap.us/projects/585

38 of 41

Future work

39 of 41

[sic]

40 of 41

peaks❓

lakes ✅

waterways❓

41 of 41

Sample code available here:

https://github.com/jake-low/detect-lakes-in-dems

Contact me on Slack:

@jake-low (slack.openstreetmap.us)