Re: [OSM-talk] osmxapi/bbox question

2008-04-18 Thread Johan Huysmans
Hi,

Currently i'm working with the bbox of Belgium, but this bbox includes 
parts of the Netherlands, France,..

And this gives me some problems... it appears that some places in 
Belgium also exists in the Netherlands or France.

Apparently it is only possible to use bbox-es to limit the size.
Are there any ideas or plans to implement some way you can limit the 
size for eg. a country?

Johan

80n wrote:
 You can have any shaped bbox you like as long as it is a rectangle ;)

 Can anyone point me to a good algorithm for selecting points within an 
 arbitrary polygon?

 80n

 On Fri, Apr 11, 2008 at 1:01 PM, Johan Huysmans 
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

 Hi All,

 I' experimenting with osmxapi to get a list of all places in Belgium.
 Getting a list of all places is no problem, but the list is a bit too
 large ;)

 Can I specify that I only want the places in Belgium? Can this be done
 with bbox?

 Is there a known mapping that give you the exact bbox for each
 country?

 Thx, Johan Huysmans

 ___
 talk mailing list
 talk@openstreetmap.org mailto:talk@openstreetmap.org
 http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk



___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-18 Thread Skywave
Download from here, it uses a polygon instead of a bbox.
http://download.geofabrik.de/osm/europe/

On Fri, Apr 18, 2008 at 10:04 AM, Johan Huysmans
[EMAIL PROTECTED] wrote:
 Hi,

  Currently i'm working with the bbox of Belgium, but this bbox includes
  parts of the Netherlands, France,..

  And this gives me some problems... it appears that some places in
  Belgium also exists in the Netherlands or France.

  Apparently it is only possible to use bbox-es to limit the size.
  Are there any ideas or plans to implement some way you can limit the
  size for eg. a country?

  Johan


  80n wrote:
   You can have any shaped bbox you like as long as it is a rectangle ;)
  
   Can anyone point me to a good algorithm for selecting points within an
   arbitrary polygon?
  
   80n
  
   On Fri, Apr 11, 2008 at 1:01 PM, Johan Huysmans

  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
  
   Hi All,
  
   I' experimenting with osmxapi to get a list of all places in Belgium.
   Getting a list of all places is no problem, but the list is a bit too
   large ;)
  
   Can I specify that I only want the places in Belgium? Can this be done
   with bbox?
  
   Is there a known mapping that give you the exact bbox for each
   country?
  
   Thx, Johan Huysmans
  
   ___
   talk mailing list
   talk@openstreetmap.org mailto:talk@openstreetmap.org


  http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
  
  

  ___
  talk mailing list
  talk@openstreetmap.org
  http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-18 Thread Rob
i would be cool if the osmxapi could accept a href to a polygon xml
file reference instead of a bbox. We can put a list of
country/province/city/... polygons somewhere on a site

2008/4/18, Johan Huysmans [EMAIL PROTECTED]:
 And a combination of both? Does that exists.

  Now my php script just eats all memory when parsing the osm file :(


  Johan


  Skywave wrote:
   Download from here, it uses a polygon instead of a bbox.
   http://download.geofabrik.de/osm/europe/
  
   On Fri, Apr 18, 2008 at 10:04 AM, Johan Huysmans
   [EMAIL PROTECTED] wrote:
  
   Hi,
  
Currently i'm working with the bbox of Belgium, but this bbox includes
parts of the Netherlands, France,..
  
And this gives me some problems... it appears that some places in
Belgium also exists in the Netherlands or France.
  
Apparently it is only possible to use bbox-es to limit the size.
Are there any ideas or plans to implement some way you can limit the
size for eg. a country?
  
Johan
  
  
80n wrote:
 You can have any shaped bbox you like as long as it is a rectangle ;)

 Can anyone point me to a good algorithm for selecting points within an
 arbitrary polygon?

 80n

 On Fri, Apr 11, 2008 at 1:01 PM, Johan Huysmans
  
  
   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
  

 Hi All,

 I' experimenting with osmxapi to get a list of all places in 
 Belgium.
 Getting a list of all places is no problem, but the list is a bit 
 too
 large ;)

 Can I specify that I only want the places in Belgium? Can this be 
 done
 with bbox?

 Is there a known mapping that give you the exact bbox for each
 country?

 Thx, Johan Huysmans

 ___
 talk mailing list
 talk@openstreetmap.org mailto:talk@openstreetmap.org
  
  
  
   http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
  


  
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
  
  
  
   ___
   talk mailing list
   talk@openstreetmap.org
   http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
  

  ___
  talk mailing list
  talk@openstreetmap.org
  http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-18 Thread Johan Huysmans
