[HOT] Admin Boundary Extraction Service
Jo
winfixit at gmail.com
Sun Nov 8 14:26:56 UTC 2015
Hi Samuel,
is_in has been deprecated several years ago. The Overpass API has a better
solution:
area[name="Burkina Faso"]->.b;
(
relation(area.b)["admin_level"];
way(r);
);
out body;
>;
out skel qt;
If you want to use the result in JOSM:
You can select File/Download from Overpass directly, but with a different
query:
[timeout:100];
area[name="Burkina Faso"]->.b;
(
relation(area.b)["admin_level"];
way(r);
);
out meta;
>;
out meta qt;
You have to additionally set a bounding box though.
It is also possible to save this query in a text file, if you need it more
than once, then call it as follows:
"C:\Program Files (x86)\GnuWin32\bin\wget.exe" --timeout 0
--header="accept-encoding: gzip" -O "PT_De_Lijn.osm.zip"
--post-file="boundaries.overpass" "http://overpass-api.de/api/interpreter"
Which you can save as a .cmd file (On Windows), or .sh on Linux (then
simply use wget). To get wget.exe on Windows, you need to install gnutools.
You can drag and drop the .zip file on JOSM directly, if you like.
Polyglot
2015-11-08 13:37 GMT+01:00 <augustindoury at gmail.com>:
> Here is a link : http://overpass-turbo.eu/s/cxc (click Run to run the
> query)
> The query gets all admin_level=4 in Burkina Faso and their way members
>
>
> On 08/11/2015 12:35, augustindoury at gmail.com wrote:
>
> Hi Samuel,
>
> This expression in the Wizard : type:relation AND admin_level=4 AND
> is_in='Burkina Faso'
> gives you all the relation type=boundary with an admin_level=4.
>
> It gives you this query :
>
> [out:json][timeout:25];
> (
> relation["admin_level"="4"]["is_in:country"="Burkina Faso"]({{bbox}});
> );
> out body;
> >;
> out skel qt;
>
>
> If you just want the polygons it's ok to extract this. But you won't
> extract the OSM objects members of relations, and their tags neither as
> Blake said.
>
> If you want the members to, and avoid JOSM, add :
> >>; to get all members
> node(r); to get the nodes
> way(r); to get all the ways
> relation(r); for relations
>
> Example for all members :
>
> [out:json][timeout:25];
> (
> relation["admin_level"="4"]["is_in:country"="Burkina Faso"]({{bbox}});
> >>;
> );
> out body;
> >;
> out skel qt;
>
> Good luck
>
> Augustin
>
> Yo
>
> On 08/11/2015 12:04, Samuel Aiyeoribe wrote:
>
> Thank you Blake,
>
> This looks promising. Even though i use Overpass turbo several times, i
> haven't looked into the overpass api.
>
> I will be happy to receive other suggestions and people's experiences.
>
> Cheers
>
> Samuel Aiyeoribe
>
>
>
> On Sunday, 8 November 2015, 12:53, Blake Girardot
> <blake.girardot at hotosm.org> <blake.girardot at hotosm.org> wrote:
>
>
> Hi Samuel,
>
> I have used overpass-turbo.eu to extract just admin boundaries before
> and it seems to work well.
>
> I then have to pass the results over to JOSM and download the missing
> members to get all the points and ways that make up the boundaries,
> but that is probably because I do not know overpass-turbo well enough
> to have it grab all the elements automatically.
>
> overpass-turbo consists of 2 major parts, the web front (Overpass
> Turbo) and the Overpass-API which handles searching OSM data, both are
> available from GitHub. Overpass-API works with local .osm.gz files so
> it can take a full OSM Planet file and minutely updates and run
> totally locally.
>
> http://overpass-api.de/
> https://github.com/tyrasd/overpass-turbo
>
> Probably not the easiest solution to your question, but at least you
> can try out Overpass-Turbo and make sure it does what you want before
> you try and run it locally.
>
> Here is one I used last week for one of our contacts who needed admin
> boundaries for Serbia: http://overpass-turbo.eu/s/cx8
>
> Like, I said, there might be simpler (I hope) answers to your
> question, but Overpass is one I think.
>
> Cheers,
> blake
>
> On Sun, Nov 8, 2015 at 6:00 AM, Samuel Aiyeoribe
> <olubunmi4ever at yahoo.co.uk> wrote:
> > Hello HOTties,
> >
> > Please does anyone know of a service for extracting/downloading OSM Admin
> > Boundary that one can fork and host myself and also available on github.
> >
> > Looking forward to your reply.
> >
> > Cheers
> >
> > Samuel
> >
> > _______________________________________________
> > HOT mailing list
> > HOT at openstreetmap.org
> > https://lists.openstreetmap.org/listinfo/hot
>
> >
>
>
>
> --
> ----------------------------------------------------
> Blake Girardot
> Humanitarian OpenStreetMap Team
> Vice President, HOT Board of Directors
> skype: jblakegirardot
> HOT Core Team Contact: info at hotosm.org
>
>
>
>
>
> _______________________________________________
> HOT mailing listHOT at openstreetmap.orghttps://lists.openstreetmap.org/listinfo/hot
>
>
>
>
> _______________________________________________
> HOT mailing list
> HOT at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/hot
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/hot/attachments/20151108/34f7b3c1/attachment.html>
More information about the HOT
mailing list