查找区域中所有医院的立交桥查询是什么? [英] What is the overpass query to find all the hospitals in a region?

查看:91
本文介绍了查找区域中所有医院的立交桥查询是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想在给定的LatLog中标记所有医院.我尝试了很多.但是找不到我的错误.

I just want to mark all the hospitals in a given LatLog. I tried a lot. But can't find what is my mistake.

var lat = 12.933;
var lon = 77.612;
var zoom = 13;
var map;

function init() {
  map = new OpenLayers.Map("demoMap", {
    controls: [
      new OpenLayers.Control.Navigation(),
      new OpenLayers.Control.PanZoomBar(),
      new OpenLayers.Control.LayerSwitcher(),
      new OpenLayers.Control.Attribution()
    ],
    maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
    maxResolution: 156543.0399,
    numZoomLevels: 19,
    units: 'm',
    projection: new OpenLayers.Projection("EPSG:900913"),
    displayProjection: new OpenLayers.Projection("EPSG:4326")
  });

  layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
  map.addLayer(layerMapnik);

  var lonLat = new OpenLayers.LonLat(lon, lat)
    .transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));

  map.setCenter(lonLat, zoom);

  map.addLayers([
    make_layer("http://overpass-api.de/api/interpreter?data=node[amenity=hospital];out+skel;", "red")
  ]);
}

它没有显示任何结果.这是因为查询错误还是其他问题?

It does not show any result. Is this because of error in query or any other issue?

推荐答案

您忘记了(bbox)来将数据限制为当前边界框.当您查询整个行星的数据时,查询很可能会因超时或内存不足而终止.

You forgot the (bbox) to restrict your data to the current bounding box. As you're querying data for the whole planet, the query will most likely terminate with a timeout or out of memory.

有关如何添加(bbox)的一些示例,请参见此链接: http://overpass-api. de/open_layers_mashup.html

See this link for some examples on how to add (bbox): http://overpass-api.de/open_layers_mashup.html

在将任何天桥查询嵌入到您自己的代码中之前,请确保通过 http://overpass-turbo.eu运行它/首先.语法可能稍有不同,但是它有助于在不进行任何编码的情况下评估结果.

Before embedding any Overpass queries in your own code, be sure to run it through http://overpass-turbo.eu/ first. Syntax may be slightly different, but it helps to evaluate the results without doing any coding upfront.

这篇关于查找区域中所有医院的立交桥查询是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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