Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Standing up an OSM clone with GeoServer and CSS

Standing up an OSM clone with GeoServer and CSS

This presentation cover the work done by GeoSolutions to create an OSM clone using GeoServer and GeoCSS styling.

Notice that the underlying styling has been released during this presentation.

Bac74c17d65c22d0ae63915251f7750f?s=128

Simone Giannecchini

August 30, 2019
Tweet

Transcript

  1. Standing up an OSM clone with GeoServer and CSS Ing.

    Andrea Aime GeoSolutions
  2. 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
  3. What are we talking about?

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

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

    Bucharest
  6. 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
  7. What's behind it? FOSS4G 2019, August 26th/30th, Bucharest { }

    GeoCSS Imposm3
  8. Motivation and history

  9. 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
  10. Why start a new attempt FOSS4G 2019, August 26th/30th, Bucharest

  11. 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"
  12. Going beyond the comfort zone FOSS4G 2019, August 26th/30th, Bucharest

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

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

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

  16. Choosing the "right" style

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

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

    https://github.com/openmaptiles/osm- bright-gl-style
  19. Side by side comparison FOSS4G 2019, August 26th/30th, Bucharest OSM

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

    OpenMaptiles
  21. Different objectives FOSS4G 2019, August 26th/30th, Bucharest

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

  23. Challenges

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

  25. 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;
  26. 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
  27. 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
  28. Issue: the editor is too small FOSS4G 2019, August 26th/30th,

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

    Bucharest
  30. 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; } ….
  31. Approach: use transform functions FOSS4G 2019, August 26th/30th, Bucharest [@sd

    < 400k] { ... stroke-width: categorize(@sd, 9, 50k, 7, 100k, 5.5, 200k, 5); }
  32. Issue: SVG icons colorized at runtime FOSS4G 2019, August 26th/30th,

    Bucharest
  33. 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 }; };
  34. Issue: CSS translation times FOSS4G 2019, August 26th/30th, Bucharest

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

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

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

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

    Bucharest
  39. Pregeneralized for the win FOSS4G 2019, August 26th/30th, Bucharest <?xml

    version="1.0" encoding="UTF-8"?> <GeneralizationInfos dataSourceName="osm" dataSourceNameSpace="osm" version="1.0"> <!-- ROADS --> <GeneralizationInfo geomPropertyName="geometry" baseFeatureName="osm_roads" featureName="roads"> <Generalization geomPropertyName="geometry" featureName="osm_roads_gen0" distance="200"/> <Generalization geomPropertyName="geometry" featureName="osm_roads_gen1" distance="50"/> </GeneralizationInfo> </GeneralizationInfos>
  40. Give me eyes on the target! FOSS4G 2019, August 26th/30th,

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

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

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

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

  45. That's all folks FOSS4G 2019, August 26th/30th, Bucharest Really, didn't

    you forget anything???
  46. Aaah, yeah, the styles! FOSS4G 2019, August 26th/30th, Bucharest •

    https://github.com/geosolutions-it/osm- styles
  47. That’s all folks! (for good this time) Questions? info@geo-solutions.it