NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Is there is a way to extract only those reference points along with node id for locations tagged as administration boundary.

That is no street information just node id with the latitude, longitude reading of the boundary area?

asked 15 Feb '14, 09:44

RichaB's gravatar image

RichaB
11224
accept rate: 0%


I'm not sure exactly what you mean by "reference points" here, so taking a step back:

Admin boundaries in OSM are typically relations, and are tagged with an admin level. Here's one for Leicestershire in England, for example. You can see there that it's composed of lots of ways, with a role of "outer" (bordering neighbouring counties) or "inner" (defining a "hole" in the middle where Leicester is). Each of those ways has nodes, and those nodes, and those nodes have a latitude and longitude.

Although it would be perfectly possible to obtain a set of node IDs and lat/longs for all nodes that are part of admin boundary relations, it wouldn't be useful - you'd have nodes for both outer and inner ways for all sorts of admin levels. What you probably want to do first is to look for nodes and their role in a particular administrative boundary - with Leicestershire you'd probably want to process the nodes in the "outers" and the nodes in the "inners" separately. Things get more complicated when there are more complicated enclaves and exclaves, obviously.

The next question is how to extract the data. One option is to start with the full details about the relation - Overpass is probably the best way to do this. That will return all constituent ways and their constituent nodes, but it'll return all nodes for outers and inners, so you'll need to find some way of separating those. More useful might be an Overpass query for "all outer ways" or even "all nodes in all outer ways" - there are lots of examples on the wiki page, and the chances are that you can adapt one of those to your needs.

permanent link

answered 15 Feb '14, 10:51

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Thank you for that @SomeoneElse really useful information. Sorry if I wasn't very clear, to give you an example. Leicestershire is enclosed with a tag boundary=administrative. All I am looking for is the lat, long info of all boundry=administrative nodes. I am trying to use the XAPI API http://open.mapquestapi.com/xapi/ but that only gives me the reference number for the nodes and filters out the actual latitude, longitude information.

Can you advice on this please. Thank you very much.

(15 Feb '14, 11:04) RichaB
2

The server that you're using isn't "the XAPI server"; merely one of several options (OSM can be particularly confusing sometimes).

The XAPI wiki page suggests that even if running, the data returned by the Mapquest XAPI server would be from 2012, so I wouldn't recommend using it. I've also noticed it being down occasionally; I'm not sure how common that is. Overpass's XAPI compatibility layer returns most of the same data, and sounds like a much better bet for what you want.

However, what query are you using? If you're trying to extract every node out of every admin boundary on the planet it's not feasible to use XAPI for that; you'd want to extract from a downloaded dataset. Actually, depending on what you actually want to use the data for and what data you want, there may well be downloadable shapefiles available somewhere already

(15 Feb '14, 11:15) SomeoneElse ♦
2

@SomeoneElse you are a gem thank you very much for that. Helped me a lot!!!

(15 Feb '14, 12:07) RichaB

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×191
×83
×63

question asked: 15 Feb '14, 09:44

question was seen: 3,189 times

last updated: 15 Feb '14, 12:07

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum