Roland,<div>Thanks for this - Ctrl-D to terminate the standard input made a big difference - it now gives me some XML that looks right.</div><div><br></div><div>The only thing is that it ends with:</div><div><div>    "runtime error: open64: 2 ./db/area_tags_local.bin File_Blocks:1"</div>
<div>and does not provide the closing </osm-derived> tag.</div><div><br></div><div>Do you have any suggestions on what might cause that?</div><div><br></div><div>Thanks</div><div><br></div><div>Graham.</div><br><div class="gmail_quote">
On 1 March 2011 01:05, Roland Olbricht <span dir="ltr"><<a href="mailto:roland.olbricht@gmx.de">roland.olbricht@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">> Roland,<br>
> I have compiled osm3s and imported the latest planet file.<br>
<br>
</div>Thank you for this. I'm sorry that there are still holes in the instructions.<br>
<div class="im"><br>
> I think this<br>
>  was successful - no errors anyway and took about 24 hours as you suggested<br>
>  and ended with<br>
</div>[...]<br>
<div class="im">> > max_written_role_id 4458<br>
> > R 1298757941 r 1298757941<br>
><br>
> This looks a bit abrupt, but I tried a small osm file and got a similar<br>
> result, so I think this is a good sign?<br>
<br>
</div>Yes, it is. It looks fine so far. Well, the next version will have a more<br>
informative final message.<br>
<br>
> How do I use it?<br>
<div class="im"><br>
> And although it lets me type things at the terminal (like your example<br>
> queries), it does not respond - is it really listening on standard input?<br>
<br>
</div>Yes, it does. It waits until the input stream is finished. So, please finish<br>
the input stream by Ctrl+D when you type at the console (works in general on<br>
all UNIX consoles).<br>
<br>
A more convenient way (especially when invoking it in a tool chain) might be<br>
to pass a file with the content to it. For example<br>
<br>
echo '<query type="node"><bbox-query n="51.0" s="50.9" w="6.9" e="7.0"/><has-<br>
kv k="amenity" v="pub"/></query><print/>' | bin/osm3s_query --no-mime --db-<br>
dir=YOUR_DB_DIR<br>
<div class="im"><br>
> Your instructions on the wiki say "put a query on the standard input", but<br>
> when I start osm3s_query it prints out:<br>
> > encoding remark: No input found from GET method. Trying to retrieve input<br>
> > by POST method.<br>
<br>
</div>You can safely ignore the message if you call osm3s_query on the command line.<br>
It's a leftover from the purpose of using it via the CGI interface of a web<br>
browser.<br>
<div class="im"><br>
> Sorry if this is obvious - I haven't tried to look at your code to see what<br>
> it is doing!<br>
<br>
</div>Questions are always welcome. Even if it were obvious (it is not), it is still<br>
a good hint for me how to improve the instructions.<br>
<div class="im"><br>
> The other question is whether anyone has written a php script (or similar)<br>
> to make this emulate xapi queries to use as a direct replacement for xapi?<br>
<br>
</div>AFAIK no yet. I think it would be feasible for<br>
<br>
/map?bbox=..<br>
(gets '<bbox-query n="" s="" w="" e=""/><print/>')<br>
<br>
/node[..] (with or without bbox)<br>
(like the first query in the instructions, maybe without bbox)<br>
<br>
/way[..]<br>
(gets '<query type="way"><has-kv k="" v=""/></query><print/>'<br>
 or maybe '<query type="way"><has-kv k=""/></query><print/>'<br>
<br>
/relation[..]<br>
(gets '<query type="relation"><has-kv k="" v=""/></query><print/>')<br>
<br>
/*  (all three without bbox)<br>
(gets:<br>
  <union><br>
    <query type="node"><has-kv k="" v=""/></query><br>
    <query type="way"><has-kv k="" v=""/></query><br>
    <query type="relation"><has-kv k="" v=""/></query><br>
  </union><br>
  <print/><br>
)<br>
<br>
but the other queries may get more difficult.<br>
<br>
Cheers,<br>
<font color="#888888"><br>
Roland<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Graham Jones<div>Hartlepool, UK.</div><br>
</div>