Slide 1

Slide 1 text

Standing up an OSM clone with GeoServer and CSS Ing. Andrea Aime GeoSolutions

Slide 2

Slide 2 text

GeoSolutions ⚫ Italian SME ⚫ Expertise • Image Processing, GeoSpatial Data Fusion • Java, Java Enterprise, C++, Python • JPEG2000, JPIP, Advanced 2D visualization ⚫ Supporting/Developing FOSS4G projects ⚫ GeoServer, MapStore ⚫ GeoNetwork, GeoNode, Ckan ⚫ Clients ⚫ Public Agencies ⚫ Private Companies ⚫ http://www.geo-solutions.it FOSS4G 2019, August 26th/30th, Bucharest

Slide 3

Slide 3 text

What are we talking about?

Slide 4

Slide 4 text

This FOSS4G 2019, August 26th/30th, Bucharest

Slide 5

Slide 5 text

Or to be more precise, this FOSS4G 2019, August 26th/30th, Bucharest

Slide 6

Slide 6 text

So you have OSM in your home page • https://maps.geo- solutions.it/geoserver/osm/osm/gwc/service /wmts?request=GetCapabilities FOSS4G 2019, August 26th/30th, Bucharest

Slide 7

Slide 7 text

What's behind it? FOSS4G 2019, August 26th/30th, Bucharest { } GeoCSS Imposm3

Slide 8

Slide 8 text

Motivation and history

Slide 9

Slide 9 text

Several attempts on-line https://wiki.openstreetmap.org/wiki/OpenStr eetMap-in-a-Box https://github.com/melbsurfer/osm- geoserver-styles https://github.com/boundlessgeo/OSM/ FOSS4G 2019, August 26th/30th, Bucharest

Slide 10

Slide 10 text

Why start a new attempt FOSS4G 2019, August 26th/30th, Bucharest

Slide 11

Slide 11 text

Because it's hard FOSS4G 2019, August 26th/30th, Bucharest "We choose to clone OSM, not because it's easy, but because it's hard"

Slide 12

Slide 12 text

Going beyond the comfort zone FOSS4G 2019, August 26th/30th, Bucharest

Slide 13

Slide 13 text

Timeline FOSS4G 2019, August 26th/30th, Bucharest github.com/aaime/osm 2017

Slide 14

Slide 14 text

Timeline FOSS4G 2019, August 26th/30th, Bucharest github.com/geosolutions.it/maps.geo- solutions.it 2018

Slide 15

Slide 15 text

Timeline FOSS4G 2019, August 26th/30th, Bucharest github.com/geosolutions.it/maps.geo- solutions.it 2019

Slide 16

Slide 16 text

Choosing the "right" style

Slide 17

Slide 17 text

Which OSM-Bright? FOSS4G 2019, August 26th/30th, Bucharest • https://github.com/gravitystorm/openstreetm ap-carto

Slide 18

Slide 18 text

Other options FOSS4G 2019, August 26th/30th, Bucharest • https://github.com/mapbox/osm-bright • https://github.com/openmaptiles/osm- bright-gl-style

Slide 19

Slide 19 text

Side by side comparison FOSS4G 2019, August 26th/30th, Bucharest OSM MapBox OpenMapti les

Slide 20

Slide 20 text

Side by side comparison FOSS4G 2019, August 26th/30th, Bucharest OSM OpenMaptiles

Slide 21

Slide 21 text

Different objectives FOSS4G 2019, August 26th/30th, Bucharest

Slide 22

Slide 22 text

Consequences FOSS4G 2019, August 26th/30th, Bucharest

Slide 23

Slide 23 text

Challenges

Slide 24

Slide 24 text

Approach FOSS4G 2019, August 26th/30th, Bucharest

Slide 25

Slide 25 text

Issue: zoom vs scale FOSS4G 2019, August 26th/30th, Bucharest #roads-casing, #bridges, #tunnels { ::casing { [zoom >= 12] { [feature = 'highway_motorway'] { line-width: @motorway-width-z12; [zoom >= 13] { line-width: @motorway-width-z13; } [zoom >= 15] { line-width: @motorway-width-z15; } [zoom >= 17] { line-width: @motorway-width-z17; } [zoom >= 18] { line-width: @motorway-width-z18; } [zoom >= 19] { line-width: @motorway-width-z19; } [zoom >= 20] { line-width: @motorway-width-z20; } [link = 'yes'] { line-width: @motorway-link-width-z12;

