Skip to content
Prev 23204 / 29559 Next

getKMLcoordinates - subscript out of bounds

Dear all,

I've been working on a script to read KML file coordinates using
getKMLcoordinates from "maptools" package.

The tool reads the <coordinates> section of the KML/XML file.

file="example.kml"
kml=getKMLcoordinates(file, ignoreAltitude=TRUE)

I'm getting a "subscript out of bounds" error:

Error in m[, 1:2] : subscript out of bounds

The KML files have the <coordinates> section correctly arranged,  in
addition I'm getting warning messages

1: In readLines(kmlfile, encoding = "UTF-8") : invalid input found on input
connection 'file'
2: In readLines(kmlfile, encoding = "UTF-8") : incomplete final line found
on 'file'

I can't figure out what is the problem.

Felipe Ram?rez
GIS analyst and developer