-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep KML placemarks with missing coordinates #95
Comments
Hi, Thanks for the issue! I can't replicate this problem: for example, here's your example run through togeojson - https://observablehq.com/d/1c3388b177640bb7 There are 3 features in, 3 out, with one having a null geometry. Seeing the same results running the example as a testcase. As far as I can tell, this has been the case for a while - if there are no geometries in a Placemark element, then it'll output a Feature in GeoJSON with a null geometry. Are you sure you're using a recent version of this code and that the items are actually being dropped? It doesn't seem like at least the |
Ping @hyperknot - is there a testcase that demonstrates this limitation that you can share? |
@tmcw you are right, the example I thought would be a minimal repro case does produce the null geometry correctly. I'm looking more into the Google My Maps export, it's still not clear to me how it works. (For example it creates a totally different CSV based on how the point was created. Also their CSV is super trivally broken, the commas are not escaped, for example). |
Okay - closing for now, feel free to open a new issue when this gets narrowed down into a reproducible testcase! |
First of all, thanks for giving the much needed love to this library in the recent months! It became so good now that I decided to deprecate my LibKML / GDAL fallback code and only use togeojson for KML imports.
There is only one issue I have with this library, is that it silently drops KML items without valid coordinates. Now this might sound like an edge case, but Google My Maps is exporting more and more maps without coordinates.
I did some experimenting and for a few items on a map added via "Add to Map" it still allows exporting with coordinates, but I've seen reports that with hundreds of items it simply disables coordinate export. It also disables coordinate export for all items which were imported from a CSV.
For example this is how it looks online, showing coordinates:
Whereas this is what is exported:
I've created a sample map with both type of items. Here is the KML export (renamed to .txt for GitHub):
KML export test.txt
Right now, togeojson silently drops these items. I'd like to ask to please don't drop these, but add them with null geometry. From the GeoJSON specs, I found this:
I think this is exactly the case we are talking here, "unlocated" features.
The text was updated successfully, but these errors were encountered: