<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">As it happens there was a small bug in my code where certain exceptions were being thrown away without being caught so I missed what was going on.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Trying it again reveals the problem is location dependent, not frequency dependent - the error is always thrown near Haslemere, Surrey.</p>
<p style="margin-top:0;margin-bottom:0"><br>
The error is an odd one and seems to be related to the XML parser within osmapi:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">specifically "Error parsing XML at END_TAG, line 25670".</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">However if I download that XML in the browser for that exact bbox, it appears to be accepted as well-formed XML in Firefox and there's nothing odd in the XML at line 25670 (which is a </way> tag). Maybe it's an out-of-memory
 issue; if I consistently get the problem across different devices I'll contact the author of osmapi.</p>
<p style="margin-top:0;margin-bottom:0"><br>
Thanks,</p>
<p style="margin-top:0;margin-bottom:0">Nick<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
<p></p>
<br>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Simon Poole <simon@poole.ch><br>
<b>Sent:</b> 24 July 2018 07:43:18<br>
<b>To:</b> dev@openstreetmap.org<br>
<b>Subject:</b> Re: [OSM-dev] Difficulty fetching data from API in own app, but not browser</font>
<div> </div>
</div>
<meta content="text/html; charset=Windows-1252">
<div style="background-color:#FFFFFF">
<p>IMHO I would 1st verify that you are actually generating the same query (and the one your expect) with wireshark (running the app in the emulator) and that what is happening is actually a time out. It seems really really really unlikely to me that you are
 running in to the rate limiting. <br>
</p>
<p><br>
</p>
<p>2x2km can naturally be a lot of data, in particular if you have largish relations in the area (even if you are not downloading all the members).</p>
<p><br>
</p>
<p>Simon<br>
</p>
<br>
<div class="x_moz-cite-prefix">Am 23.07.2018 um 18:19 schrieb Nick Whitelegg:<br>
</div>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">.... Digging a bit more, it looks like the API will reject a request if you make it relatively soon after the first; is this correct?</p>
<p style="margin-top:0; margin-bottom:0">Is there a specific time limit between requests, i.e. you can only make requests every X seconds (if so, I can code this into my app)?</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">To make it absolutely clear - I am using the API for editing purposes. Specifically, the feature I'm testing at the moment allows you to download data from the API (2x2km square centred on current location), select ways
 and add/modify a designation tag.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thanks,</p>
<p style="margin-top:0; margin-bottom:0">Nick<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style=""><br>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Nick Whitelegg
<a class="x_moz-txt-link-rfc2396E" href="mailto:nick.whitelegg@solent.ac.uk"><nick.whitelegg@solent.ac.uk></a><br>
<b>Sent:</b> 23 July 2018 16:50:14<br>
<b>To:</b> <a class="x_moz-txt-link-abbreviated" href="mailto:dev@openstreetmap.org">
dev@openstreetmap.org</a><br>
<b>Subject:</b> [OSM-dev] Difficulty fetching data from API in own app, but not browser</font>
<div> </div>
</div>
<meta content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Hi,</p>
<p style="margin-top:0; margin-bottom:0"><br>
Currently experiencing some inconsistent behaviour with the API in which fetching via the browser gives a response,</p>
<p style="margin-top:0; margin-bottom:0">but my own app ('MapThePaths', part of a project intended to help map footpaths and edit designation tags in the UK) frequently hangs waiting for a response.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">MapThePaths uses the osmapi (Tobias Zwick) to fetch data.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Is there any reason currently why the API might be responding to standard web browsers but not custom apps?</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">FWIW my app should be reporting itself as "MapThePaths Android app" and I have just (around 16:35-16:40 UK time) made three unsuccessful requests with the bbox:
<span> -0.7295872761598865,51.09355911139382,-0.7005316007485753,51.11122494429744.</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Sometimes, however, my app is retrieving data from OSM successfully (perhaps 60-70% of the time).</span></p>
<p style="margin-top:0; margin-bottom:0"><span>No exception is thrown - just looks like a timeout.</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>I also observed similar behaviour 'in the field' yesterday afternoon when I was using the app in the countryside. The app could talk to my own API on mapthepaths.org.uk successfully but could not communicate with
 the OSM API.</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Is this simply related to the issues with the OSM API at the moment related to moving to another server?<br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Thanks,</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Nick<br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<div id="x_x_Signature"><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div id="x_x_divtagdefaultwrapper" dir="ltr" style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<div style="margin:0px"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="1" face="Trebuchet MS,sans-serif"><span style="font-size:8pt"><strong>Nick Whitelegg</strong></span>
