1

I can't make osmar work anymore. I tried to reproduce the documentation's example, and even that produces a very long error code. I could not find the same error anywhere. Any idea ?

The code is :

require(osmar)  
api <- osmsource_api()  
box <- corner_bbox(11.579341, 48.15102, 11.582852, 48.1530)  
gschw <- get_osm(box, source = api)  

The error is :

Opening and ending tag mismatch: BR line 6 and FONT
AttValue: " or ' expected
attributes construct error
Couldn't find end of Start Tag TABLE line 9
AttValue: " or ' expected
attributes construct error
Couldn't find end of Start Tag FONT line 11
Opening and ending tag mismatch: BR line 14 and FONT
Opening and ending tag mismatch: BR line 13 and TD
Opening and ending tag mismatch: TD line 10 and TR
AttValue: " or ' expected
attributes construct error
Couldn't find end of Start Tag HR line 19
AttValue: " or ' expected
attributes construct error
Couldn't find end of Start Tag HR line 24
Opening and ending tag mismatch: BR line 23 and FONT
Opening and ending tag mismatch: BR line 22 and TD
Opening and ending tag mismatch: BR line 20 and TR
AttValue: " or ' expected
attributes construct error
Couldn't find end of Start Tag FONT line 34
EntityRef: expecting ';'
Opening and ending tag mismatch: br line 36 and FONT
Opening and ending tag mismatch: br line 36 and i
Opening and ending tag mismatch: br line 36 and B
Opening and ending tag mismatch: BR line 35 and TD
Opening and ending tag mismatch: B line 33 and TR
Opening and ending tag mismatch: i line 33 and TABLE
Opening and ending tag mismatch: TD line 32 and blockquote
Opening and ending tag mismatch: TR line 32 and FONT
Opening and ending tag mismatch: FONT line 18 and BODY
Opening and ending tag mismatch: TD line 17 and HTML
Premature end of data in tag TR line 17
Premature end of data in tag TR line 10
Premature end of data in tag blockquote line 8
Premature end of data in tag FONT line 5
Premature end of data in tag BODY line 4
Premature end of data in tag HTML line 1
Error: 1: Opening and ending tag mismatch: BR line 6 and FONT
2: AttValue: " or ' expected
3: attributes construct error
4: Couldn't find end of Start Tag TABLE line 9
5: AttValue: " or ' expected
6: attributes construct error
7: Couldn't find end of Start Tag FONT line 11
8: Opening and ending tag mismatch: BR line 14 and FONT
9: Opening and ending tag mismatch: BR line 13 and TD
10: Opening and ending tag mismatch: TD line 10 and TR
11: AttValue: " or ' expected
12: attributes construct error
13: Couldn't find end of Start Tag HR line 19
14: AttValue: " or ' expected
15: attributes construct error
16: Couldn't find end of Start Tag HR line 24
17: Opening and ending tag mismatch: BR line 23 and FONT
18: Opening and ending tag mismatch: BR line 22 and TD
19: Opening and ending tag mismatch: BR line 20 and TR
20: AttValue: " or ' expected
21: attributes construct error
22: Couldn't find end of Start Tag FONT line 34
23: EntityRef: expecting ';'
24: Opening and ending tag mismatch: br l

  • The example works for me, it seems that get_osm_data fetched a HTML page instead of OSM XML data in your error. Check the output of osmar:::get_osm_data.api(api, box), this should be in OSM XML format. – rcs Jun 10 '16 at 14:14
  • Thank you Rainer Stuetz. I'm behind a proxy, which may be transforming an HTML error into an HTML page like "hi dude, I can't help you". Then this page may be parsed as OSM XML without much success. I will have a look at it :) – VeilleData Jun 14 '16 at 7:40
  • Just tried osmar:::get_osm_data.api(api, box), and it indeed is a bunch of html telling me I should fill in my credentials. – VeilleData Jun 14 '16 at 7:57
0

OP here, I can now answer my own question thanks to Rainer Stuetz :)

The call was made from behind a proxy, and without proper login / password. Therefore, the proxy returned an HTTP page instead of an XML one, which in turn could not be parsed as XML (obviously).

You can diagnose the problem with a call to osmar:::get_osm_data.api(api, box). If it does not return XML, then we have the same issue.

I'm currently trying to know how to set the login/pass here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.