3D time enabled historical streetscapes re.city Kartta Labs with Google Research

Kartta Labs and re.city was a really cool Google Research project that I was involved in a few years ago. It enabled users to view, interact and contribute to historical streetscapes with a timeline. Working from historical maps, geo-rectifying them, tracing and digitizing buildings, adding historical photographs of buildings and with a catalogue of three dimensional models it produced a fascinating and engaging time enabled view into our past. The project was much bigger than I write about here so feel free to explore the videos at the end and linked blog posts and papers produced.

The project was launched on the Google AI Blog: Recreating Historical Streetscapes Using Deep Learning and Crowdsourcing
Covered by Venture Beat: Google launches Kartta Labs to recreate historical maps in 3D
And on Fast Company: This incredible Google experiment lets you time travel to your hometown 200 years ago
It was initially announced on the Google Open Source blog in late 2020.

Intro

Three dimensional city streetscapes were created with a timeslider control. The buildings were modelled using photographs of the frontages of the buildings, and the footprints from historical maps.

re.city kartta labs 3D streetscape from fastcompany
Animations from Google: https://research.google/blog/recreating-historical-streetscapes-using-deep-learning-and-crowdsourcing/

I work with museums, galleries and archives on a number of historical crowdsourced mapping projects. Notably the New York Public Library’s Map Warper platform. Today this lives on in https://mapwarper.net and on Wikimedia’s Map Warper https://warper.wmflabs.org. I’m also familiar with the OpenStreetMap stack of applications, vector and raster tiles, cartography and a bit of server infrastructure – all these came into play during this project.

The components and applications of the project all ran on Google Cloud Project and with Kubernetes via the Google Kubernetes Engine (GKE). It used Google single sign on so users need only log into one place and authenticate for the different applications.


Animation from Google: https://research.google/blog/recreating-historical-streetscapes-using-deep-learning-and-crowdsourcing/

Main components

The front page showed an interactive map with pan and zoom control, a time slider at the top, links to the other applications, and help and about pages etc. The main applications are the Warper, Editor and Reservoir.
This front page is where users can explore the map, select buildings to see or add historic photos of buildings and see the building footprints, and enter the interactive 3D view.

The maps layer was a custom style – to look vintage – using the colours inspired by 19th century street maps and with a subtle paper texture background.

Noter – application to allow a user to connect a building footprint and a face of a building based on geometry of a historic photo of a building

noter

Reservoir  – a repository of 3D models of buildings.

Reservoir

Warper was enhanced

Look for some of these improvements coming to the main mapwarper application soon. If there’s some you think are better than others let me know.

Quick Place

A new interface was added to help users quickly and easily place map images geographically. Users would see the collection of maps and could choose one to “quick place”.

There’s a simple scale and drag rotate the image on a map. You can either hit one “looks good” button, skip to do another or manually find a map to work on.

OCR for Geocoding

Using image processing + Google Cloud Vision for Optical Character Recognition, the map images are processed to extract any road names and any place names. Together with any map metadata, this can be help automatically locate the map, and could potentially be used for editing the features. This also helps users to rectify the maps, giving a good starting location.

I imagine that today’s more advanced AI image reading tools might give much better results.

Versioning

Maps had versions, enabling maps to be rolled back to other versions after a change in adding control points.

Social improvements

The users who worked on the map were stored and linked to so that a user could see who helped on the map, or see a call to action if no users had started on it.

Vector Tiles

Within the warper, vector tiles were added for rectification, and with a time slider, so users could see and rectify historic maps while looking at this map.

Other updates

The warper was updated to work via Docker and with Kubernetes. The Rails version was updated and OpenLayers was updated. As before, the vector tiles and time slider was integrated. (I note: One thing users of mapwarper.net suggest is that control points could be snapped to vector features).
The Trace tab was changed so that you could load the rectified map into the Editor’s ID editor as a background image with the time tags so the user can quickly get started tracing over the historical map directly into the database.
Mapwarper’s code was also updated to run with a later version of OpenLayers and the whole system with Docker.

Editor website

The editor website was a fork of the OpenStreetMap website and stack with the Id Editor and was Dockerized to work with Kubernetes and a GCP Cloud SQL Postgres server. This serves as the API where geometries of the buildings are kept.
One edit for the website was to pass through some query parameters to the iD editor, so for example to load a rectified historic map or default historic dates to the editor. The id editor was customised to have a better interface for start and end times for features.

Vector Tiles

Tegola vector tile server was used and also run in Docker and in Kubernetes. The data was exported from the API as a planet and replication files created, and added into another GCP Cloud SQL Postgres server for vector tiles. Postgres was also uses to make the replication and planet service. The vector features had time properties within them so the maps are able to filter it.

AI / Machine Learning / Neural Networks

The output of the crowdsourcing mapping process fed into a workflow that heavily used AI to help create the 3D rendered cityscapes. We also considered using AI to assist with the georectification process.

The following comes from https://research.google/blog/recreating-historical-streetscapes-using-deep-learning-and-crowdsourcing/

Starting with footprints on maps and façade regions in historical images (both are annotated by crowdsourcing or detected by automatic algorithms), the footprint of one input building is extruded upwards to generate its coarse 3D structure. The height of this extrusion is set to the number of floors from the corresponding metadata in the maps database.

In parallel, instead of directly inferring the detailed 3D structures of each façade as one entity, the 3D reconstruction pipeline recognizes all individual constituent components (e.g., windows, entries, stairs, etc.) and reconstructs their 3D structures separately based on their categories. Then these detailed 3D structures are merged with the coarse one for the final 3D mesh. The results are stored in a 3D repository and ready for 3D rendering.

The key technology powering this feature is a number of state-of-art deep learning models:

  • Faster region-based convolutional neural networks (RCNN) were trained using the façade component annotations for each target semantic class (e.g., windows, entries, stairs, etc), which are used to localize bounding-box level instances in historical images.
  • DeepLab, a semantic segmentation model, was trained to provide pixel-level labels for each semantic class.
  • A specifically designed neural network was trained to enforce high-level regularities within the same semantic class. This ensured that windows generated on a façade were equally spaced and consistent in shape with each other. This also facilitated consistency across different semantic classes such as stairs to ensure they are placed at reasonable positions and have consistent dimensions relative to the associated entry ways.

Videos

The project is over now but a bunch of videos covering all the components can be found on the YouTube channel:  https://www.youtube.com/@re-city8789


Present Time

Kartta Labs is now maintained by the Kartta Foundation associated (I think) with the University of Minnesota: https://kartta-foundation.github.io/

The Kartta Foundation is currently focused on spotting, linking and extracting text from historical maps, and have published a range of papers and lots of open source software. For example The mapKurator System: A Complete Pipeline for Extracting and Linking Text from Historical Maps (2023) and Hyper-Local Deformable Transformers for Text Spotting on Historical Maps (2024)

OpenHistoricalMap (OHM)

Want to do the same kind of project today? I’d suggest to start using OpenHistoricalMap.
I was involved in development and hosting of the OpenHistoricalMap project from the beginning and evangelize for the project at a number of conferences and whenever I can!

In some ways this project and OHM’s redesign happened at the same time, but for different purposes. re.city’s data is Open Data License (ODBL) which enables the use of OpenStreetMap’s data which is useful for existing city streets and buildings.  Users can then work back from today’s map into the past. This project was focused on cities. OpenHistoricalMap data is CC0 / Public Domain which potentially limits it’s ability to use OSM data but which which focuses on much wider historical timeframes and lots of existing historical data is public domain.

Mapwarper.net emails improved

The Mapwarper.net server should be sending emails with the correct internals set up so they are less likely to end up in your spam inboxes now!

For many weeks users have emailed saying that they were having problems accessing their emails. Over the years some email providers have increased email sending requirements to protect against spam e.g. https://support.google.com/a/answer/81126?hl=en#zippy=%2Crequirements-for-all-senders so that at least SPF and DKIM are set up. Mapwarper.net should now have these. (It doesn’t currently have dmarc though.)

If you are interested in these things, with regards to spam, it seems that spammers set these up better than the rest of us! Spammers are better at SPF, DKIM, and DMARC than everyone else HN discussion: https://news.ycombinator.com/item?id=43468995

Internationalization (i18n) and Translations for Mapwarper. (English, Dutch, Japanese)

mapwarper_locale

Many thanks to Ellen Gehring of Erfgoed Leiden en Omstreken for the Dutch translations. Ellen with the ELO wanted their own warper and because of this, support for locales, internationalisation and translations was added to the codebase.  Huge thanks to Kamata Ryo for the work on the Locale Changer and the Japanese translations.

If you would like to see your own language, let me know.  We’ve used both LocaleApp and normal Github pull requests.

New shortcuts and add layer features in mapwarper.net

Mapwarper.net has been updated with several months of the latest code. Some of these features are directed towards the rectify map interface with the addition of keyboard shortcuts and the new search and add custom layer tool. If you want to support mapwarper.net donate to paypal.me/timdevelops!

Search for existing map and mosaics and add to the map

Search for warped maps and mosaics (previously called layers) to add to the reference map.

Add Z/X/Y tiles to reference layer

Instead of searching for maps, paste in a map template string into the box. In the animation below, we get a template from another warper and add that in. You can use any tiles so long as they are in the ZXY ordered scheme e.g. https://example.com/osm/{z}/{x}/{y}.png

Keyboard shorcuts: Change Mode  & Place Point

Use 1, 2 and 3 on your keyboard to change mode from place point, add point and move map modes.

Press “q” to place a point at the mouse cursor – regardless of the map mode. This enables you to quickly move around and add points

Quick Place and Quick Save

In this animation, the user has the move map control mode activated, and they move the mouse of the maps, and click “q” to quickly place point at mouse location. They then hit “e” or “return” to save that point – that saves you clicking the  “add control point” button!

