SAS 或 Python 提取地图以获取方向作为图片
我想使用 SAS 或 Python 来实现这一点。
我想使用 mapquest/maps.google/maps.bing 绘制出多个点,然后将地图的屏幕截图下载到我的 C: 驱动器上。
这不会是一次性的事情。我需要它来下载多张地图(有一张芝加哥境内路线的地图,然后有一张匹兹堡境内路线的地图)。
我希望 Python 中可能有一个模块可以实现这一点。
另外,顺便说一句,有没有办法从 SAS 程序中调用 Python 脚本?我可以将其嵌入到 VBA 脚本中,然后从 SAS 调用该脚本吗?
I would like to use SAS or Python to achieve this.
I have multiple points that I would like to map out using mapquest/maps.google/maps.bing, and then download a screenshot of the map on to my C: drive.
This would not be a one time thing. I would need it to download multiple maps (Have a map for route within Chicago, then another for a route within Pittsburgh).
I was hoping there may be a module within Python that enables this.
Also, on a side note, is there a way to call Python scripts from within a SAS program? Could I possibly embed it in to a VBA script which is then called from SAS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果 Google/MapQuest/Bing 的 API 都支持 URI 请求,那么您应该能够通过 SAS 完成很多工作...
在 SAS 中,您可以发出 API 请求并检索和处理数据。显示了一个示例 这里。
我不确定 API 请求将返回什么,或者您将如何使用/解释它。如果是标准 XML,请使用 SAS XML 映射器。如果是其他内容(即图像/MIME 数据),那么事情可能会变得更加棘手。
You should be able to do the lot from SAS if the APIs for Google/MapQuest/Bing all support URI requests...
In SAS you can make the API request and retrieve and process the data. An example is shown here.
I'm not sure what the API request is going to return or how you would then use/interpret that. If it's standard XML use the SAS XML mapper. If it's anything else (ie. Image/MIME data) then things may get trickier.
Google Maps API 系列可让您通过任何语言调用各种服务会让您发送 URL 请求。您可能对静态 API 特别感兴趣,但我不确定您是否可以覆盖方向或如何覆盖方向。
要在 Python 中执行此操作,您可以使用 urllib 与 API 进行交互;还有pymap。
The family of Google Maps APIs lets you call down various services from any language that will let you send a URL request. The Static API might be of special interest to you, though I'm not sure if you can overlay directions, or how.
To do this in Python, you could use
urllib
for interacting with the API; there's also pymaps.