placemark / togeojson

convert KML, TCX, and GPX to GeoJSON, without the fuss
https://placemark.github.io/togeojson/
BSD 2-Clause "Simplified" License
410 stars 67 forks source link

Support for custom KML schema #69

Closed handymenny closed 2 years ago

handymenny commented 2 years ago

In a KML you can extend the "default" elements in this way:

<Schema parent="Placemark" name="S_country">  
    <SimpleField type="wstring" name="CNTRY_NAME">
    </SimpleField> 
    </SimpleField>
    <SimpleField type="wstring" name="CURR_TYPE">
    </SimpleField>
    <SimpleField type="wstring" name="CURR_CODE">
    </SimpleField>
  </Schema>
  <S_country>
    <name>Test</name>
        <Point>
        <coordinates>16.54,40.6</coordinates>
    </Point>
        <CURR_TYPE>Test</CURR_TYPE>
    <CNTRY_NAME>Test</CNTRY_NAME>
    <CURR_CODE>Test</CURR_CODE>
  </S_country>

With such a KML this library returns an empty list of features.

Is there any plan to support KML containing custom KML schema? Is this functionality considered in the scope of this library?

tmcw commented 2 years ago

Well, it's in the KML spec and it is useful to data consumers that aren't Google Earth, so it's in scope. I'm in the middle of a pretty large refactor of this project to use TypeScript and support folders, but once that's shipped I'll take a look at this.