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.

Simone Giannecchini

August 30, 2019
Tweet

More Decks by Simone Giannecchini

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. 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"
  4. 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;
  5. 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
  6. 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
  7. 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; } ….
  8. Approach: use transform functions FOSS4G 2019, August 26th/30th, Bucharest [@sd

    < 400k] { ... stroke-width: categorize(@sd, 9, 50k, 7, 100k, 5.5, 200k, 5); }
  9. 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 }; };
  10. 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>
  11. Aaah, yeah, the styles! FOSS4G 2019, August 26th/30th, Bucharest •

    https://github.com/geosolutions-it/osm- styles