Need help to run .mvt files

23 views
Skip to first unread message

Vijay Sapkal

unread,
Dec 15, 2020, 4:59:12 AM12/15/20
to data...@googlegroups.com
Hello team,

I need help to run .mvt file. Is it possible for anyone to do it quickly for me?
Waiting for your reply,

Thanks,
Vijay
censuswardboundary_719_456.mvt
adminwardboundary_719_457.mvt
censuswardboundary_719_457.mvt
adminwardboundary_719_456.mvt
electionwardboundary_719_456.mvt
electionwardboundary_719_457.mvt

Souvik Sankar Mitra

unread,
Dec 15, 2020, 5:06:47 AM12/15/20
to data...@googlegroups.com
Open it in QGIS. Then export it in other formats. 

--
Datameet is a community of Data Science enthusiasts in India. Know more about us by visiting http://datameet.org
---
You received this message because you are subscribed to the Google Groups "datameet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datameet+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/datameet/CA%2BzgrCRqt1oYTuof%2BnhMsVsSX%3DEVKHdctO-k%2BmGahH2fU86CeA%40mail.gmail.com.

Vijay Sapkal

unread,
Dec 15, 2020, 5:19:53 AM12/15/20
to data...@googlegroups.com
Thank you, l'll try and get back to you. 

Vijay Sapkal

unread,
Dec 15, 2020, 5:33:04 AM12/15/20
to data...@googlegroups.com
Hey, while running this file in QGIS, it is asking me to select CRS (coordinate reference system), which one I should select for this file?

Souvik Sankar Mitra

unread,
Dec 15, 2020, 5:55:53 AM12/15/20
to data...@googlegroups.com
I think EPSG: 4326 is a good option. Means WGS84 

Vijay Sapkal

unread,
Dec 15, 2020, 6:25:18 AM12/15/20
to data...@googlegroups.com
Hello,
When I am searching EPSG: 4326 and selecting it to run file. It is not showing any result.  
I am not able to see any point/line/polygon. Please help. 

Thanks,
Vijay

Arun Ganesh

unread,
Dec 15, 2020, 1:34:54 PM12/15/20
to data...@googlegroups.com
It’s hard to know what’s happening without looking at the actual mvt. Where did you get it from?

Dilawar Singh

unread,
Dec 15, 2020, 4:12:04 PM12/15/20
to datameet

It doesn't look like GDAL is capable of converting MVT with 3d values to GeoJSON. Most of your GIS software uses gdal behind the scene for conversion.
[dilawars@chutki Downloads]$ ogr2ogr -f GeoJSON a.geojson censuswardboundary_719_456.mvt 
ERROR 1: Layer 'censuswardboundary_label' does not already exist in the output dataset, and cannot be created by the output driver.
ERROR 1: Terminating translation prematurely after failed
translation of layer censuswardboundary_label (use -skipfailures to skip errors)
Try https://gis.stackexchange.com/ for better luck.

best,
   Dilawar

Dilawar Singh

unread,
Dec 15, 2020, 4:36:08 PM12/15/20
to datameet
On a bit more exploration.


Example:

$ python3 mvt2json.py ~/Downloads/censuswardboundary_719_456.mvt
{'censuswardboundary': {'extent': 4096, 'version': 2, 'features': [{'geometry': {'type': 'Polygon', 'coordinates': [[[131, 3552], [172, 3525], [187, 3518], [204, 3496], [220, 3497], [231, 3500], [275, 3503], [317, 3502], [318, 3498], [322, 3497], [326, 3489], [329, 3488], [323, 3479], [328, 3468], [327, 3459], [338, 3461], [345, 3459], [355, 3453], [391, 3421], [437, 3370], [447, 3354], [470, 3331], [485, 3318], [501, 3309], [539, 3297], [556, 3293], [572, 3288], [570, 3277], [561, 3254], [558, 3237], [555, 3233], [554, 3224], [547, 3204], [541, 3204], [545, 3202], [544, 3196], [535, 3177], [531, 3175], [526, 3175], [527, 3174], [528, 3170], [528, 3165], [522, 3152], [511, 3134], [507, 3130], [503, 3128], [494, 3115], [431, 3065], [410, 3042], [400, 3042], [405, 3037], [400, 3041], [399, 3040], [402, 3035], [381, 3007], [362, 2965], [351, 2981], [333, 2992], [308, 3003], [285, 3015], [277, 3018], [246, 3022], [239, 3030], [237, 3042], [131, 3039], [114, 3035], [110, 3030], [105, 3029], [105, 3024], [104, 3024], [102, 3018], [91, 3012], [95, 2980], [90, 2980], [87, 2976], [81, 2976], [79, 2974], [80, 2966], [90, 2959], [72, 2941], [70, 2941], [71, 2947], [61, 2957], [61, 2964], [62, 2969], [60, 2972], [51, 2977], [45, 2986], [38, 2988], [33, 2996], [31, 3002], [30, 3017], [31, 3024], [29, 3031], [32, 3042], [39, 3052], [44, 3055], [47, 3065], [56, 3074], [63, 3077], [63, 3079], [60, 3082], [65, 3084], [67, 3094], [75, 3098], [80, 3106], [68, 3166], [54, 3179], [49, 3199], [61, 3196], [70, 3199], [76, 3205], [85, 3223], [86, 3231], [82, 3241], [78, 3238], [75, 3241], [68, 3241], [78, 3...



Will output the JSON to console which you can redirect to a file. Attached is one of your files converted to JSON file.

This script depends on https://github.com/tilezen/mapbox-vector-tile. MVT specification is here https://github.com/mapbox/vector-tile-spec/tree/master/2.1 (once you know it searching for tools is easy).

This is not the most convenient solution but if you ask for a better tool, mention this on the gis.stackexchange.com site. It's good to do your own homework :).

best,
    Dilawar
--
Dilawar Singh, Ph.D.

Vijay Sapkal

unread,
Dec 16, 2020, 2:18:36 AM12/16/20
to data...@googlegroups.com
I used a python script to download this file in software called Anaconda. 

On Wed, Dec 16, 2020 at 12:04 AM Arun Ganesh <arung...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages