User:Mmd

From OpenStreetMap Wiki
Jump to: navigation, search

OSM user page


Overpass API examples

All of the following examples are not supported on the official Overpass API instance at overpass-api.de!

Export highways in current bounding box in PBF format

try it yourself in overpass-turbo
[out:pbf];
way[highway]({{bbox}});
(._;>;);
out meta;


{{data:overpass,server=http://dev.overpass-api.de/api_mmd/}}

Export highways in current bounding box in OPL format

try it yourself in overpass-turbo
[out:opl];
way[highway]({{bbox}});
(._;>;);
out meta;


{{data:overpass,server=http://dev.overpass-api.de/api_mmd/}}

ICU regular expression support

Also see https://www.openstreetmap.org/user/mmd/diary/40197

Nodes with Chinese (Han) characters in current bounding box

try it yourself in overpass-turbo
// switch to ICU Regexp implemenation
// see http://userguide.icu-project.org/strings/regexp

[regexp:ICU];


node({{bbox}})["name"~"[\\p{script=Han}]"];

out meta center;


{{data:overpass,server=http://dev.overpass-api.de/api_mmd/}}


No-U-Turn Relations with from = to member

try it yourself in overpass-turbo
[timeout:30];

// No-u-turn restrictions mit from = to

rel[restriction=no_u_turn][type=restriction]({{bbox}})
   (if:count_by_role("via") == 1  &&
       count_by_role("from") == 1 &&
       count_by_role("to") == 1);

foreach -> .rel(
  
  way(r.rel:"from") -> .w_from;
  way(r.rel:"to")   -> .w_to;
 
  if ( w_from.min(id()) == w_to.min(id()) )
  (
     .rel out geom meta; 
  );
);

// Depends on 0.7.55+ features:
{{data:overpass,server=http://dev.overpass-api.de/api_mmd/}}