Re: [OSM-dev] Difficulty fetching data from API in own app, but not browser

2018-07-26 Thread Nick Whitelegg
Thanks for that.


As it happens the error was the same as the github issue below; it was due to 
aan NPE caused by getTags() returning null.

What threw me a bit was that the code was catching the NPE and throwing it as 
an XML parser exception.


Next time: make sure I print the full stack trace... ;-)


Nick


From: mmd 
Sent: 24 July 2018 21:44:24
To: dev@openstreetmap.org
Subject: Re: [OSM-dev] Difficulty fetching data from API in own app, but not 
browser

Am 24.07.2018 um 17:47 schrieb Nick Whitelegg:
>

> The error is an odd one and seems to be related to the XML parser within
> osmapi:
>
> specifically "Error parsing XML at END_TAG, line 25670".
>

Similar error messages have been reported in the osmapi repo before.
Maybe you want to review them in more detail, like the following one:
https://github.com/westnordost/osmapi/issues/13

After all, the parsing error might turn out to be a completely different
error in your own code rather than some issue in the osmapi library.

--









___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difficulty fetching data from API in own app, but not browser

2018-07-24 Thread mmd
Am 24.07.2018 um 17:47 schrieb Nick Whitelegg:
> 

> The error is an odd one and seems to be related to the XML parser within
> osmapi:
> 
> specifically "Error parsing XML at END_TAG, line 25670".
> 

Similar error messages have been reported in the osmapi repo before.
Maybe you want to review them in more detail, like the following one:
https://github.com/westnordost/osmapi/issues/13

After all, the parsing error might turn out to be a completely different
error in your own code rather than some issue in the osmapi library.

-- 









___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difficulty fetching data from API in own app, but not browser

2018-07-24 Thread Nick Whitelegg

Thanks.


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.


Trying it again reveals the problem is location dependent, not frequency 
dependent - the error is always thrown near Haslemere, Surrey.

The error is an odd one and seems to be related to the XML parser within osmapi:


specifically "Error parsing XML at END_TAG, line 25670".


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  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.

Thanks,

Nick



From: Simon Poole 
Sent: 24 July 2018 07:43:18
To: dev@openstreetmap.org
Subject: Re: [OSM-dev] Difficulty fetching data from API in own app, but not 
browser


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.


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).


Simon

Am 23.07.2018 um 18:19 schrieb Nick Whitelegg:


 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?

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)?


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.


Thanks,

Nick



From: Nick Whitelegg 
<mailto:nick.whitel...@solent.ac.uk>
Sent: 23 July 2018 16:50:14
To: dev@openstreetmap.org<mailto:dev@openstreetmap.org>
Subject: [OSM-dev] Difficulty fetching data from API in own app, but not browser



Hi,

Currently experiencing some inconsistent behaviour with the API in which 
fetching via the browser gives a response,

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.


MapThePaths uses the osmapi (Tobias Zwick) to fetch data.


Is there any reason currently why the API might be responding to standard web 
browsers but not custom apps?


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:  
-0.7295872761598865,51.09355911139382,-0.7005316007485753,51.11122494429744.


Sometimes, however, my app is retrieving data from OSM successfully (perhaps 
60-70% of the time).

No exception is thrown - just looks like a timeout.


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.


Is this simply related to the issues with the OSM API at the moment related to 
moving to another server?


Thanks,

Nick


Nick Whitelegg
Senior Lecturer in Computing (Internet)  | School of Media Arts and Technology
Southampton Solent University  | RM424 | East Park Terrace | Southampton SO14 
0YN
T: 023 8201 3075 | E: 
nick.whitel...@solent.ac.uk<mailto:nick.whitel...@solent.ac.uk> | W: 
solent.ac.uk<http://www.solent.ac.uk/>

Disclaimer<http://www.solent.ac.uk/disclaimer/disclaimer.aspx>



___
dev mailing list
dev@openstreetmap.org<mailto:dev@openstreetmap.org>
https://lists.openstreetmap.org/listinfo/dev


___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difficulty fetching data from API in own app, but not browser

2018-07-24 Thread Simon Poole
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.


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).


Simon


