kml2gmt and line breaks in kml file
|Target version:||Candidate for next bugfix release|
At least versions 5.1.1 and 5.1.2.
Coordinates block must be preceeded and ended by line break. So for example
<Polygon><outerBoundaryIs><LinearRing><coordinates>-115.7,32.8 ... -115.7,32.8</coordinates></LinearRing></outerBoundaryIs></Polygon>must be transformed to:
<Polygon><outerBoundaryIs><LinearRing><coordinates> -115.7,32.8 ... -115.7,32.8 </coordinates></LinearRing></outerBoundaryIs></Polygon>Otherwise the .xy file obtained from kml file:
gmt kml2gmt file_name.kml -V > file_name.xylooks like this:
> Next feature > Next feature > Next feature ... > Next feature 13.6 53.3 -113.7 53.4 ... > Next feature > Next feature > Next feature ...(only pieces of coordinate sets from time to time among many empty > Next feature. Most of coordibates are lost. Moreover some of coordinate numbers are broken, like 13.6 here instead of -113.6.)
#2 Updated by Dariusz over 3 years ago
- File Paths without linebreaks.kml.xy added
- File Paths.kml added
- File Paths.kml.xy added
- File kml2gmt.bat added
- File Paths without linebreaks.kml added
Sure, here are .bat file, input and output files. Perhaps using the name of module as name of bat file is not good idea.
gmt kml2gmt "Paths without linebreaks.kml" -V > "Paths without linebreaks.kml.xy" gmt kml2gmt "Paths.kml" -V > "Paths.kml.xy"And when coordinates block has no linebraks at the ends, the output is:
> -L"Path1" > -L"Path2" > -L"Path3" > -L"Path4" > -L"Path5" > -L"Path6" > -L"Path7" > -L"Path8"(no coordinates at all in this particular case)
#3 Updated by Paul over 3 years ago
- Status changed from Feedback to Resolved
- Target version set to Candidate for next bugfix release
I guess we based our algorithm on Google Earth KML output which is more structured and did not consider a single line with lots of coordinates. Now we do, should be fixed in r14327.