r-tmap/tmaptools

XML parser error in geocoding when hashtag in string

Opened this issue · 0 comments

When geocoding queries have a hashtag/pound symbol, it errors out. Reproducible example with an address where nothing changes except the hashtag:

> geocode_OSM("Mamata College of Nursing, Tenali, 7-5-26, lecturers colony, ganganammapeta, tenali, Guntur, Andhra Pradesh")
No results found for "Mamata College of Nursing, Tenali, 7-5-26, lecturers colony, ganganammapeta, tenali, Guntur, Andhra Pradesh".
NULL
> geocode_OSM("Mamata College of Nursing, Tenali, #7-5-26, lecturers colony, ganganammapeta, tenali, Guntur, Andhra Pradesh")
Opening and ending tag mismatch: meta line 6 and head
Entity 'times' not defined
Entity 'copy' not defined
error parsing attribute name
attributes construct error
Couldn't find end of Start Tag input line 160
error parsing attribute name
attributes construct error
Couldn't find end of Start Tag input line 192
Opening and ending tag mismatch: input line 270 and div
Opening and ending tag mismatch: div line 269 and form
Opening and ending tag mismatch: form line 268 and div
Opening and ending tag mismatch: div line 267 and script
Opening and ending tag mismatch: td line 418 and tr
Opening and ending tag mismatch: tr line 416 and table
Opening and ending tag mismatch: table line 370 and div
EntityRef: expecting ';'
Opening and ending tag mismatch: div line 356 and script
expected '>'
Entity 'nbsp' not defined
expected '>'
Opening and ending tag mismatch: script line 318 and body
Opening and ending tag mismatch: script line 253 and html
Premature end of data in tag body line 18
Premature end of data in tag meta line 4
Premature end of data in tag head line 3
Premature end of data in tag html line 2
Error: 1: Opening and ending tag mismatch: meta line 6 and head
2: Entity 'times' not defined
3: Entity 'copy' not defined
4: error parsing attribute name
5: attributes construct error
6: Couldn't find end of Start Tag input line 160
7: error parsing attribute name
8: attributes construct error
9: Couldn't find end of Start Tag input line 192
10: Opening and ending tag mismatch: input line 270 and div
11: Opening and ending tag mismatch: div line 269 and form
12: Opening and ending tag mismatch: form line 268 and div
13: Opening and ending tag mismatch: div line 267 and script
14: Opening and ending tag mismatch: td line 418 and tr
15: Opening and ending tag mismatch: tr line 416 and table
16: Opening and ending tag mismatch: table line 370 and div
17: EntityRef: expecting ';'
18: Opening and ending tag mismatch: div line 356 and script
19: expected '>'
20: Entity 'nbsp' not defined
21: expected '>'
22: Opening and ending tag mismatch: script line 318 and body
23: Opening and ending t

This seems to be an XML issue, but I don't understand why it's showing up in geocode_OSM. My session info:

R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 10 (buster)