I recently released the first version of a mostly-complete Java implementation of the XAPI server. The source code is available on my GitHub with a readme describing generally how to get it set up.
Running this database with a full-planet requires some large, fast disks. The database is roughly 350GB and is slowly increasing:
CPU and memory usage are useful for the initial import (indexing especially), but any subsequent queries will be limited by the disk speed.
Feel free to use it! Serge W. created an XAPI UI framework that I set up at http://openstreetmap.us/uixapi/xapi.html to build the XAPI query URLs.
At the moment, the Java XAPI seems to have a problem returning relations and doesn't implement child element predicates or special tags. If you find other problems, please file a bug.
การอภิปราย
ความคิดเห็นจาก Firefishy เมื่อ 26 มกราคม 2011 เมื่อเวลา 15:13 น.
Stats for xapi.osm.org for 25 Jan 2011:
tags:
@user= - 27 queries from 12 IP addresses.
@uid= - 3 queries from 2 IP address.
@changeset - 1 query
ความคิดเห็นจาก Harry Wood เมื่อ 26 มกราคม 2011 เมื่อเวลา 16:00 น.
You didn't actually mention the base URL for your new service: http://openstreetmap.us/xapi/api/0.6/
It works! Example: All the libraries in London : http://openstreetmap.us/xapi/api/0.6/*[amenity=library][bbox=-0.57,51.24,0.31,51.75]
Great work!
ความคิดเห็นจาก Tom Chance เมื่อ 26 มกราคม 2011 เมื่อเวลา 16:24 น.
Great, I'll give it a go.
ความคิดเห็นจาก Maarten Deen เมื่อ 26 มกราคม 2011 เมื่อเวลา 16:37 น.
Looks promising. But the performance with large bboxes isn't there yet.
Harry Wood's example works for me, I can also download banks in a 0.2x0.2 bbox, but trying to get banks for the whole of the Netherlands does not work yet. I get a "504 Gateway Time-out" message.
My test URL: http://openstreetmap.us/xapi/api/0.6/*[amenity=bank][bbox=2.5,50.7,7.2,53.6]
ความคิดเห็นจาก iandees เมื่อ 26 มกราคม 2011 เมื่อเวลา 16:42 น.
The machine restarted itself at 16:00UTC or so, which lines itself up with your request fairly well.
But yes, large bounding box queries are mildly slow -- I don't remember them being particularly fast on the other system, though.
ความคิดเห็นจาก Tom Chance เมื่อ 26 มกราคม 2011 เมื่อเวลา 16:48 น.
I get the same message trying to download all power generators in the UK.
http://openstreetmap.us/xapi/api/0.6/*[power=generator][-6.5,49.68,2.67,61.31]
Just London works fine:
http://openstreetmap.us/xapi/api/0.6/*[power=generator][bbox=-0.5
1,51.20,0.35,51.80]
ความคิดเห็นจาก iandees เมื่อ 26 มกราคม 2011 เมื่อเวลา 16:53 น.
It bounced a few more times and is down hard now. There appear to be some ECC memory errors, but I put fresh memory in a while back. Looks to be a bad motherboard. Thanks for the stress test, everyone!
ความคิดเห็นจาก Geonick เมื่อ 27 มกราคม 2011 เมื่อเวลา 23:13 น.
Is this XAPI UI really reflect the syntax of XAPI? Currently there is only one tag predicate. Isn't it possible to query more than one, like
http://openstreetmap.us/xapi/api/0.6/*[amenity=parking][capacity:disabled=*][bbox=-0.57,51.24,0.31,51.75]
Actually, even the OSM wiki leaves this question open:
osm.wiki/Xapi#Predicates
It would be nice anyhow that the wiki page get's enhanced with a real syntax definition.
ความคิดเห็นจาก iandees เมื่อ 28 มกราคม 2011 เมื่อเวลา 01:24 น.
@Geonick: yes, this really does follow the XAPI query syntax. You can indeed supply multiple tag predicates. It will eventually be possible to include multiple bounding box predicates, but at the moment I only allow one.
ความคิดเห็นจาก Katzman เมื่อ 9 มีนาคม 2011 เมื่อเวลา 21:01 น.
Two things:
- so the possibility to enter multiple tags is not implemented yet, right?
- is it possible to do non-case sensitive search on the values, such as icao=lklt would return any combination of LKLT, lklt, LKlt, LkLt, etc.?
Thanks!
ความคิดเห็นจาก iandees เมื่อ 9 มีนาคม 2011 เมื่อเวลา 21:03 น.
@Katzman:
1. It is possible to enter multiple tag predicates:
[amenity=foo|bar] := "amenity"="foo" OR "amenity"="bar"
[amenity|leisure=foo] := "amenity"="foo" OR "leisure"="foo"
[amenity=foo][area=bar] := "amenity"="foo" AND "area"="bar"
2. Not at this time.
ความคิดเห็นจาก Arminus เมื่อ 21 มีนาคม 2011 เมื่อเวลา 19:34 น.
Very nice ! Any updates on the relation problem ?
ความคิดเห็นจาก Tilo เมื่อ 31 มีนาคม 2011 เมื่อเวลา 17:45 น.
Is the jxapi down at the moment?
I want to prevent denied download requests before the request is sent. How is it handled, if a bbox is too large? like this?
[bbox=West,South,East,North]
if difference(West,East)*difference(South,North) > 10 --> denied
if difference(West,East)*difference(South,North) <= 10 --> accepted
Is it planned to allow larger bboxes than 10 sqaredegrees in future?
Thanks!
ความคิดเห็นจาก Tilo เมื่อ 31 มีนาคม 2011 เมื่อเวลา 17:48 น.
[bbox=West,South,East,North]
if difference(West,East)*difference(South,North) > 10 --- denied
if difference(West,East)*difference(South,North) <= 10 --- accepted
ความคิดเห็นจาก iandees เมื่อ 31 มีนาคม 2011 เมื่อเวลา 17:51 น.
@Tilo: No, the jxapi is/was not down. It was getting inundated with duplicate requests so the process queue was very long. I restarted postgres to clean out the queue.
I compute the sum of the areas of the requested bounding box(es) and compare that to 10. If larger, 500. If less, let it through.
There are no plans to do areas larger than 10 square degrees. As you can see already the hardware has a hard enough time keeping up.
ความคิดเห็นจาก Tilo เมื่อ 31 มีนาคม 2011 เมื่อเวลา 17:51 น.
damn,
the third line was supposed to look like this (now, in words):
if difference(West,East)*difference(South,North) is less or equal 10 then accepted
ความคิดเห็นจาก Tilo เมื่อ 31 มีนาคม 2011 เมื่อเวลา 17:59 น.
Great! thanks a lot.
ความคิดเห็นจาก Tilo เมื่อ 1 เมษายน 2011 เมื่อเวลา 04:36 น.
I just tested a little smaller request than 10 square degrees with the request below (9.8 sqdeg) and ran into an Error. see the message below from http://jxapi.openstreetmap.org/xapi/admin/stats
ERROR way[boundary=administrative][bbox=8,48,10,52.9] 144 30 mins 32.909 secs
What is wrong with the request? Is there another reason for denial than the bounding box?
Thanks
ความคิดเห็นจาก Tilo เมื่อ 1 เมษายน 2011 เมื่อเวลา 05:12 น.
this worked:
way[boundary=administrative][bbox=8,48,10,52] (221655 elements)
but this didn't:
way[bbox=8,48,10,52]
???
ความคิดเห็นจาก malcolmh เมื่อ 5 เมษายน 2011 เมื่อเวลา 09:44 น.
Bounding boxes that straddle 180 E/W are rejected. I assume this is because West > East. Is this a bug or a feature?
ความคิดเห็นจาก iandees เมื่อ 5 เมษายน 2011 เมื่อเวลา 10:47 น.
This is not a good place to make bug reports. Do that here: https://github.com/iandees/xapi-servlet/issues
ความคิดเห็นจาก Langlaeufer เมื่อ 12 เมษายน 2011 เมื่อเวลา 19:27 น.
Examples for Bugs with relations.
JXAPI !causes a browser crash!: http://jxapi.openstreetmap.org/xapi/api/0.6/relation%5Bbbox=9.6,52.4,9.7,52.5%5D%5Btype=restriction%5D
or delivers noting: http://jxapi.openstreetmap.org/xapi/api/0.6/*%5Bbbox=9.6,52.4,9.7,52.5%5D%5Btype=restriction%5D
XAPI Request: http://xapi.openstreetmap.org/api/0.6/relation%5Bbbox=9.6,52.4,9.7,52.5%5D%5Btype=restriction%5D
also in this way: http://xapi.openstreetmap.org/api/0.6/*%5Bbbox=9.6,52.4,9.7,52.5%5D%5Btype=restriction%5D
ความคิดเห็นจาก iandees เมื่อ 12 เมษายน 2011 เมื่อเวลา 20:05 น.
********THIS IS NOT A GOOD PLACE TO MAKE BUG REPORTS************. Do that here: https://github.com/iandees/xapi-servlet/issues
ความคิดเห็นจาก Langlaeufer เมื่อ 17 เมษายน 2011 เมื่อเวลา 12:36 น.
sorry, I do not like to register there!
ความคิดเห็นจาก Bryce C Nesbitt เมื่อ 27 เมษายน 2011 เมื่อเวลา 06:59 น.
Great! Thanks for making progress brining xapi back to life!
It would be nice if the status page at http://jxapi.openstreetmap.org/xapi/admin/stats gave details on the ERROR, rather than simply saying ERROR.
ความคิดเห็นจาก Tilo เมื่อ 28 เมษายน 2011 เมื่อเวลา 02:51 น.
I agree with Bryce on both!
about 14 days ago this request: *[bbox=8.173,49.815,9.173,50.554] worked fine.
size 523 MB
Yesterday in the afternoon and today (at night) I always got an error. I tried 5 times each. Neither the bbox limitation of 10 sqare degrees (less than 2 sqdeg here) nor the syntax should be a problem in this request. What are the other limitations which cause an error?
Have new limitations been implemented between apr,14 and apr,28?
ความคิดเห็นจาก iandees เมื่อ 28 เมษายน 2011 เมื่อเวลา 02:52 น.
********THIS IS NOT A GOOD PLACE TO MAKE BUG REPORTS************. Do that here: https://github.com/iandees/xapi-servlet/issues