[OSM-dev] XAPI and using a home server

Graham Jones grahamjones139 at gmail.com
Fri Mar 4 21:53:22 GMT 2011


Roland,
Thanks for this - Ctrl-D to terminate the standard input made a big
difference - it now gives me some XML that looks right.

The only thing is that it ends with:
    "runtime error: open64: 2 ./db/area_tags_local.bin File_Blocks:1"
and does not provide the closing </osm-derived> tag.

Do you have any suggestions on what might cause that?

Thanks

Graham.

On 1 March 2011 01:05, Roland Olbricht <roland.olbricht at gmx.de> wrote:

> > Roland,
> > I have compiled osm3s and imported the latest planet file.
>
> Thank you for this. I'm sorry that there are still holes in the
> instructions.
>
> > I think this
> >  was successful - no errors anyway and took about 24 hours as you
> suggested
> >  and ended with
> [...]
> > > max_written_role_id 4458
> > > R 1298757941 r 1298757941
> >
> > This looks a bit abrupt, but I tried a small osm file and got a similar
> > result, so I think this is a good sign?
>
> Yes, it is. It looks fine so far. Well, the next version will have a more
> informative final message.
>
> > How do I use it?
>
> > And although it lets me type things at the terminal (like your example
> > queries), it does not respond - is it really listening on standard input?
>
> Yes, it does. It waits until the input stream is finished. So, please
> finish
> the input stream by Ctrl+D when you type at the console (works in general
> on
> all UNIX consoles).
>
> A more convenient way (especially when invoking it in a tool chain) might
> be
> to pass a file with the content to it. For example
>
> echo '<query type="node"><bbox-query n="51.0" s="50.9" w="6.9"
> e="7.0"/><has-
> kv k="amenity" v="pub"/></query><print/>' | bin/osm3s_query --no-mime --db-
> dir=YOUR_DB_DIR
>
> > Your instructions on the wiki say "put a query on the standard input",
> but
> > when I start osm3s_query it prints out:
> > > encoding remark: No input found from GET method. Trying to retrieve
> input
> > > by POST method.
>
> You can safely ignore the message if you call osm3s_query on the command
> line.
> It's a leftover from the purpose of using it via the CGI interface of a web
> browser.
>
> > Sorry if this is obvious - I haven't tried to look at your code to see
> what
> > it is doing!
>
> Questions are always welcome. Even if it were obvious (it is not), it is
> still
> a good hint for me how to improve the instructions.
>
> > The other question is whether anyone has written a php script (or
> similar)
> > to make this emulate xapi queries to use as a direct replacement for
> xapi?
>
> AFAIK no yet. I think it would be feasible for
>
> /map?bbox=..
> (gets '<bbox-query n="" s="" w="" e=""/><print/>')
>
> /node[..] (with or without bbox)
> (like the first query in the instructions, maybe without bbox)
>
> /way[..]
> (gets '<query type="way"><has-kv k="" v=""/></query><print/>'
>  or maybe '<query type="way"><has-kv k=""/></query><print/>'
>
> /relation[..]
> (gets '<query type="relation"><has-kv k="" v=""/></query><print/>')
>
> /*  (all three without bbox)
> (gets:
>  <union>
>    <query type="node"><has-kv k="" v=""/></query>
>    <query type="way"><has-kv k="" v=""/></query>
>    <query type="relation"><has-kv k="" v=""/></query>
>  </union>
>  <print/>
> )
>
> but the other queries may get more difficult.
>
> Cheers,
>
> Roland
>



-- 
Graham Jones
Hartlepool, UK.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20110304/f032be38/attachment.html>


More information about the dev mailing list