Home

Awesome

desCartes

desCartes recognises roads on old maps, and converts them to vector lines that can be used in GIS applications and historical transport network analysis. It is currently under development, but you can try a limited live demo.


Black & White Maps

For any given map extent (bounding coordinates), desCartes first generates a georeferenced map image (geotiff), and then - using a range of adjustable input parameters - processes the image to extract candidate road lines.

<img src="https://user-images.githubusercontent.com/42514781/221323460-0a761a91-5e10-4ffd-8441-06a80084fc37.png" />

Demonstration of desCartes. The user can select a map area (for the sake of server resources currently limited to a maximum of 10 km² for maps at this scale) and adjust the parameters used to detect likely roads.

<img src="https://user-images.githubusercontent.com/42514781/219343478-be3ce80c-21ed-4719-924f-4722e76419c0.png" />

Output from desCartes. A range of images is presented to indicate the steps taken in identifying likely roads, and a button is provided for the download of vector data.

<img src="https://user-images.githubusercontent.com/42514781/221306707-ff0730ed-f357-4330-addf-61fc5394e40b.png" />

This image shows the tests run along the contours of a skeletonized image to determine the presence or otherwise of road boundaries or modern roads (shown in yellow). Shape filtering before running these tests would eliminate most of the false contours in white areas. The modern road tests check not only the presence of a road in the vicinity, but also its orientation relative to the candidate road.

<img src="https://user-images.githubusercontent.com/42514781/221305212-d6d0b5dc-1f1b-4845-8b17-cff64f1a59ac.png" />

Network analysis aims to group candidate roads into a likely network, patching gaps where necessary. Candidate roads which fail a connectivity test are eliminated. Parameters for tuning the analysis are yet to be properly determined, and in the meantime results range from terrible to impressively good!

<img src="https://user-images.githubusercontent.com/42514781/219341848-9d578564-f8a1-48d7-b13b-5a64c610ae3a.jpeg" />

Output from desCartes. Areas are shaded by colour to indicate the criteria by which they were rejected as candidate roads. Candidate road vectors are scored based on their adherence to map contours and their similarity to modern roads, and their score is reflected in the opacity of the yellow lines. Blue lines are un-scored gap-fillers.

Coloured Maps

Extracting road vectors from coloured maps poses a different set of challenges.

<img src="https://user-images.githubusercontent.com/42514781/223348760-6e849bd8-b16e-4abe-85d6-c1e1b6f56497.png" />

In this map, the roads of interest are coloured red, brown, and yellow. Complications arise because parts of the roads are obliterated by text and map features, and these colours are also used for things like elevation contours, road numbering, and railway stations.

<img src="https://user-images.githubusercontent.com/42514781/223349099-ba375a14-b1ce-4886-b931-88c87c40fc3a.png" />

In the demo, an area up to 40 km² can be selected by the user. Results include images showing the colours extracted from the map, an edited, "skeletonized", and vectorised version of the colour map, and another version in which the gaps have been patched.

<img src="https://user-images.githubusercontent.com/42514781/223348833-542d0a07-ea23-4440-b4bc-7e1380cb9203.png" />

Extracted colours, with configured shapes removed (in this case, the railway station). Road numbering remains, and there are some quite large gaps where roads were obliterated by other features.

<img src="https://user-images.githubusercontent.com/42514781/223348867-62c345ad-9623-4c8b-a060-3de3be2d4ea0.png" />

The coloured shapes are then thinned down to a single-pixel width, and then traced (by processing contours) to produce gappy vector lines.

<img src="https://user-images.githubusercontent.com/42514781/223348896-24de5e47-81d8-4094-8ec9-4b471c446beb.png" />

Gaps are closed by a variety of techniques, which include extending each line a pixel at a time to see if it meets another extending line within a given distance, linking unconnected endpoints to nearest lines, and snapping near-coincident endpoints.

Flowchart

This gives a very broad overview of the sequencing of processes for different types of map. Each process takes a customisable set of parameters which have a significant impact on the quality of results. The sequencing and parameters need to be adjusted depending on the style of the map.

  flowchart LR
    A((Load Map))-->B{Is it coloured?}
    B-->|Yes|B1[Extract Colours]
    B-->|No|C2[Contour Cleaning]
    subgraph coloured [Coloured Map]
    B1-->C1[Remove Shapes]
    C1-->D1[Morphological Cleaning]
    D1-->E1[Skeletonization]
    E1-->F1[Cleaning]
    F1-->G1[Patching]
    G1-->H1[Reprojecting]
    end
    subgraph bw [Black & White Map]
    C2-->D2[Morphological Cleaning]
    D2-->E2[Shape Filtering]
    E2-->F2[Skeletonization]
    F2-->G2[Road Detection]
    G2-->H2[Patching]
    H2-->I2[Network Analysis]
    end
    H1-->C((Output Vectors & Visualisation))
    I2-->C

Development Roadmap

Live Demo

Click here for a limited live demonstration of desCartes in your browser, where you can select a small area on a map and see the results of image processing, and download a GeoPackage of the predicted road network for use in GIS software. Choose from several preconfigured map tilesets, or experiment with your own.

Map Tile Sources

desCartes might be adapted to suit other maps, but is pre-configured for use with:


Customisation & Funding

You are free to share and adapt this software yourself, subject to proper attribution as detailed in the license, but commissions for customised development are very welcome!

Development and server costs are otherwise entirely self-funded. Please donate if you can.

Follow @docuracy on Twitter or @stephengadd@mstdn.social on Mastodon for updates.