AliFlux / VectorTileRenderer

A comprehensive Vector Map Tile Renderer for .Net/C#
MIT License
183 stars 51 forks source link

map rendering using Pbf file #16

Closed anushabasavaraj92 closed 3 years ago

anushabasavaraj92 commented 4 years ago

Hi,

There is a sample on how to render the map from mbtiles in a wpf project. Is there a similar way to render the map from pbf file in wpf project?

AliFlux commented 4 years ago

Hi,

Check out the Static.Demo.WPF project, it renders map from pbf file

anushabasavaraj92 commented 4 years ago

I tried the ShowPbf function with another pbf file and I am getting an exception error "Tag out of bounds" , when the function calls Render function. I am not sure what is the reason for it.

AliFlux commented 4 years ago

Can you share the pbf file here? And the code that you used as well

anushabasavaraj92 commented 4 years ago

I have used the pbf file downloaded from below link:

http://download.geofabrik.de/asia/india.html

I copied the downloaded file, "India-latest.osm.pbf" to the tiles folder of the project and modified the MainWindow() constructor as below:

    public MainWindow()
    {
        InitializeComponent();

        showPbf(mainDir + @"tiles/india-latest.osm.pbf", mainDir + @"styles/basic-style.json", 14);
    }
AliFlux commented 4 years ago

You're using a different type of pbf. The dataset available at geofabrik is raw osm vector data, not the tiled vector data.

You can download vector tiles at https://openmaptiles.org/

anushabasavaraj92 commented 4 years ago

Is there a way to render the tiled vector data from the raw osm vector data? The below link only has mbtiles format. Regards,Anusha

Sent from Yahoo Mail on Android

On Sat, 4 Jul 2020 at 12:29 am, Ali Ashrafnotifications@github.com wrote:

You're using a different type of pbf. The dataset available at geofabrik is raw osm vector data, not the tiled vector data.

You can download vector tiles at https://openmaptiles.org/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

AliFlux commented 4 years ago

The raw vector data (.pbf at geofabrik) is converted to tiled vector data (.mbtiles at openmaptiles) using software such as tilelive and tippecanoe.

You can use the mbtiles with the VectorTileRenderer directly. Check out the examples in the solution

anushabasavaraj92 commented 4 years ago

Thank you. I have successfully used mbtiles. I had one more query, Is there a way to modify disputed international borders according to the country in mbtiles?

Sent from Yahoo Mail on Android

On Sat, 4 Jul 2020 at 1:38 am, Ali Ashrafnotifications@github.com wrote:

The raw vector data (.pbf at geofabrik) is converted to tiled vector data (.mbtiles at openmaptiles) using software such as tilelive and tippecanoe.

You can use the mbtiles with the VectorTileRenderer directly. Check out the examples in the solution

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

AliFlux commented 3 years ago

@anushabasavaraj92 it is possible. But you'll have to modify the style.json accordingly