Am 23.07.2018 um 18:19 schrieb Nick Whitelegg:
>
>
>  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?
>
> 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)?
>
>
> 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.
>
>
> Thanks,
>
> Nick
>
>
>
> 
> *From:* Nick Whitelegg 
> *Sent:* 23 July 2018 16:50:14
> *To:* dev@openstreetmap.org
> *Subject:* [OSM-dev] Difficulty fetching data from API in own app, but
> not browser
>  
>
>
> Hi,
>
>
> Currently experiencing some inconsistent behaviour with the API in
> which fetching via the browser gives a response,
>
> 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.
>
>
> MapThePaths uses the osmapi (Tobias Zwick) to fetch data.
>
>
> Is there any reason currently why the API might be responding to
> standard web browsers but not custom apps?
>
>
> 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:
>  -0.7295872761598865,51.09355911139382,-0.7005316007485753,51.11122494429744.
>
>
> Sometimes, however, my app is retrieving data from OSM successfully
> (perhaps 60-70% of the time).
>
> No exception is thrown - just looks like a timeout.
>
>
> 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.
>
>
> Is this simply related to the issues with the OSM API at the moment
> related to moving to another server?
>
>
> Thanks,
>
> Nick
>
>
> *Nick Whitelegg*
> *Senior Lecturer in Computing (Internet)*  *|* School of Media Arts
> and Technology
> Southampton Solent University  *|* RM424 *|* East Park Terrace *|*
> Southampton SO14 0YN
> T: 023 8201 3075 *|*E: nick.whitel...@solent.ac.uk
> <mailto:nick.whitel...@solent.ac.uk>*|*W: solent.ac.uk
> <http://www.solent.ac.uk/>
>
> Disclaimer <http://www.solent.ac.uk/disclaimer/disclaimer.aspx>
>
>
> ___
> dev mailing list
> dev@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev



signature.asc
Description: OpenPGP digital signature
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difficulty fetching data from API in own app, but not browser

2018-07-23 Thread mmd
Am 23.07.2018 um 18:19 schrieb Nick Whitelegg:
> 
>  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?
> 

I think that's correct. The /map API call is handled by cgimap, which
has some rate limiting in place. It depends on the data volume returned
by a request, so fetching data for large areas will increase the
likelihood of hitting your quota fairly soon. I don't recall any
specifics at the moment, though.

-- 


___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Difficulty fetching data from API in own app, but not browser

2018-07-23 Thread Nick Whitelegg

 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?

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)?


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.


Thanks,

Nick



From: Nick Whitelegg 
Sent: 23 July 2018 16:50:14
To: dev@openstreetmap.org
Subject: [OSM-dev] Difficulty fetching data from API in own app, but not browser



Hi,

Currently experiencing some inconsistent behaviour with the API in which 
fetching via the browser gives a response,

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.


MapThePaths uses the osmapi (Tobias Zwick) to fetch data.


Is there any reason currently why the API might be responding to standard web 
browsers but not custom apps?


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:  
-0.7295872761598865,51.09355911139382,-0.7005316007485753,51.11122494429744.


Sometimes, however, my app is retrieving data from OSM successfully (perhaps 
60-70% of the time).

No exception is thrown - just looks like a timeout.


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.


Is this simply related to the issues with the OSM API at the moment related to 
moving to another server?


Thanks,

Nick


Nick Whitelegg
Senior Lecturer in Computing (Internet)  | School of Media Arts and Technology
Southampton Solent University  | RM424 | East Park Terrace | Southampton SO14 
0YN
T: 023 8201 3075 | E: 
nick.whitel...@solent.ac.uk<mailto:nick.whitel...@solent.ac.uk> | W: 
solent.ac.uk<http://www.solent.ac.uk/>

Disclaimer<http://www.solent.ac.uk/disclaimer/disclaimer.aspx>
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


[OSM-dev] Difficulty fetching data from API in own app, but not browser

2018-07-23 Thread Nick Whitelegg

Hi,

Currently experiencing some inconsistent behaviour with the API in which 
fetching via the browser gives a response,

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.


MapThePaths uses the osmapi (Tobias Zwick) to fetch data.


Is there any reason currently why the API might be responding to standard web 
browsers but not custom apps?


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:  
-0.7295872761598865,51.09355911139382,-0.7005316007485753,51.11122494429744.


Sometimes, however, my app is retrieving data from OSM successfully (perhaps 
60-70% of the time).

No exception is thrown - just looks like a timeout.


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.


Is this simply related to the issues with the OSM API at the moment related to 
moving to another server?


Thanks,

Nick


Nick Whitelegg
Senior Lecturer in Computing (Internet)  | School of Media Arts and Technology
Southampton Solent University  | RM424 | East Park Terrace | Southampton SO14 
0YN
T: 023 8201 3075 | E: 
nick.whitel...@solent.ac.uk | W: 
solent.ac.uk

Disclaimer
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev