Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a tileset for land use #13

Open
amcewen opened this issue Jul 26, 2020 · 6 comments
Open

Add a tileset for land use #13

amcewen opened this issue Jul 26, 2020 · 6 comments

Comments

@amcewen
Copy link
Member

amcewen commented Jul 26, 2020

Related to #5, it would be good to have a tileset that showed different land usage so you could see if your 15-minute-isochrone included green space, somewhere to shop, places to work (both in an office and somewhere more industrial), somewhere to live, amenities (schools, libraries, etc.)

@amcewen
Copy link
Member Author

amcewen commented Jul 26, 2020

Have been looking at building our own tiles for that, using cyclOSM as a starting point (partly because it's bike-focused, partly because it's documented...).

  1. Followed the cyclosm install guide.

    • Installed postgresql-12 (as 9.6 isn't readily available on this Ubuntu install)
    • Skipped installing python-gdal as it isn't available and looks like it's part of gdal-bin now anyway.
    • Restricted NASA download to -a -4:50:-1:55 as we don't need the whole world... Actually that failed, so I skipped the whole hillshading section
    • Used England for the contour generation http://download.geofabrik.de/europe/great-britain/england.poly
  2. Set up a new user because npm doesn't like installing things as root (should've done this ages ago really)

  3. Installed kosmtik from the cyclosm contributing guide

    1. Installed nvm because the kosmtik doesn't work with new versions of NodeJS: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
    2. Logged out and back in. Installed Node 6 LTS: nvm install 6.17.1
    3. npm -g install kosmtik
    4. ~/.nvm/versions/node/v6.17.1/bin/kosmtik plugins --install kosmtik-fetch-remote (just running kosmtik seemed to find a global one I'd installed while discovering I needed to use nvm...)
    5. sudo apt install python-dev libmapnik-dev
  4. Created a default localconfig.json, copying it from the example in the install docs

  5. Run kosmtik: ~/.nvm/versions/node/v6.17.1/bin/kosmtik serve project.mml

  6. Now you can open http://localhost:6789/ but at present I don't seem to have any tiles to see...

  7. Had to download the shp file zips - https://osmdata.openstreetmap.de/download/land-polygons-split-3857.zip and https://osmdata.openstreetmap.de/download/simplified-land-polygons-complete-3857.zip, unzip them, and update the project.mml to point to them

  8. Because I downloaded a collection of pbf files for the OSM data (for Merseyside, Lancashire, Cheshire and Greater Manchester) I needed to reload them into the database (otherwise I only got the last one I loaded):

    • osm2pgsql -c -s -G --hstore -d osm ./merseyside-latest.osm.pbf
    • osm2pgsql -a -s -G --hstore -d osm ./cheshire-latest.osm.pbf
    • osm2pgsql -a -s -G --hstore -d osm ./lancashire-latest.osm.pbf
    • osm2pgsql -a -s -G --hstore -d osm ./greater-manchester-latest.osm.pbf

And now I have a tile server! Now I just need to work out how to style things differently...

image

@amcewen
Copy link
Member Author

amcewen commented Aug 8, 2020

To get this running again I needed to do the following, while sshed into the 15minutecity.mcqn.com server:

  • (Plus I needed to create an ssh tunnel to port 6789 on localhost to be able to access the server)
  • cd landuse-cartocss-style
  • nvm install 6.17.1
  • ~/.nvm/versions/node/v6.17.1/bin/kosmtik serve project.mml
  • Open http://localhost:6789 in a browser

@amcewen
Copy link
Member Author

amcewen commented Sep 12, 2020

https://blog.datawrapper.de/beautifulcolors/ has some good tips on choosing sets of colours to use

@amcewen
Copy link
Member Author

amcewen commented Sep 26, 2020

What different land uses are we interested in?

  • Water - lakes, rivers, streams, seas, etc.
  • Parks, fields, etc.
  • Residential - houses, flats
  • Retail
  • Amenities - libraries, council offices, leisure centres/gyms, galleries and museums, hospitals, places of worship
  • Blue-collar workplaces - warehouses, factories, mechanics
  • White-collar workplaces - offices

Kosmtik uses CartoCSS to describe how to render the maps. The Mapbox CartoCSS manual is a decent starting point to find out more.

I expect it'll be useful to use the CartoCSS variables to define the different landuse colours.

 @landuse-water = #73b6e6;
 @landuse-parks = #73e6b6;
 @landuse-amenities = #e67373;
 ...

The colours used in CyclOSM are all defined in palette.mss.

Given the amount of different types of data, etc. to render, it makes more sense to modify the CyclOSM styles than it does to start from scratch. So, we have forked that into https://github.com/Liverpool-UK/landuse-cartocss-style and cloned it and set things up on the server to allow us to render and show that tileset.

Next we'll be able to start making serious changes to the carto-css to start designing our map.

@amcewen
Copy link
Member Author

amcewen commented Oct 14, 2020

Of course, there's already a landuse OSM project. We should check it out to see if we're reinventing the wheel :-)

@jodischneider
Copy link

Definitely looks relevant and high quality - the question is how/where to get the data.

So I wrote Prof. Dr. Alexander Zipf whose team is behind the osmlanduse.org project to see if there is any open data available. Their research project involves combining the highest-resolution Copernicus data with OpenStreetMap, and using deep learning per their blog post. Currently they're part of an EU project seeking citizen scientists to help validate the deep learning results. Will pass on what I find!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants