charlenni / Mapsui.VectorTiles

Library for handling vectore tiles in Mapsui
10 stars 1 forks source link

Global architecture #1

Open pauldendulk opened 7 years ago

pauldendulk commented 7 years ago

I see that Mapsui.Vector.Tiles is used by the Mapsforge and Mapbox. Do Mapsforge and Mapbox have a similar function?

Also Mapbox vector tiles now has a dependency on Mapsui.VectorTiles. Have you tried to prevent this dependency?

image

charlenni commented 7 years ago

Thank you, coming back to this.

Most of the libraries call their file format same as the UI. Mapbox is a vector file format and a UI library. The same is Mapsforge. It is an often used file format on Android, because the UI library, using the files is free and good. So to answer your question: yes, both are similar. Both contain data organized in tiles of different layers with features in it. Each feature has one or more geometries and key-value-pairs (tags) with informations of types of the feature. So it should be possible, to use both for this. The differences are the file format: Mapbox uses SQLite, Mapsforge is a binary format.

If you want to handle more than one file format (there are even more file format out there), than you have to use a common representation for the data. And this is Mapsui.VectorTiles.

The question is, how to do this all. You should have a method, that returns for a given tile alle features on all layers with the corresponding tags. This informations should than converted by a styler (could be MapCSS or any other style format out there) to the correct information for Mapsui. So the styler should know the VectorTile Feature format and the Mapsui Feature format. So created Mapsui Features than could be drawn on the device.

charlenni commented 6 years ago

@pauldendulk I added today a first sample to show data from a mapsforge map file on a map. It uses data from Andorra and draws only geometries of features on the map. There isn't any styling.

I think, we should talk about some parts of the vector tlies code. I changed the code a bit, to make clearer, for what it is used. At the end, there should be

There are some parts from BruTile (tile handling) and from Mapsui.Geometries.

I would be happy, if you could think about the concept and if you want to have something else. Perhaps Mark could think about this too. @radderz, are you interessted in adding an online/offline vector map to Mapsui?

pauldendulk commented 6 years ago

Sorry, I missed your earlier reply from august, and have done some work myself in the vector-tile branch of Mapsui in a period that you were not active in the project. We should have had more contact about this.

The vector-tile branch is actually quite far. It basically 'works'. The reason that it is not in master is that it needs .NET Standard. Not really blocking but would like to merge it once Mapsui is .NET Standard. Also performance is bad for pure vectors (but can be improved). The rasterized vector tile solution is acceptable.

Mapsforge is not supported in the vector-tile branch.

I'll get back with more specific replies later.

charlenni commented 6 years ago

That's really bad. The good thing is, that we did it on different ways. You convert the vector data to an image, I convert the vector data to features depending on zoom level and draw them each time on screen.

vherbst commented 1 year ago

Hi, I'm using Mapsui for some time and have written an own postgis provider for it which does work quite well but is of course dependent on a database connection. As postgis can serv vector tiles (there are quite a few vector tile server out there as well) I would prefer this path as I could be independent from the direct database connection. I cant see any samples for the moment in Mapsui how to consume mvt files or services. Is there a path forward and which version of your different implementations is the preferred one? May be I could also get involved a bit if necessary.