# LayeredGeoGraphics -- An awesome way to build multi-layered custom maps!

Posted 5 months ago
1203 Views
|
8 Replies
|
22 Total Likes
|
 The Wolfram Language comes with lots of great functions, but one of my all-time favorites is GeoGraphics and all its GeoSiblings. Here is a simple example of how easy it is to create a map in the Wolfram Language: GeoGraphics[Interpreter["City"]["nyc"]] And you can use some built-in 'backgrounds' as well, for example: GeoGraphics[Interpreter["City"]["washington dc"], GeoBackground -> "ContourMap"] A perhaps lesser known option, but very useful one is the GeoServer option, which lets you point to any tilemap server: GeoGraphics[Interpreter["City"]["rome, italy"], GeoServer -> "http://b.tile.openstreetmap.org/1/2/3.png"] This is a very powerful feature, because there are many many tilemap servers in existence. Many are free for personal use and others require some sort of subscription with a key to unlock the tilemap server.Finding all of them is a hassle, so I am making a GeoService function available in my Prototype paclet on GitHub. This is a paclet which provides a number of half-baked (and sometimes fully baked!) functions that are not (or not yet) in the core Wolfram Language. Here is how you get this paclet (and the functions described in this post): PacletInstall[ "https://github.com/arnoudbuzing/prototypes/releases/download/v0.2.7/Prototypes-0.2.7.paclet"] (You may need to Quit and restart the Wolfram Language after this)The GeoService function is a collection of a number of publicly documented tilemap servers: GeoService["Properties"] Here is the output: {"OpenStreetMap", {"OpenStreetMap", "France"}, {"OpenStreetMap", "France", "Humanitarian"}, "WikiMedia", "HikeAndBike", {"WaymarkedTrails", "Hiking"}, {"WaymarkedTrails", "Cycling"}, "SkiMap", "HillShading", {"OpenCycleMap", "Cycle"}, {"OpenCycleMap", "Transport"}, {"Mapnik", "Grayscale"}, {"Mapnik", "LabelFree"}, {"Stamen", "Toner"}, {"Stamen", "Watercolor"}, {"ThunderForest", "Landscape"}, {"ThunderForest", "Outdoors"}, "Opnvkarte", "OpenPtMap", {"Carto", "Dark"}, {"Carto", "Light"}, "OpenSeaMap", {"OpenRailwayMap", "Standard"}, {"OpenRailwayMap", "MaxSpeed"}, {"OpenRailwayMap", "Signals"}, {"ArcGIS", "UnitedStatesTopographical"}} Already immediately this gives you a whole new set of maps you can make. Here are some examples: GeoGraphics[Interpreter["City"]["athens, greece"], GeoServer -> GeoService[{"Mapnik", "LabelFree"}]]  GeoGraphics[Interpreter["City"]["cairo, egypt"], GeoServer -> GeoService["WikiMedia"]] But all these maps are single layered, whereas several tilemap servers provide transparent layers for some "theme". For example here is a layer which contains only hiking trails in a part of the Yorkshire Dales: GeoGraphics[Interpreter["City"]["malham, united kingdom"], GeoServer -> GeoService[{"WaymarkedTrails", "Hiking"}]] This sort of layer is most useful when it is combined with another (non-transparent background) layer. One way to achieve this is to use the Overlay functions which can display one Wolfram Language expression on top of another: Overlay[{"XXXX ", " OOOO"}] In the "Prototype" paclet (described above) I defined a LayeredGeoGraphics function which uses Overlay to stack multiple layers. Here is an example which shows hiking trails against a grayscale Mapnik layer: LayeredGeoGraphics[ Interpreter["City"]["malham, united kingdom"], {{"Mapnik", "Grayscale"}, {"WaymarkedTrails", "Hiking"}}, GeoRange -> Quantity[1, "Miles"]] And of course you can stack more than two layers. Here is an example of a label-free background layer from Mapnik, with a hill-shading layer and a hiking trail layer on top of it (The hill-shading provides the "depth" look and feel): LayeredGeoGraphics[ Interpreter["City"]["malham, united kingdom"], {{"Mapnik", "LabelFree"}, "HillShading", {"WaymarkedTrails", "Hiking"}}, GeoRange -> Quantity[1, "Miles"]] The possibilities are endless! If you find additional tilemap servers please feel free to add them here as a comment, or make a pull request in my Prototypes github repo. More layers = more possibilities!
8 Replies
Sort By:
Posted 5 months ago
 Thank you for posting. This is very useful!Thanks,Marco
Posted 5 months ago
Posted 5 months ago
 It is fantastic. I have been playing with tile servers like here, based on openstreetmap, and here.You paclet will keep me busy for a bit...Thanks again,Marco
Posted 5 months ago
 Thanks for sharing!
Posted 5 months ago
Posted 5 months ago
 If this is possible, it'd be super to see some historical geo-referenced maps supported as well. For example, I think this CC-BY historical (1920-1940s) Ordnance Survey map of the UK from the National Library of Scotland should be compatible as it's shared via the Map Tile Service standard: https://maps.nls.uk/projects/api/index.html