LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2014, 01:05 PM   #1
sayhello_to_the_world
Member
 
Registered: May 2013
Posts: 229

Rep: Reputation: Disabled
how to use the boundary-box right: OSM equivalents-retrieval


hi linux-experts,



relatively new to GIS and Openstreetmap i try out techniques with perl, php, ruby and some other toosl /(osmconvert and filter) in order to get familar with the techniques.

what if i need the a country and not only a part of it what do i need to edit in the boundary-box.

let me say i want to gather data from

a. Belgium b. Argentina c. Colombia d. Denmark

what do i do with the boundary-box (see below in the code)

can i enter some equivalent.

if i need to explain more - just write ...
Code:
 require 'open-uri'
    require "net/http"
    require 'rexml/document'

    def query_overpass(object_type, left,bottom,right,top, key, value)
       base_url = "http://www.overpass-api.de/api/xapi?"
       query_string = "#{object_type}[bbox=#{left},#{bottom},#{right},#{top}][#{key}=#{value}]"
       url = "#{base_url}#{URI.encode(query_string)}"
       resp = Net::HTTP.get_response(URI.parse(url))
       data = resp.body
       return data
    end
love to hear frrom you - look forward to any and all help!

update:

found out some interesting things- have a closer look here;

User:The Anome/country bounding boxes - Wikipedia, the free encyclopedia
Quote:
User:The Anome/country bounding boxes A first hack, based on all places in the NGA GNS dataset, not (yet) properly handling latitude wrap-round at ±180°. Country names are mapped from FIPS country codes. This works pretty well for all countries that do not cross the 180° meridian. Russia is a notable exception. This dataset does not include the United States.

country longmin latmin longmax latmax

AA -70.983 12.400 -69.850 12.617
Antigua_and_ -62.417 16.817 -61.650 17.750
United_Arab_ 45.000 22.167 59.250 26.133
Afghanistan 60.433 29.150 75.033 38.484
Algeria -8.700 18.027 70.554 37.203
Azerbaijan 44.783 38.417 50.858 41.911
Albania 19.000 39.583 21.050 42.659
Armenia 43.443 38.857 46.589 41.300
Andorra 1.417 42.433 1.783 42.650
Angola 10.000 -33.806 24.350 -3.033
Argentina -73.533 -58.583 -53.367 -21.783
Australia 112.467 -55.050 168.000 -9.133
AT 122.983 -12.667 124.050 -12.000
Austria 1.200 46.373 19.000 49.017
AV -63.667 18.150 -62.917 18.600
Bahrain 45.000 25.000 50.954 26.566
Barbados -59.667 12.967 -59.383 13.333
Botswana 20.000 -28.517 29.350 24.583
BD -64.908 32.233 -64.617 32.417
Belgium 2.367 49.500 6.400 51.683
Bahamas -86.000 20.000 -70.000 29.547
Bangladesh 84.000 20.600 92.683 26.817
Belize -89.950 15.000 -75.000 18.483
Bosnia_and_H 15.746 42.558 19.671 45.268
Bolivia -69.650 -26.867 -57.550 9.678
Burma 91.833 6.000 102.000 28.350
Benin -4.000 5.000 92.219 21.322
Belarus 22.550 50.717 32.850 56.133
Solomon_Isla -130.000 -45.000 170.200 3.751 WRAPPED
Brazil -73.817 -33.733 -28.850 16.800
BS 39.700 -21.417 39.700 -21.417
Bhutan 80.000 26.217 92.717 30.000
 
Old 06-30-2014, 02:12 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by sayhello_to_the_world View Post
hi linux-experts,
relatively new to GIS and Openstreetmap i try out techniques with perl, php, ruby and some other toosl /(osmconvert and filter) in order to get familar with the techniques.

what if i need the a country and not only a part of it what do i need to edit in the boundary-box. let me say i want to gather data from

a. Belgium b. Argentina c. Colombia d. Denmark what do i do with the boundary-box (see below in the code) can i enter some equivalent. if i need to explain more - just write ...
Code:
require 'open-uri'
    require "net/http"
    require 'rexml/document'

    def query_overpass(object_type, left,bottom,right,top, key, value)
       base_url = "http://www.overpass-api.de/api/xapi?"
       query_string = "#{object_type}[bbox=#{left},#{bottom},#{right},#{top}][#{key}=#{value}]"
       url = "#{base_url}#{URI.encode(query_string)}"
       resp = Net::HTTP.get_response(URI.parse(url))
       data = resp.body
       return data
    end
update:
found out some interesting things- have a closer look here;
User:The Anome/country bounding boxes - Wikipedia, the free encyclopedia
Again, details would be nice. You don't say what language you're writing this program in (you mention three, and 'some others'), and based on your update, you now seem to know WHAT you need to enter into your program to get an entire country. So where do you need help?

You seem to have received an answer about a month ago at the OSM forums:
https://help.openstreetmap.org/quest...nto-a-mysql-db

...where you posted the code you got from another thread there (and reposted it above):
https://help.openstreetmap.org/quest...s-api-endpoint
http://forum.openstreetmap.org/viewt...364460#p364460

Also, you've asked on this site before about such things, and were given links and instructions SEVERAL times. Have you done/tried NOTHING in any of those threads????
http://www.linuxquestions.org/questi...ql-4175508017/
http://www.linuxquestions.org/questi...ep-4175507608/
http://www.linuxquestions.org/questi...5D-4175507384/
http://www.linuxquestions.org/questi...db-4175506044/
http://www.linuxquestions.org/questi...is-4175505742/

You haven't replied to questions in those other threads, so we have no idea what's working/not working at this point.

Last edited by TB0ne; 06-30-2014 at 02:19 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php simpleXML :parsing an osm-file and storing the output to mysql sayhello_to_the_world Programming 1 06-15-2014 12:05 PM
[SOLVED] while loop beyond boundary atlantis43 Programming 11 06-16-2013 10:19 PM
LXer: Open Recall: Doppio, CraigsList and OSM, Red Hat crop circles, Portable Apps LXer Syndicated Linux News 0 10-08-2012 06:40 PM
Redhat 9 - Adaptec I20 OSM problem newbie_1 Red Hat 8 09-01-2009 12:47 PM
Cylinder Boundary Acewannabee Linux - General 2 06-13-2002 10:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration