The Map Guy(de): Solving the XYZ problem in MapGuide

Heck!That slightly blows my mind... accessible FDO, data agnostic map server with MapGuide stylisation delivering to a range of clients and vector layers too!One of the issues we always had (and hack around with an HTTP tile mod in the .TEMPL files) is that creating a session map always created session tiles - even if Tiled and hence removed the benefits of tiled optimisations. The XYZ problem for those wondering, was how to consume tiled maps in MapGuide as XYZ layers (ala. Google Maps, OSM, etc). For the longest time, my line of thinking was that there must've been some kind of black magic mathematics involved that allowed us to translate X, Y and Z into Row, Column and ScaleIndex parameters that the MapGuide Tile APIs use. Well unfortunately that went nowhere. The two tile schemes are not inherently translatable, so I went back to the drawing board. After Given a bounding box, we now have the means to render whatever lies within that bounding box with the MapGuide API. If necessary, we can also transform this bounding box into map coordinate space using the MgCoordinateSystem APIs. Now unfortunately, we cannot use the existing Tile APIs in MapGuide to render XYZ tiles because they only accept row, column and scaleindex and not a bounding box. In addition, parameters such as tile size and image formats are locked to whatever's globally defined in serverconfig.ini. So to produce XYZ tiles we use a different primitive for tile rendering: The RenderMap API. For our test, we made a tiled version of the Sheboygan Map using the web mercator (WGS84.PseudoMercator) coordinate system. If you cross reference these tiles against the above grid on maptiler, you'll find that the MapGuide-rendered XYZ tiles do indeed line up with the Google ones, which tells us that our XYZ tile rendering implementation is working. Yay! So what does this mean now that we have the means to serve XYZ tiles? It means your maps can be consumed by a greater range of clients. How can we produce vector tiles? We simply take that same bounding box computed from our XYZ parameters and instead of rendering an image, we run a series of FDO queries with that bounding box and write out the appropriate for all features into a GeoJSON 'tile' file and serve that file out. For optimal performance and size, we should actually be using solve that problem. Let's just focus on making MapGuide deliver the required data to ol3 in the desired format in the most efficient manner. That slightly blows my mind... accessible FDO, data agnostic map server with MapGuide stylisation delivering to a range of clients and vector layers too! One of the issues we always had (and hack around with an HTTP tile mod in the .TEMPL files) is that creating a session map always created session tiles - even if Tiled and hence removed the benefits of tiled optimisations. Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: November 28, 2014 @ 12:00 am