简体   繁体   English

将WMS与ggmap一起使用?

[英]Using WMS with ggmap?

Is it possible to use a WMS with ggmap? 是否可以将WMS与ggmap一起使用?

I have found a lot of tutorials for using WMS with the leaflet package, but I would rather plot my map with ggmap as I dont want to change the view and zoom in and out of the map that I produce. 我已经找到了很多有关将WMS与传单包一起使用的教程,但是我宁愿使用ggmap绘制地图,因为我不想更改视图并放大和缩小所生成的地图。

I would like to use this WMS server as overlay to a Google Maps map or a OpenStreetMap (so I can adjust the transparency) with geom_point() of my datapoints. 我想将此 WMS服务器用作数据点的geom_point()叠加到Google Maps地图或OpenStreetMap(以便调整透明度)上。

Is there a way to do this, or can I only use WMS with the 'leaflet' package? 有没有办法做到这一点,还是只能将WMS与“ leaflet”软件包一起使用?

Best regards and thanks in advance! 最好的问候,并在此先感谢!

If your rgdal package is built with WMS support then you can read WMS data from R using that. 如果您的rgdal软件包是使用WMS支持构建的,则可以使用R从R读取WMS数据。 But you have to build the XML file that handles the request. 但是您必须构建处理请求的XML文件。 Some initial efforts at doing that appear here: 为此,一些初步的工作如下:

https://github.com/louhos/takomo/tree/master/GIS https://github.com/louhos/takomo/tree/master/GIS

but its a bit of a construction kit and the linked site is in Finnish which might not be good for you. 但是它有点建筑工具,并且链接的网站是芬兰语,这可能对您不利。

Alternatively if you can work out the exact WMS URL for the image you want back from the WMS, construct it and then use download.file or similar web tools to get it, then use it like any other image underlay on a ggplot ( geom_raster or something). 或者,如果您可以为要从WMS返回的图像确定确切的WMS URL,请构造它,然后使用download.file或类似的Web工具来获取它,然后像在ggplot上的任何其他图像参考底图一样使用它( geom_raster或东西)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM