在QGis中打开Mapbox地图 [英] Open a Mapbox map in QGis

查看:843
本文介绍了在QGis中打开Mapbox地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种在QGis中显示我的Mapbox地图的方法(在mapbox.com上编辑的基本图层以及从tilemill上载的数据).

I'm looking for a way to display one of my Mapbox map in QGis (baselayer edited on mapbox.com & data uploaded from tilemill).

这里有人已经找到方法了吗?有功能或插件可以做到这一点吗?

Did someone here already find a way ? Is there a feature or a plugin to do that ?

感谢您将来的回答!

Adrien

推荐答案

昨天,我自己找到了两个解决方案:

Yesterday, I found two solutions by myself :

1)漂亮的官方"TileLayer插件" QGis插件

您必须编写一个TSV文件(制表符分隔值),至少要包含Mapbox地图的名称,名称和URL.该网址应如下所示:

You'll have to write a TSV file (Tab Separated Values) with, at least, the name, the credits and the URL of your Mapbox map. The URL should look like :

http://a.tiles.mapbox.com/v3/mapboxId.mapId/{z}/{x}/{y}.png

您只需要用您的ID替换mapboxId和mapId.请参阅插件的github存储库,以获取更多信息和要添加到您的TSV文件中的值(minZoom,maxZoom等).

You just have to replace mapboxId and mapId with your ids. See the github repository of the plugin for further informations and values to add to your TSV file (minZoom, maxZoom, etc).

然后,在插件的设置"菜单中,将插件链接到TSV文件的目录(外部图层目录").

Then, in the "settings" menu of the plugin, link the plugin to the directory of your TSV file ("external layers directory").

最后,在插件的添加"菜单中,选择您的地图,然后单击添加".

Finally, in the "add" menu of the plugin, select your map and click "add".

2)一个解释为栅格的XML文件

使用以下代码编写XML文件:

Write a XML file with this code :

<GDAL_WMS>
    <Service name="TMS">
        <ServerUrl>http://a.tiles.mapbox.com/v3/mapboxId.mapId/${z}/${x}/${y}.png</ServerUrl>
    </Service>
    <DataWindow>
        <UpperLeftX>-20037508.34</UpperLeftX>
        <UpperLeftY>20037508.34</UpperLeftY>
        <LowerRightX>20037508.34</LowerRightX>
        <LowerRightY>-20037508.34</LowerRightY>
        <TileLevel>18</TileLevel>
        <TileCountX>1</TileCountX>
        <TileCountY>1</TileCountY>
        <YOrigin>top</YOrigin>
    </DataWindow>
    <Projection>EPSG:3857</Projection>
    <BlockSizeX>256</BlockSizeX>
    <BlockSizeY>256</BlockSizeY>
    <BandsCount>3</BandsCount>
    <Cache />
</GDAL_WMS>

再次,用您的ID替换ID.然后,以QGis文件格式打开文件.

Once again, replace the ids with yours. Then, open the file in QGis as a raster.

这篇关于在QGis中打开Mapbox地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