Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multipolygon to polygon boundary for Overpass Query #8

Closed
ramyaragupathy opened this issue Mar 28, 2018 · 2 comments
Closed

Multipolygon to polygon boundary for Overpass Query #8

ramyaragupathy opened this issue Mar 28, 2018 · 2 comments

Comments

@ramyaragupathy
Copy link
Owner

ramyaragupathy commented Mar 28, 2018

Referencing #7

With respective to boundaries, overpass queries can be run against a specific:

  • rectangular map view
[out:json][timeout:25];
// gather results
(
  // query part for: “building”
  node({{bbox}});
  way({{bbox}});
  
);
// print results
out body;
>;
out skel qt;
  • geographic area
[out:json][timeout:240];
// fetch area “California” to search in
{{geocodeArea:California}}->.searchArea;
// gather results
(
  // query part for: “place=city” in California
  node["place"="city"](area.searchArea);
  way["place"="city"](area.searchArea);
  relation["place"="city"](area.searchArea);
);
// print results
out body;
>;
out skel qt;
  • rectangular bounding box - The coordinates of the bounding box are in the sequence (South latitude, West longitude, North latitude, East longitude).
[out:json][timeout:25];

(
 // query for data in a custom bounding box
 node(11.5,79.6,11.8,79.8);
 way(11.5,79.6,11.8,79.8);
 rel(11.5,79.6,11.8,79.8);

);

// print results
out body;
out meta;
>;
out skel qt;
  • custom polygon boundary. Boundaries specified as (poly:lat1 long1 lat2 long2............latN longN lat1 long1). Coordinates (lat, long) at the beginning and at the end of the poly are the same signifying that it is a closed polygon. If there is a mismatch here, query fails with an error message.
[out:json][timeout:250];

(
  way[~"^turn:lanes.*$"~"."](poly:"37.56743975318767 -122.39250183105467 37.61967039695652 -122.34786987304686 37.640334898059486 -122.38426208496094 37.659362907485374 -122.37396240234375 37.68708070686609 -122.38426208496094 37.70772645289051 -122.39250183105467 37.70881291183666 -122.37258911132812 37.72836644908416 -122.354736328125 37.74791482485267 -122.37327575683594 37.76745803822967 -122.38700866699219 37.7897092979573 -122.38426208496094 37.811411388625636 -122.40623474121092 37.805986463750315 -122.46528625488281 37.811953859192705 -122.47901916503906 37.791879793952084 -122.48863220214842 37.78699608830537 -122.5147247314453 37.72293542866175 -122.51129150390625 37.67240786750202 -122.49755859375 37.60824807622547 -122.50030517578124 37.56743975318767 -122.39250183105467");

 
);

out body;
>;
out skel qt;

Objective:

Construct a polygon boundary for Overpass query using project specifications

Challenge
In case of a HOT OSM project, boundary is in the form of a multipolygon and the depth of the object varies with the complexity of boundary specified. So there's no fixed depth for all the projects. Challenge is to automatically figure out the depth and construct a polygon boundary.

Kandy Mexico
image image
@ramyaragupathy
Copy link
Owner Author

This is done! Individual polygons of the bigger multipolygons can be extracted and a depth of level 3 works for most of the complex tasks including project #2881 which has 206 polygons stitched into one. However this approach doesn't hold good as overpass requests fail due to long url.

@ramyaragupathy
Copy link
Owner Author

No next actions, closing here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant