Vector tiles tutorial — GeoServer 2.21.x User Manual
文章推薦指數: 80 %
Vector tile formats¶. GeoServer can also produce vector tiles in three formats: GeoJSON, TopoJSON, and MapBox Vector (MVT). These are also supported by ... GeoServer About Blog Download Documentation GeoServer2.21.xUserManual» Extensions» VectorTiles» Vectortilestutorial Next Previous| Vectortilestutorial¶ ThistutorialwillshowhowtousetheGeoServervectortilesoutput. Whyusevectortiles?¶ Theadvantagesofvectortilesare; Renderingisdonebytheclient(forexample,OpenLayers),notbytheserver.Thisallowsdifferentmaps/applicationstostyleamapdifferentlywithouthavingtoreconfigureGeoServer. Thesizeofavectortileisusuallysmallerthananimagetile,resultinginfasterdatatransferandlowerbandwidthusage. GeoWebCache,embeddedwithGeoServerefficientlystoresthevectortiledata.Sincestylingisdonebytheclient,nottheserver,GeoWebCacheonlyneedstostoreonetileforalldifferentstyles. Becausethevectordataisavailableontheclient,veryhigh-resolutionmapscanbedrawnwithoutcorrespondingincreasesinbandwidth. Theclienthasnativeaccesstotheactualfeatureinformation(attributesandgeometry),allowingforverysophisticatedrendering. Ontheotherhand,themaindisadvantageofvectortilesisthatthegeographicdatamayneedtobepre-processedtoallowtheclienttodothedrawingsitrequires(similartopreprocessingdataforimagemaps).Withthisinmind,vectortilesshouldonlybeusedforrendering. Vectortileformats¶ GeoServercanalsoproducevectortilesinthreeformats:GeoJSON,TopoJSON,andMapBoxVector(MVT).ThesearealsosupportedbyOpenLayersandotherclients. Warning Whenusingvectortiles,besuretouseanup-to-dateclient.Olderclientsdonotsupportallvectortilescapabilitesandmayresultinrenderingerrors.WerecommendusingthelatestversionofOpenLayers(Currentlyv5.3.0). MVTisthepreferredformatforproduction. MapBoxVector(MVT) application/vnd.mapbox-vector-tile RecommendedFormatThisisanefficientbinaryformatthatiswidelysupportedbyalmostallVectorTileapplications. GeoJSON application/json;type=geojson ThisisahumanreadableJSONformat.Althoughmanygeo-spatialapplicationssupportGeoJSONdatasets,fewVectorTileapplicationssupporttilesinthisformat.SupportedbyOpenLayers3. TopoJSON application/json;type=topojson Thisisaverycomplex,butsomewhathumanreadableJSONformatthatisgoodforpolygoncoverages.ItisnotawidelysupportedandveryfewVectorTileapplicationssupportit.SuportedbyOpenLayers3. PublishvectortilesinGeoWebCache¶ We’llbepublishingourvectortilesthroughGeoWebCacheandpublishingthelayerinacustomOpenLayersapplication. Forthistutorial,we’llbeusingthelayeropengeo:countriestoshowoffthecapabilities,thoughwithslightmodifications,anylayerwilldo. Note DownloadtheAdmin0-Countriesshapefileandpublishthelayerasopengeo:countries. IntheGeoServeradmininterface,clickTileLayersunderTileCaching. TileLayers¶ Clickopengeo:countriesinthelistoflayers. Bydefaultthetileformatsareimage/jpegandimage/png.Checktheboxesforthefollowingvectortileformats: application/json;type=geojson application/json;type=topojson application/vnd.mapbox-vector-tile Vectortilestileformats¶ ClickSave. Ourlayerisnowreadytobeserved. CreateOpenLayersapplication¶ Createawww/vectortilesdirectoryinsideyourGeoServerDataDirectory. DownloadthelatestversionofOpenLayers. Extractthefollowingfilestofromthedownloadedarchivetothedirectorycreatedinstep1: ol.js ol-debug.js ol.css Inatexteditor,createanewfilewiththefollowingcontent:
MapboxProtobuf-vectortiles
延伸文章資訊
- 1Mapbox Vector Tile specification - GitHub
Mapbox Vector Tile Specification. A specification for encoding tiled vector data. License. The te...
- 2Vector tiles tutorial — GeoServer 2.21.x User Manual
Vector tile formats¶. GeoServer can also produce vector tiles in three formats: GeoJSON, TopoJSON...
- 3@mapbox/vector-tile - npm
@mapbox/vector-tile. 1.3.1 • Public • Published 4 years ago. Readme · Explore BETA · 1 Dependency...
- 4mapbox/vector-tile-js - GitHub
Parses vector tiles with JavaScript. Contribute to mapbox/vector-tile-js development by creating ...
- 5Unlimited private tilesets available for all users - Mapbox blog