That's exactly what i mean/want :D

That way you can call the osmxapi url with [polygon=belgium] or 
[polygon:country=belgium]

What do the osmxapi developers think about it?

Greetings Johan

Rob wrote:
 i would be cool if the osmxapi could accept a href to a polygon xml
 file reference instead of a bbox. We can put a list of
 country/province/city/... polygons somewhere on a site

 2008/4/18, Johan Huysmans [EMAIL PROTECTED]:
   
 And a combination of both? Does that exists.

  Now my php script just eats all memory when parsing the osm file :(


  Johan


  Skywave wrote:
   Download from here, it uses a polygon instead of a bbox.
   http://download.geofabrik.de/osm/europe/
  
   On Fri, Apr 18, 2008 at 10:04 AM, Johan Huysmans
   [EMAIL PROTECTED] wrote:
  
   Hi,
  
Currently i'm working with the bbox of Belgium, but this bbox includes
parts of the Netherlands, France,..
  
And this gives me some problems... it appears that some places in
Belgium also exists in the Netherlands or France.
  
Apparently it is only possible to use bbox-es to limit the size.
Are there any ideas or plans to implement some way you can limit the
size for eg. a country?
  
Johan
  
  
80n wrote:
 You can have any shaped bbox you like as long as it is a rectangle ;)

 Can anyone point me to a good algorithm for selecting points within an
 arbitrary polygon?

 80n

 On Fri, Apr 11, 2008 at 1:01 PM, Johan Huysmans
  
  
   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
  

 Hi All,

 I' experimenting with osmxapi to get a list of all places in 
 Belgium.
 Getting a list of all places is no problem, but the list is a bit 
 too
 large ;)

 Can I specify that I only want the places in Belgium? Can this be 
 done
 with bbox?

 Is there a known mapping that give you the exact bbox for each
 country?

 Thx, Johan Huysmans

 ___
 talk mailing list
 talk@openstreetmap.org mailto:talk@openstreetmap.org
  
  
  
   http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
  


  
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
  
  
  
   ___
   talk mailing list
   talk@openstreetmap.org
   http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
  

  ___
  talk mailing list
  talk@openstreetmap.org
  http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk

 

 ___
 talk mailing list
 talk@openstreetmap.org
 http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
   

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-18 Thread 80n
On Fri, Apr 18, 2008 at 3:14 PM, Johan Huysmans [EMAIL PROTECTED]
wrote:

 That's exactly what i mean/want :D

 That way you can call the osmxapi url with [polygon=belgium] or
 [polygon:country=belgium]

 What do the osmxapi developers think about it?


It's a nice idea.  I just need to implement the algorithm described earlier
in this thread :)

80n



 Greetings Johan

 Rob wrote:
  i would be cool if the osmxapi could accept a href to a polygon xml
  file reference instead of a bbox. We can put a list of
  country/province/city/... polygons somewhere on a site
 
  2008/4/18, Johan Huysmans [EMAIL PROTECTED]:
 
  And a combination of both? Does that exists.
 
   Now my php script just eats all memory when parsing the osm file :(
 
 
   Johan
 
 
   Skywave wrote:
Download from here, it uses a polygon instead of a bbox.
http://download.geofabrik.de/osm/europe/
   
On Fri, Apr 18, 2008 at 10:04 AM, Johan Huysmans
[EMAIL PROTECTED] wrote:
   
Hi,
   
 Currently i'm working with the bbox of Belgium, but this bbox
 includes
 parts of the Netherlands, France,..
   
 And this gives me some problems... it appears that some places in
 Belgium also exists in the Netherlands or France.
   
 Apparently it is only possible to use bbox-es to limit the size.
 Are there any ideas or plans to implement some way you can limit
 the
 size for eg. a country?
   
 Johan
   
   
 80n wrote:
  You can have any shaped bbox you like as long as it is a
 rectangle ;)
 
  Can anyone point me to a good algorithm for selecting points
 within an
  arbitrary polygon?
 
  80n
 
  On Fri, Apr 11, 2008 at 1:01 PM, Johan Huysmans
   
   
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 wrote:
   
 
  Hi All,
 
  I' experimenting with osmxapi to get a list of all places in
 Belgium.
  Getting a list of all places is no problem, but the list is
 a bit too
  large ;)
 
  Can I specify that I only want the places in Belgium? Can
 this be done
  with bbox?
 
  Is there a known mapping that give you the exact bbox for
 each
  country?
 
  Thx, Johan Huysmans
 
  ___
  talk mailing list
  talk@openstreetmap.org mailto:talk@openstreetmap.org
   
   
   
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
   
 
 
   
 ___
 talk mailing list
 talk@openstreetmap.org
 http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
   
   
   
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
   
 
   ___
   talk mailing list
   talk@openstreetmap.org
   http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
 
 
 
  ___
  talk mailing list
  talk@openstreetmap.org
  http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
 

 ___
 talk mailing list
 talk@openstreetmap.org
 http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-18 Thread Frederik Ramm
