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.
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.
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.
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
Reservoir – a repository of 3D models of buildings.
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.
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.
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.
Geobase, a serverless geospatial platform has a vector tile server, database functions, PostGIS, H3 and the MobilityDB extensions (amongst much more!) built in, and this quickstart blueprint uses all of them. On the front end we are using deck.gl and maplibre and typescript and react.
The application shows animated trails representing taxi trips in Porto, Portugal:
In the above animation you can see pulsing blue circles. These are where 2 taxis have passed close by next to each other within 10 metres. The point is actually the shortest distance between the two trips, where the taxis got the closest. Often it’s passing by on the street, and starting off by taxi ranks or dropping off in the same locations.
MobilityDB was mostly used, to represent the taxi trips as lines-with-time, in the vector tileserver function to serve these temporally aware lines, in the outlier detection and cleaning steps and in the close pass analysis steps.
The outlier detection step identifies and removes parts of the trip with impossible speeds. In the following image, the blue and red lines are the taxi trips, but the blue ones have many very straight and very long segments. These will have very high speeds. The red lines is the cleaned dataset
I’m impressed with MobilityDB, in the next image, the green polygon is a h3 hexagon. The purple line is one taxi trip, the light blue is the trip clipped to the hexagon, and the dark blue is the trip within the hexagon and clipped to a particular time frame.
Moreover, because Geobase is also PostGIS in the cloud, we can connect to it in QGIS, and here are the query layers in QGIS
The line is clipped to the timespan:
{[POINT(-965739.7745940761 5036826.935711992)@2013-07-01 09:27:07+00, POINT(-966081.4141113205 5036898.801939623)@2013-07-01 09:27:22+00, POINT(-966272.7055242998 5036942.099465625)@2013-07-01 09:27:30+00]}
The processing is mostly performed with PostGIS. For example, to identify trips with outlier periods:
whenTrue(speed(temporal_geom) #> 55) AS high_speed_periods
And then to remove these “high_speed_periods” from the trips:
WHEN high_speed_periods IS NOT NULL THEN
minusTime(temporal_geom, spanset(span(high_speed_periods)))
ELSE
temporal_geom
I hope you enjoy the video, I used OBS for the screen recording which gave me more control over it with the audio. My voice can sometimes be quiet so I hope the video is engaging for you.
Whoots is a simple tile server proxy for WMS servers. WMS > TMS. So if you have an application that only works with ZYX Google-style tiles and all you have is a WMS server, you can use it to re-route the request.
Last year I was involved to help develop the prototype mobile-first web app for geolocated data collection ahead of a visit to the field with biologists and students.
Aimed at non specialist university students to use in the field to help survey and record measurements and observations for river quality health along a river in Samoa. The purpose of this first app is to show possibilities and demonstration for future solutions. River and water quality measurements can involve surveys for invertebrates (aquatic insects), pH of the water, turbidity, velocity, temperature etc. Traditionally such surveys were taken, recorded on paper and input later back in the laboratory. A mobile device out in the field can also have documents, multimedia and tutorials to guide users. The project involved research into Citizen Science projects. Many good platforms exist, for example ODK or Kobo which can have very complex and detailed logic for forms but it was decided that a more user friendly and casual approach would be better.
The front page gives a brief outline, a call to action button “Start Collecting”, two summary tables of the latest observations and the latest active users.
The main aims:
Sustainable – able to run on its own
Collect data in a continuous manner
Accessible and easy to use
Handheld
Benefit learning for curriculum
Incorporate reinforcement rewards, feedback
Surveys should be georeferenced
Review of previous surveys
Some of the challenges included GPS variability in forest, using mobile devices and water, and bandwidth requirements in the field.
The app showed tips before starting.
The application was designed around 3 types of data forms. physical, biological and chemical
Each form had a time and location which used browser / GPS geolocation. Users could move the location if they wanted.
Physical
River width
River depth
Has it been raining or not?
What evidence of water user can you see (fishing, boats, use for homes, irrigation, etc)
What man made structures can you see (e.g. weirds, dams, wells, bypass channels etc
On the surface. Can you see foam, litter, oil on the surface?
What land use is around the site (pasture, town, forest etc)
These allowed users to add a name with a count and attach images.
Some species would be pre-populatated in the boxes.
The site has an admin page which allows editing and reviewing of contributions and allows them to download all the data as a spreadsheet and to download the images zipped up.
The site has a simple scoring for users based on number of contributions, and shows feedback of their contributions so that people can see the reports coming in and the nature of them
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.
This year, with Leeds City Council I developed LeedsAdultLearning.co.uk which is a course finder for about 300 courses by the City and run by a number of providers and dozens of venues. It offers a range of first step courses for adults, such as basic IT skills, ESOL, caring and crafts. Within the first 24 hours of launch it received over 3000 visits, in the first month, it had over 25,000 visits, with the average user spending three minutes on the site. The code’s up on my LearningInLeeds GitHub repository.
The project evolved from a LCC Innovation Lab – similar to the Leodis project I also worked on. The key idea is that it was designed to be a pilot or prototype project, small in scope and quick to develop, it would aim to be an aspirational example of how the City can work with the Council and open data to make good IT products. The adult education department were fully engaged with the development and design of the project, giving feedback, priorities. This engagement was really welcome and I think the experts say its crucial to any successful agile project. The department didn’t have any online course finder before so this was bringing something new, and needed to them.
Automatic imports of courses from Data Mill North (open data site)
Full text search with support for sounds like and spelling mistakes
Geographical, near searches
Bus and walking directions to the start of the course from any point
Add to calendar links for course start
Showing courses by topics or categories
Responsive and mobile friendly.
Simple CMS admin UI for staff to update text pages, change records etc
Caching of external API requests, front page and CMS pages
Recent searches kept
Technology
Ruby on Rails
Devise and Active Admin for admin UI
Postgresql, PostGIS and pg_search for db, geo, full text stuff
Bootstrap for front end user interface layout, CSS etc
Transport API, Bing Transit, Mapzen for journey planning and geocoding etc
Future
The project could be altered for other organisations, and it could be altered to include the whole range of courses on offer for adults across the city region. I think usage metrics would need to be done to see what users actually do on the site, and whether the journey planning is useful. Adding extra information about course duration, how many times a week / month etc would be good. Making it more mobile friendly could be looked at, including making a mobile only app.
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.
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)
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!
You might particularly enjoy the keyboard shortcuts:
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.
Quick place “q” and save point “e” then Auto place “a” twice and save point “e”. Click the image for bigger
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.
The New Cloud Atlas, (newcloudatlas.org) is a global effort to map each data place that makes up the cloud in an open and accountable way. It’s a project to find and map each warehouse data centre, each internet exchange, each connecting cable and switch. Anything of any physical significance in the operation of the cloud should be observed in some way, and recorded for everyone to see and use. Data is stored in OpenStreetMap and users can map things using the on site iD editor with custom telecoms presets for the first time. Map tiles with two styles have been produced and have now made visible this hidden infrastructure. http://newcloudatlas.org
The New Cloud Atlas, named after the nineteenth collaborative scientific data collection project, is about understanding and making visible the hidden “Cloud”. Although most of these telecoms features are in the open and in plain sight, many are missing from open datasets or may be considered sensitive. Telecoms infrastructure has immense importance in connectivity and power in our connected world – the more connected a place is the more benefits it has. Indeed the lines of fibre optic backbone have become the new ley lines of the 21st Century powering the forces behind a new Psychogeography of places.
A bit about the name: The First Cloud Atlas was published in 1896 by the Permanent Committee of the first International Meterological Congress. Cloud weather observatories around the world were able to share consistent observations of the clouds and observe weather systems whose scale stretched over national boundaries. The publication of the International Cloud Atlas represented a move beyond national concerns and boundaries to an international perspective.
In addition to its important role in the predicting the weather, the vision is a surprisingly early call for infrastructural globalism and worldwide collaboration:
“If there be any branch of science in which work on a uniform system can be especially useful and advantageous, that branch is the inquiry into laws of weather, which, from its very nature, can only be prosecuted with a hope of success by means of very extensive observations embracing large areas, in fact, we might almost say, extending over the whole surface of the globe”
Site
The site shows frequently updated tiles generated from OpenStreetMap(OSM) data, details about the project and a custom OSM editor for making it easier to add map features. Here are some screenshots.
Map, Transparent Tiles, Markers, Legend
Cloud X-Ray Style, with scale independent(ish) building polygons
The Cloud X-Ray style, shown above was partially inspired by Kosmtik’s data inspector style, and it shows polygons that are enlarged at low zooms. Polygons should appear to be the same size on the screen as you zoom in. It gives a sci-fi cartography, but I find it very useful finding clusters of mapped features, as all features are shown at all zoom levels.
The New Cloud Atlas is a project initiated by experimental media technologist, artist and designer Ben Dalton with the design and research studio of Amber Frid-Jimenez and Joe Dahmen, and myself. Ben writes about the project – with the main idea that it’s about understanding what the Internet actually is in physical terms, rather than as something that remains clouded and mysterious:
The first appearance of the internet cloud was in network diagrams. The cloud symbol was used to stand in for complexity. The cloud embodied something of the way that the internet functions. The internet was designed to be ‘end-to-end’, so computers are meant to be able to connect to each other without interference as the message passes through a network of interconnections. Only the end points are meant to matter. The clouds here represent ‘something in the middle that is too complex to draw here’, a kind of neutral space through which information passes. It is an act of simplification, but it also contains an implicit statement that ‘the cloud will look after itself’ that this thing is going to carry on being there.
Beclouding is deliberately making something more confusing, in order to obfuscate or conceal its meaning. The use of the cloud has shifted in digital systems. The idea that ‘this is too complicated to think about’ has been moved front and centre and converted into a business model, shedding its innocence along the way. Through a sleight of hand, the cloud sometimes appears as a platform, and sometimes a material. This narrative rests on the idea that the services are to be trusted, and they can take care of themselves on your behalf. We trust them with our emails and our childhood photographs and our meeting plans and whatever else we use the cloud for. In this new definition of the cloud, there is a statement that ‘this is too complex to deconstruct or critique’. You shouldn’t try to look in to the cloud and see what’s there. It’s made up of vapour, and it’s not to be interrogated. Better to simply observe it from a distance and admire it at sunset.
Once the domain of national governments, information infrastructure is increasingly constructed, operated, and maintained by major multinational corporations. These corporations, which include Google, Facebook, Amazon, Apple, and Microsoft, have a similar vested interest in maintaining control over of the flow of goods and information once exercised by national governments, but a reach at once more extensive and less transparent.
Psychogeography
Regular readers may know of my interest in Psychogeography. The British Psychogeography of the 90s employed Ley Lines and “Magico-Marxism” using the language of the occult to explain the unknown forces of power at work in space and in places. I’m developing the idea that the new lines of power in the 21st Century are of Information – and the actual lines of light that transmit these bits of data, and the buildings that house them. More about that in walk or talk later on this year!
Another more obvious connection with psychogeography is the hidden in plain sight angle. These passageways of the internet are often marked, on manhole covers, in mobile phone masts, in big buildings in light industrial estates, but they are utterly overlooked. They may travel along the margins, along canals or train tracks. They are also sited in classic psychogeographical “liminal” spaces – beaches, margins of rural and urban, wasteland, on top of tower buildings etc.
OpenStreetMap and the Telecoms WikiProject
OpenStreetMap allows anything that exists and can be verified to be mapped. There is no notability rule that Wikipedia has, for example. So it allows manhole covers to be mapped in detail, it allows telephone lines and the assorted street cabinet boxes that crowd our pavements. You might get feedback as to how to map these features and you might get funny comments about why these features are being mapped (and indeed, mapping with OpenStreetMap is voluntary!) but pretty much all OSM mappers will agree that these features shouldn’t be excluded.
Telecoms features in OpenStreetMap haven’t been well mapped before. This is both good and bad in that the taxonomy (or folksonomy to be more accurate) – the tags that describe these features -have not been standardized. We have the opportunity to define the tags, or at least standardize some of them to be more consistent across similar telecoms infrastructure features.
The current features being rendered in the New Cloud Atlas map are:
Data Centres
Telephone Exchanges
Manhole covers
Telephone poles and wires
Submarine cables etc
Telecoms towers, masts, and antennae
Street Cabinets
Underground features may be more difficult to map – so we are relying on manhole covers which often show what its use and who operates the cable underneath (in the UK at least) – and those markings sprayed by utility companies, and some data imports. If you don’t know where an underground cable goes its probably best to leave it out.
You might have noticed that many of the options include sound and heat for the street cabinets. One of the side effects of today’s modern fibre optic street cabinets is that they are often installed with more power needs than copper wire ones – and so they need a fan. Often the cabinets are warm to the touch and sometimes they make a quite loud drone sound. This type of data can be useful, I have heard, to people who are vision impaired. Sound and touch can help orientate people in space.
It’s probably worth talking a little bit about the privacy and secrecy issues. Although the project isn’t about getting releases of data from companies and governments, and it’s not about uncovering the secret installations, it is about collaboratively mapping the world. Almost all of the information that will make up the New Cloud Atlas will be found in the field or in public information sources.
You may be reminded of a story in 2003 (2 years after 9/11) of Sean Gorman‘s PhD dissertation that the US Government wanted to make classified as although it contained only publicly available information (about the Internet connections in the US) he analyzed the data to identify the weak links – weaknesses that, for example, a disaster could take out or a terrorist could exploit. Officials in the US Govt said that his dissertation should be burnt! Sean successfully graduated and started a mapping company with the DHS as clients. (I actually ended up working there at FortiusOne / GeoIQ several years after that for a bit). Now of course open data and open analysis is encouraged and promoted by governments (and following this trend check out Sean’s new startup Timbr.io).
You may also recall stories about how many national mapping agencies removed military bases (such as Aldermaston, or Greenham Common in the UK) from their paper maps – even when these bases were signed from the motorways and major roads and had nice big clear signs outside the fences. A relic from the Cold War, perhaps. It appears to me that even in this current year the Ordnance Survey mislabels the Menwith Hill USAF/RAF Listening Base in North Yorkshire as just “Menwith Camp” with no indication of it’s real name, activity nor landuse (as compared to OpenStreetMap for example).
Of possible interest to mapnik style geeks could be the use of the scale denominator and PostGIS ST_Scale commands to scale up building polygons so that they appear to be the same size regardless of the zoom. If anyone wants to fix this to make it work better, please let me know!
select st_translate(st_scale(way, (!scale_denominator! * 0.00028) - (5 - z(!scale_denominator!)) ,
(!scale_denominator! * 0.00028) - (5 - z(!scale_denominator!)) ),
st_x(st_centroid(way))*(1-( (!scale_denominator! * 0.00028) - (5 - z(!scale_denominator!)) )),
st_y(st_centroid(way))*(1-( (!scale_denominator! * 0.00028) - (5 - z(!scale_denominator!)) ))) as way,
building AS type FROM planet_osm_polygon WHERE (building='data_center' ) AS data",
OSM Tile Generation
Tiles are kept up to date at around 15 minutes with the central OSM database. Occasionally a full planet import is done. I think I could use Lua scripting to ensure that the database remains lean. The system uses TileStache to enable the UTFGrids for the popups. Essentially we filter out a lot of stuff from the OSM database: