Mapbox Vector Tile (MVT). Reads single files from the local file system. The reader can also accept URLs and read single files or entire tilesets when the URL ...
SkipToMainContent
Account
Settings
Logout
placeholder
Account
Settings
Logout
Filter:
AllFiles
SubmitSearch
MapboxVectorTile(MVT)andMVT TilesetReader/Writer
LicensingoptionsforthisformatbeginwithFME DesktopProfessionalEdition.
Overview
FMEprovidesreadandwriteaccessforMapboxVectorTile(MVT)tilesandtilesets.FME canreadfromawebaddress,alocalfile,oralocalfolder;andcanwritetoalocalfolder.
Tilesarespatiallyrelatedcollectionsofvectorfeaturesthatcanbestoredononeormorelayers.Tilescanalsobestoredingroupscalledtilesetsthatcontaintilesatthesamezoomlevel.Thetilesarecontainedwithin.mvtfilesorcompressed.mvt.gzfiles.
Layersareusedtosemanticallygroupdifferentvectorfeatures,andtheycanspanmultipletiles(forexample,rivers,roads,orvectorfeatureswithinacity).
ReaderOverview
TheMVTreadersupportsreadingmultipleoneormorevectortilesfromaURLorlocalfilesystem.Eachtilemaycontainanynumberofvectorfeaturesofanysupportedgeometrytype,whichthenbecomefeaturesinFME.
ThevectorfeaturesareclassifiedintodifferentlayerswhosenamesandattributesbecomefeaturetypenamesandattributesinFME.Layerscanbedefinedinanoptionalmetadata.jsonfileattherootofatilesetwhichisreadautomaticallywhentilesareconfiguredinatilescheme.
TworeadersexistfordifferenttypesofMVTdatasets:MapboxVectorTile(MVT),andMapboxVectorTile(MVT)Tileset.Thefeaturesofeachreaderaredescribedinthetablebelow.
MapboxVectorTile(MVT)
Readssinglefilesfromthelocalfilesystem.ThereadercanalsoacceptURLsandreadsinglefilesorentiretilesetswhentheURLonlyspecifiesazoomlevel.Forexample,https://b.tiles.mapbox.com/v4//15willreadallthetilesinthespecifiedmapatzoomlevel15.
SelectthereaderMapboxVectorTile(MVT)whenthedatasetisafileorURL:
Filewiththeextensions.mvtor.mvt.gz.
URLaddresstoatileoratileset(forexample,http[s]://path/to/some.mvtforasingletileandhttp[s]://path/to/{Z}foratileset,whereZisthedesiredzoomlevel).
MapboxVectorTile(MVT)Tileset
Readstilesetsthatareinthespecifieddirectoryzoomlevel.Thedirectoryhierarchyforatilesetmustconformtothestructurespecifiedintheformatusagenotes–otherwise,themetadatamaynotbereadcorrectly.
SelectthereaderMapboxVectorTile(MVT)Tilesettoreadalocalfolder.
Eachlayerinthevectortilecorrespondswithitsownfeaturetype.Atilemayhavemultiplelayersandthereforemultiplefeaturetypes.
Dataset
ThedatasetcanbeanMVTfilewithextension.mvtor.mvt.gz,oritcanbeaURLaddresstoatileoratileset(forexample,http[s]://path/to/some.mvtforasingletileandhttp[s]://path/to/{Z}foratileset,whereZisthedesiredzoomlevel).
SeeUsageNotesforfurtherinformation.
WriterOverview
TheMVTwritergeneratestilesintheWebMercator(EPSG:3857)projectionbydefault.
Thewriteracceptsinputvectorfeaturesfromvariouslayersandtilesthemupintoabasezoomlevel.Subsequentlower-resolutionzoomlevelsmayalsobegeneratedfromthebasezoomlevel.Eachzoomlevelisauniquetilesetthatcanbereadtogether,orasindividualtiles.Severalsemanticlayersofvectorfeaturesmaybewrittentoeachfileandzoomlevel.
Dataset
Thedatasetisanoutputfolderintowhichthewriterwillcreateonetilesetperapplicablezoomlevelrequestedinthenewfolder.
Note:IfOverwriteFolderissettoYes,theoutputfolderisdeletedandrecreatedtopreventincorrecttilesetcreationwhenreusingtheexistingfolder.Thismeansexistingdatainthefolderwillbedeleted.(IfOverwriteFolderissettoNo,thewriterwillreturnanerrorifthedatasetisanon-emptyfolder.)
ThesefolderscorrespondtotheMVTtiledirectoryspecification,/{Z}/{X}/{Y}.,where{Z}isazoomlevelbetween0and22,and{X}and{Y}arethetileindexeswithinthetilespecification.
Example
TheMVTwriterreceivesinputvectordataforcountriesoftheworld,andhasthefollowingparameters:
anoutputdatasetofc:/output,
minandmaxzoomlevelsof0and0,and
atileextensionof.mvt.
Wewouldexpectthefollowingoutputfolderandfiles:
c:/output/0/0/0.mvt
c:/output/0/0/1.mvt
c:/output/0/0/2.mvt
c:/output/0/0/3.mvt
c:/output/0/1/0.mvt
c:/output/0/1/1.mvt
c:/output/0/1/2.mvt
c:/output/0/1/3.mvt
SeeUsageNotesforfurtherinformation.
Toreadatilesetinalocalfolder,pleaseusetheMapboxVectorTile(MVT)Tilesetreader,whichacceptsfoldersasdatasets.NotethatwhiletheMVTwritercreatesmultipletilesets,theMVTreadertypicallyonlyreadsoneatatime.
AreOpenStreetMapPBFfilesrelatedtoMapboxVectorTiles?
Theyarenotrelated.PBFsareaformat–muchlikeXML–andcantakemanyforms.MapboxVectorTilesandOpenStreetMapPBFsareprotobuffiles,buttheyconformtodifferentspecificationsandprotobufschemas,andtheyareusedindifferentways.FME doesnotusethisextension,butotherMVT providersmight.
HowFMEWorkswithMVTData
Toaccessvectordata,ithelpstosubdividethedataintosmallertilesaccordingtoawell-knowntilingscheme,andstoreeachtile.MapBoxhascreatedtheMVTtileschematostoretilesandtilesetsatdifferentzoomlevelsandaccessthemoneitheraserverorlocalhost.Thesetilesarestoredinefficientprotocolbufferfiles,vectortilesfiles,orcompressedvectortilesfiles.SeeGDAL Documentation–MVTformoreinformationonMVTfilestructure.
FMEcanreadandanalyzeindividualtilesortilesets,filterthem,organizethem,andthenoutputtheresultsintoanewtileset,oranyothervectorformat.FMEcanalsointegratevectorfeaturedatafromotherformats(forexample,GIS,CAD,oranyothervectordata)intoaneworexistingtileset.
TerminologyinthisChapter
Term
DefinitionorFME Representation
tile
readerdataset
tileset
readerorwriterdataset
layer
featuretype
field/attribute
attribute
feature
feature
UsageNotes
FMEsupportsreadingMapBoxVectorTilesspecificationversion1.xand2.x,andwritingversion2.1.
TheMVTreaderusesthreeintegercoordinates,wherezisthezoomleveland(x,y)isthecoordinateofthetileinthezoomlevel.
TheMVTwriterusesthejsonkeyfromthemetadata.jsonfiletopopulatefeaturetypenames,attributenamesandtypes,andthegeometrytype.Theboundskeyisalsousedforthefeaturetypeextents.Allothercontentsofthemetadata.jsonfileareunused.Ifametadata.jsonfilecannotbefound,thefeaturetypeschemaisestablishedbyscanningthefeaturesofthetile(s).
Ifametadata.jsonfilecannotbefound,thefeaturetypeschemaisestablishedbyscanningthefeaturesofthetile(s).
Eachlayerinthevectortilecorrespondstoitsownfeaturetype.ATilemayhavemultiplelayers,andthereforemultiplefeaturetypes.