Hi,

 That way you can call the osmxapi url with [polygon=belgium] or
 [polygon:country=belgium]

 What do the osmxapi developers think about it?

 
 It's a nice idea.  I just need to implement the algorithm described earlier
 in this thread :)

Not only do you need to implement the algorithm, you also need a 
computing environment that will be able to execute the algorithm in an 
acceptable timeframe. A halfway correct border polygon of a landlocked 
state easily runs into five-digit numbers of polygon nodes, and then for 
each of the 250 million nodes in the database, you have to find out 
whether it lies in that polygon.

(An obvious optimization is to compute the largest rectangle contained 
in, and the largest rectangle containing, the polygon. First check if 
point is outside the outer bbox - if yes, you're done. Then check if 
point is inside the inner bbox - if yes, you're done. Only after that do 
the actual polygon test.)

Bye
Frederik

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-18 Thread Andy Allan
On Fri, Apr 18, 2008 at 4:56 PM, Frederik Ramm [EMAIL PROTECTED] wrote:

  (An obvious optimization is to compute the largest rectangle contained
  in, and the largest rectangle containing, the polygon. First check if
  point is outside the outer bbox - if yes, you're done. Then check if
  point is inside the inner bbox - if yes, you're done. Only after that do
  the actual polygon test.)

PostGIS is thataway --

:-)

Cheers,
Andy

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-18 Thread 80n
On Fri, Apr 18, 2008 at 4:56 PM, Frederik Ramm [EMAIL PROTECTED] wrote:

 Hi,

  That way you can call the osmxapi url with [polygon=belgium] or
   [polygon:country=belgium]
  
   What do the osmxapi developers think about it?
  
  
  It's a nice idea.  I just need to implement the algorithm described
  earlier
  in this thread :)
 

 Not only do you need to implement the algorithm, you also need a computing
 environment that will be able to execute the algorithm in an acceptable
 timeframe. A halfway correct border polygon of a landlocked state easily
 runs into five-digit numbers of polygon nodes, and then for each of the 250
 million nodes in the database, you have to find out whether it lies in that
 polygon.

 (An obvious optimization is to compute the largest rectangle contained in,
 and the largest rectangle containing, the polygon. First check if point is
 outside the outer bbox - if yes, you're done. Then check if point is inside
 the inner bbox - if yes, you're done. Only after that do the actual polygon
 test.)


Yes, the algorithm is simple, it's implementation is a little more
challenging.




 Bye
 Frederik

___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-12 Thread Igor Brejc
Karl Newman wrote:
 On Fri, Apr 11, 2008 at 5:47 AM, 80n [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 You can have any shaped bbox you like as long as it is a rectangle ;)

 Can anyone point me to a good algorithm for selecting points
 within an arbitrary polygon?

 80n


 I don't have it in pseudocode, but one I've heard of casts a ray 
 (horizontal is common) out from the point being tested and then checks 
 the intersection of that ray against each segment of the polygon. If 
 the total number of intersections is odd, then the point lies inside 
 the polygon. If the number is even, then it's outside. This works for 
 holes in a polygon, too.

 Karl
http://en.wikipedia.org/wiki/Point_in_polygon

Igor

-- 
http://igorbrejc.net


___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk


Re: [OSM-talk] osmxapi/bbox question

2008-04-11 Thread Karl Newman
On Fri, Apr 11, 2008 at 5:47 AM, 80n [EMAIL PROTECTED] wrote:

 You can have any shaped bbox you like as long as it is a rectangle ;)

 Can anyone point me to a good algorithm for selecting points within an
 arbitrary polygon?

 80n


I don't have it in pseudocode, but one I've heard of casts a ray (horizontal
is common) out from the point being tested and then checks the intersection
of that ray against each segment of the polygon. If the total number of
intersections is odd, then the point lies inside the polygon. If the number
is even, then it's outside. This works for holes in a polygon, too.

Karl
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk