Changes between Initial Version and Version 1 of MapGuideRfc177


Ignore:
Timestamp:
Sep 23, 2019, 6:25:38 PM (5 years ago)
Author:
jng
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc177

    v1 v1  
     1
     2= !MapGuide RFC 177 - Mapbox Vector Tile (MVT) support =
     3
     4This page contains a change request (RFC) for the !MapGuide Open Source project.
     5More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page.
     6
     7== Status ==
     8
     9||RFC Template Version||(1.0)||
     10||Submission Date||24 Sep 2019||
     11||Last Modified||||
     12||Author||Jackie Ng||
     13||RFC Status||draft||
     14||Implementation Status||pending||
     15||Proposed Milestone||4.0||
     16||Assigned PSC guide(s)||(when determined)||
     17||'''Voting History'''||(vote date)||
     18||+1||||
     19||+0||||
     20||-0||||
     21||-1||||
     22||no vote|| ||
     23
     24== Overview ==
     25
     26This RFC proposes to add support for the rendering and storage/retrieval of Mapbox Vector Tiles
     27
     28== Motivation ==
     29
     30Vector tiles are a way to deliver geographic data in small chunks to a browser or other client application.
     31
     32Vector tiles are similar to raster tiles, but instead of raster images, the data returned is a vector representation of the features in the tile.
     33
     34Vector tiles relieves the burden of rendering/stylization on the MapGuide Server as stylization is now a responsibility of client mapping applications, allowing for
     35much richer and interactive user/application experiences as in this case, the MapGuide Server only has to focus on the encoding and delivery of vector tiles.
     36
     37Some factors that had delayed support for vector tiles in MapGuide include:
     38
     39 1. The lack of consensus around a "standard" for vector tiles. Over time, it is clear that [https://docs.mapbox.com/vector-tiles/reference/ Mapbox Vector Tiles] is now the clear de-facto standard for vector tiles.
     40 2. The eco-system of suitable MVT encoding libraries in C++ demanding a C++11 compliant compiler at a bare minium in order to consume said libraries.
     41 
     42With the recent change to adopt C++11 in [wiki:MapGuideRfc172 MapGuide RFC 172], we now have the opportunity to finally add vector tiles support in MapGuide.
     43
     44== Proposed Solution ==
     45
     46This RFC will implement support for Mapbox Vector Tiles by re-using the [https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrsf_frmts/mvt/mvt_tile.h MVT tile encoder] from the MVT driver in GDAL/OGR.
     47
     48A new API will be added to MgRenderingService for the rendering of MVT tiles.
     49
     50{{{
     51class MG_MAPGUIDE_API MgRenderingService : public MgService
     52{
     53PUBLISHED_API:
     54    /////////////////////////////////////////////////////////////////
     55    /// \brief
     56    /// Returns the specified MVT (Mapbox Vector Tile) for the given map. Tile structure is
     57    /// based on the XYZ tiling scheme used by Google Maps, OpenStreetMap, and
     58    /// others
     59    ///
     60    /// \param map
     61    /// Input
     62    /// map object containing current state of map.
     63    /// \param baseMapLayerGroupName
     64    /// Input
     65    /// Specifies the name of the baseMapLayerGroup for which to render the tile.
     66    /// \param x
     67    /// Input
     68    /// Specifies the row index of the tile to return.
     69    /// \param y
     70    /// Input
     71    /// Specifies the column index of the tile to return.
     72    /// \param z
     73    /// Input
     74    /// Specifies the zoom level of the tile to return.
     75    /// \param dpi
     76    /// Input
     77    /// Specifies the dpi of the tile to return.
     78    /// \param tileImageFormat
     79    /// Input
     80    /// Specifies the image format of the tile to return.
     81    ///
     82    /// \return
     83    /// A byte reader containing the rendered tile image.
     84    ///
     85    /// \since 4.0
     86    virtual MgByteReader* RenderTileMVT(
     87        MgMap* map,
     88        CREFSTRING baseMapLayerGroupName,
     89        INT32 x,
     90        INT32 y,
     91        INT32 z,
     92        INT32 dpi) = 0;
     93};
     94}}}
     95
     96The mime type of the vector tile content will be `application/vnd.mapbox-vector-tile`, defined in a new `MgMimeType::Mvt` constant.
     97
     98The server-side implementation of this API taps into a new `MVTRenderer` in the Renderers project. The `MVTRenderer` is basically the adapter between the Rendering/Stylization engine and MVT tile encoder.
     99
     100We will leverage the tile set definition infrastructure introduced in [wiki:MapGuideRfc140 MapGuide RFC 140] to add support for MVT tiles.
     101
     102MVT tile geometry will always be in web mercator (`EPSG:3857`) coordinates. Thus all vector data will be reprojected to `WGS84.PseudoMercator` when rendering MVT tiles and will incur the usual re-projection overheads for data not already in `WGS84.PseudoMercator`
     103
     104Support for MVT tiles is exposed through the new {{{TileFormat}}} of {{{MVT}}} in the existing {{{XYZ}}} tile provider.
     105
     106Retrieval of MVT tiles is achieved through the existing {{{GETTILEIMAGE}}} mapagent operation version {{{1.2.0}}}, with the {{{MAPDEFINITION}}} parameter pointing to a Tile Set Definition resource configured:
     107
     108 * With the {{{XYZ}}} tile provider
     109 * With the {{{TileFormat}}} of {{{MVT}}}
     110
     111Features that span multiple MVT tile boundaries will be clipped at the tile boundaries.
     112
     113None of our existing viewer offerings will be updated to take advantage of Mapbox Vector Tiles. It is expected the main adopters of this feature when implemented are custom map viewers.
     114
     115This implementation resides in the [http://trac.osgeo.org/mapguide/browser/sandbox/jng/mvt_alt mvt_alt sandbox]. Upon adoption of this RFC, it will be merged into trunk.
     116
     117== Implications ==
     118
     119A Tile Set Definition using the {{{XYZ}}} provider and a {{{TileFormat}}} of {{{MVT}}} can only be used on versions of MapGuide on/since the introduction of this RFC.
     120
     121== Test Plan ==
     122
     123Add unit tests for rendering MVT tiles, compare with image-based XYZ tiles at the same X/Y/Z coordinates for "visual" verification of MVT content.
     124
     125== Funding / Resources ==
     126
     127Community