Slide 26

Slide 26 text

Going from zoom to scale FOSS4G 2019, August 26th/30th, Bucharest 1 1:279.541.131 1:139.770.565 2 1:200.000.000

Slide 27

Slide 27 text

Going from zoom to scale FOSS4G 2019, August 26th/30th, Bucharest Level Scale denominator Middle cut Rounded mid cut 0 559.082.263,95 1 279.541.131,98 419.311.698 400.000.000 2 139.770.565,99 209.655.849 200.000.000 3 69.885.282,99 104.827.924 100.000.000 4 34.942.641,50 52.413.962 50.000.000 5 17.471.320,75 26.206.981 25.000.000 6 8.735.660,37 13.103.491 12.500.000 7 4.367.830,19 6.551.745 6.000.000 8 2.183.915,09 3.275.873 3.000.000 9 1.091.957,55 1.637.936 1.500.000 10 545.978,77 818.968 800.000 11 272.989,39 409.484 400.000 12 136.494,69 204.742 200.000 13 68.247,35 102.371 100.000 14 34.123,67 51.186 50.000 15 17.061,84 25.593 25.000 16 8.530,92 12.796 12.500 17 4.265,46 6.398 6.000 18 2.132,73 3.199 3.000 19 1.066,36 1.600 1.500 20 533,18 800 800 21 266,59 400 400 22 133,30 200 200 23 66,65 100 100

Slide 28

Slide 28 text

Issue: the editor is too small FOSS4G 2019, August 26th/30th, Bucharest

Slide 29

Slide 29 text

Solution: side by side fullscreen editor FOSS4G 2019, August 26th/30th, Bucharest

Slide 30

Slide 30 text

Issue: scale dependencies verbosity FOSS4G 2019, August 26th/30th, Bucharest [@sd <= 400k] { [feature = 'highway_motorway'] { stroke-width: 5; [@sd < 200k] { stroke-width: 5.5; } [zoom < 100k] {stroke-width: 7; } ….

Slide 31

Slide 31 text

Approach: use transform functions FOSS4G 2019, August 26th/30th, Bucharest [@sd < 400k] { ... stroke-width: categorize(@sd, 9, 50k, 7, 100k, 5.5, 200k, 5); }

Slide 32

Slide 32 text

Issue: SVG icons colorized at runtime FOSS4G 2019, August 26th/30th, Bucharest

Slide 33

Slide 33 text

Approach: SVGs as marks FOSS4G 2019, August 26th/30th, Bucharest [type = 'fast_food'][@sd < 6k] { mark: symbol('file://symbols/fast_food.svg'); mark-size: 10; :mark { fill: #734a08 }; };

Slide 34

Slide 34 text

Issue: CSS translation times FOSS4G 2019, August 26th/30th, Bucharest

Slide 35

Slide 35 text

First approach: profile and optimize FOSS4G 2019, August 26th/30th, Bucharest

Slide 36

Slide 36 text

Going flat FOSS4G 2019, August 26th/30th, Bucharest

Slide 37

Slide 37 text

Flat mode FOSS4G 2019, August 26th/30th, Bucharest

Slide 38

Slide 38 text

Map is nice, but really slow FOSS4G 2019, August 26th/30th, Bucharest

Slide 39

Slide 39 text

Pregeneralized for the win FOSS4G 2019, August 26th/30th, Bucharest

Slide 40

Slide 40 text

Give me eyes on the target! FOSS4G 2019, August 26th/30th, Bucharest

Slide 41

Slide 41 text

Issues found, round one FOSS4G 2019, August 26th/30th, Bucharest

Slide 42

Slide 42 text

Issues found, round two FOSS4G 2019, August 26th/30th, Bucharest

Slide 43

Slide 43 text

And here we are! FOSS4G 2019, August 26th/30th, Bucharest

Slide 44

Slide 44 text

That's all folks FOSS4G 2019, August 26th/30th, Bucharest

Slide 45

Slide 45 text

That's all folks FOSS4G 2019, August 26th/30th, Bucharest Really, didn't you forget anything???

Slide 46

Slide 46 text

Aaah, yeah, the styles! FOSS4G 2019, August 26th/30th, Bucharest • https://github.com/geosolutions-it/osm- styles

Slide 47

Slide 47 text

That’s all folks! (for good this time) Questions? [email protected]