Auto Place Point – MAGIC!

Here the “a” key is pressed to (similar to the q key) drop a point where the mouse is, but crucially, another point on the other map is added. This works if the point you add is on either map. The other map is zoomed to that new point. You’d need at least 2 points to give this a go.

(It uses a helmert transform to work out, based on the existing points, where to add the other point – so it’s a simple 2D transform and won’t be accurate for very warped maps)

What’s coming to Mapwarper.net – new stuff!

Mapwarper.net is getting an upgrade of code early this first week in April.

New things:

  • Keyboard shortcuts
  • New JSON-API and docs
  • Map caching for faster maps
  • Bigger map windows
  • Upgraded Ruby and Rails versions
  • Changed “my maps” to “favourites”
  • Changed “layers” to “mosaics”
  • Social logins – OpenStreetMap, Github and Facebook
  • Year / date search
  • Translation support
  • Added Mapbox Satellite layer
  • Search for an existing map or mosaic to help rectification
  • Ability to add an “Z/X/Y” Tile layer to help rectification
  • Upload CSV of Control Points for a map
  • Download CSV of control points for any map
  • Many bugs fixed and much other things I forgot to list above!

Screenshot_2017-04-02_19-14-00

You might particularly enjoy the keyboard shortcuts:

Screenshot_2017-04-02_19-11-38

The “a” shortcut does some auto-magic where if you have 3 or more points, it will automatically place the other point at the place where it thinks works best.

GIFrecord_2017-04-02_193003.gif

Quick place “q” and save point “e” then Auto place “a” twice and save point “e”.                      Click the image for bigger

To try out these latest features yourself visit http://mapwarper.net

Let me know what you think!

If you wish to support the hosting and development of this project, you can donate to Tim via PayPal here: paypal.me/timdevelops

 

 

Mapwarper Tutorial & Spatial Humanities Workshop by Lincoln Mullen

Lincoln Mullen has written a great series of workshops on the Spatial / Digital Humanities over five days. Day 3 is focused around Georectification with Mapwarper.net and is a very good tutorial.
mapwarper-preview.png
The full workshop contents are here, and I recommend you to check them out:
Day 1: Introduction and Setup | Map Literacy | Narrative Maps
Day 2: Data Maps | QGIS
Day 3: Georectification | Working with Spatial Data
Day 4: Deep Maps | From Manuscripts to Maps
Day 5: Programmatic Maps

Lincoln is an assistant professor in the Department of History and Art History at George Mason University, working on the history of American religions as a digital historian.

The link to the Georectificaiton Workshop is here: http://lincolnmullen.com/projects/spatial-workshop/georectification.html

The screenshot of the tutorial is below the fold. Continue reading →

Doing Digital History 2016 – Map Warper Tutorial

Doing Digital History 2016 is a two week Summer institute sponsored by National Endowment for the Humanities and was held at George Mason university in DC/Arlington earlier in the year. It was attended by “mid-career” historians and the focus was on digital humanities and history – making visualizations, mapping, sound and vision, and more.

Screen-Shot-2016-07-07-at-4.11.16-PM.png

I was happy to see that the participants had a workshop Georectifying maps with Map Warper.

Here’s the screenshot of the tutorial:

 

 

 

 

 

Mapwarper featured in A Digital Humanities Primer for English Students

Jenna Herdman has written an excellent free e-book about Digital Humanities for English Students which has an entire chapter titled: Digital Mapping Tool Tutorial which features the Mapwarper. It’s been published using gitbook and is available in pdf, html, epub formats.

The tutorial covers adding a map to mapwarper.net to chart the movements of David in Charles Dickens’s David Copperfield.

unspecified-2

The map is then loaded into Palladio which is a new tool for me. it “is a web-based platform for the visualization of complex, multi-dimensional data”.

unspecified-1

Do check out this great resource. The book has seven chapters in total and all of them are interesting and worthwhile to read! https://www.gitbook.com/book/jennaherdman/a-digital-humanities-primer-for-english-students/details

Screenshot after this read more tag:


Continue reading →

Colliding The Mental Maps of Edinburgh with Mapwarper.net

Last autumn I popped up to Edinburgh from the North of England for State of the Map Scotland conference. Together with Edinburgh College of Art in Evolution House participants took part in series of workshops “Map.Makars”

I took part in a memory map of the city. The rules were: no looking at other maps, the map should include the venue, the castle, the train station. We drew, from memory the city on large pieces of paper. Gregory scanned/photographed these and put these on mapwarper.net to stretch them to fit. he then combined these together with an interactive and animated transparency control to create the Hand Drawn Map Collider “No-map Map“ Give it a whirl! http://www.livingwithdragons.com/maps/nomap-map/

Screenshot from 2016-04-22 11:26:11.png

My map, in case you were wondering was possibly the least accurate of them, coming from furthest away! http://mapwarper.net/maps/10907

Screenshot from 2016-04-22 11:28:00.png