</font></span></font></div>
<div style="margin:0px"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="1" face="Trebuchet MS,sans-serif" color="red"><span style="font-size:8pt"><strong><font color="#000000">Senior Lecturer in Computing (Internet)</font></strong> </span>
</font><font size="1" face="Trebuchet MS,sans-serif" color="red"><span style="font-size:8pt"><b>|</b></span>
</font><font size="1" face="Trebuchet MS,sans-serif" color="black"><span style="font-size:8pt">School of Media Arts and Technology</span></font></span>
</font></div>
<div style="margin:0px"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="1" face="Trebuchet MS,sans-serif" color="black"><span style="font-size:8pt">Southampton Solent University<font size="1" face="Trebuchet
                          MS,sans-serif" color="red"><span style="font-size:8pt"> </span>
</font><font size="1" face="Trebuchet
                          MS,sans-serif" color="red"><span style="font-size:8pt"><b>|</b></span>
</font><font size="1" face="Trebuchet
                          MS,sans-serif" color="red"><span style="font-size:8pt"></span></font>RM424</span>
</font><font size="1" face="Trebuchet MS,sans-serif" color="red"><span style="font-size:8pt"></span></font><font size="1" face="Trebuchet MS,sans-serif" color="red"><span style="font-size:8pt"><b>|</b></span>
</font><font size="1" face="Trebuchet MS,sans-serif" color="red"><span style="font-size:8pt"></span></font><font size="1" face="Trebuchet MS,sans-serif" color="black"><span style="font-size:8pt">East Park Terrace</span>
</font><font size="1" face="Trebuchet MS,sans-serif" color="red"><span style="font-size:8pt"></span></font><font size="1" face="Trebuchet MS,sans-serif" color="red"><span style="font-size:8pt"><b>|</b></span>
</font><font size="1" face="Trebuchet MS,sans-serif" color="black"><span style="font-size:8pt">Southampton SO14 0YN</span></font>
</span></font></div>
<div style="margin:0px"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="1" face="Trebuchet MS,sans-serif" color="black"><span style="font-size:8pt">T: 023 8201 3075
</span></font><font size="1" face="Trebuchet
                      MS,sans-serif" color="red"><span style="font-size:8pt"><b>|</b></span></font><font size="1" face="Trebuchet MS,sans-serif" color="red"><span style="font-size:8pt">
</span></font><font size="1" face="Trebuchet
                      MS,sans-serif" color="black"><span style="font-size:8pt">E:
<a href="mailto:nick.whitelegg@solent.ac.uk" target="_blank" id="LPNoLP">nick.whitelegg@solent.ac.uk</a></span></font><font size="1" face="Trebuchet MS,sans-serif" color="black"><span style="font-size:8pt">
</span></font><font size="1" face="Trebuchet
                      MS,sans-serif" color="red"><span style="font-size:8pt"><b>|</b></span></font><font size="1" face="Trebuchet MS,sans-serif" color="black"><span style="font-size:8pt"> W:
</span></font><a href="http://www.solent.ac.uk/" target="_blank" id="LPNoLP"><font size="1" face="Trebuchet MS,sans-serif"><span style="font-size:8pt">solent.ac.uk</span></font></a><font size="1" face="Trebuchet MS,sans-serif" color="black"><span style="font-size:8pt">
</span></font></span></font></div>
<div style="margin:0px"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><br>
</span></font></div>
<div style="margin:0px"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><a href="http://www.solent.ac.uk/disclaimer/disclaimer.aspx" target="_blank" id="LPNoLP"><font size="1" face="Trebuchet MS,sans-serif"><span style="font-size:8pt">Disclaimer</span></font></a></span></font><br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
dev mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a>
<a class="x_moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/dev">https://lists.openstreetmap.org/listinfo/dev</a>
</pre>
</blockquote>
<br>
</div>
</body>
</html>