bbest / terrapulse

TerraPulse graphical user interface (GUI), rapid application development (RAD) style
http://benbestphd.com/terrapulse/
4 stars 1 forks source link

handle big polygons #8

Open bbest opened 6 years ago

bbest commented 6 years ago

Efficiently handle many/big polygons with WMS and SLD in GeoServer.

Use GeoServer to efficiently handle many/big polygons with many vertices so GUI doesn't send individual vertices to client, which for polygons with many vertices becomes unwieldy and slow. The fastest way I know is to overlay a WMS png, which could be styled with a style layer descriptor (SLD).

image

bbest commented 6 years ago

Shiny alternative:

bbest commented 6 years ago

Vector Tiles

Leaflet Vector Tiles // Speaker Deck

image

rstudio/leaflet migrating 0.7 to 1.2

NOTE: RStudio/leaflet is still on leaflet 0.7, which does not support vector tiles, but close to migrating...

Red Cross Example

https://github.com/AmericanRedCross/GeoForce

This is the front-end JavaScript application that utilizes AngularJS, Leaflet, and Bootstrap.

bbest commented 6 years ago

GeoServer Vector Tiles

var style_highlighted = new ol.style.Style({
   fill: new ol.style.Fill({
     color: 'yellow'
   }),
   stroke: new ol.style.Stroke({
     color: '#880000',
     width: 1
   })
 });

//...

 function simpleStyle(feature) {
   if (feature.get("region_un") == "Africa") {
     return style_highlighted;
   }
   return style_simple;
 }

Vector tile output with Africa highlighted

bbest commented 6 years ago

working

other

bbest commented 6 years ago

t-rex

http://t-rex.tileserver.ch/ Create and serve your own vector tiles

image

Serve vector tiles

Generate vector tiles

Easy to Use

bbest commented 6 years ago

MapZen Vector Tiles

This likes the way to go in future:

Vector Tile Service · Mapzen:

The Mapzen vector tile server uses the familiar slippy tile zoom/x/y URL format:

http://tile.mapzen.com/mapzen/vector/v1/{layers}/{z}/{x}/{y}.{format}?api_key={api_key}

Note: uses standard {y}, not {-y} like GeoServer, which means don't need {-y} tms hack in Leaflet.MapboxVectorTile like I implemented in https://github.com/bbest/leaflet.extras.

Mapzen Pricing:

MAPS - Vector tiles & display

Documentation

Setting up your own MVT Server