cleder / fastkml

Fast 🌍️ KML processing for python

Home Page:https://fastkml.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor geometry coordinates to be its own object

cleder opened this issue · comments

Coordinates are expressed as: <coordinates>-122.370,37.817,0</coordinates>
or

<coordinates>
  -122.366278,37.818844,0 -122.365248,37.819267,0
  -122.365640,37.819875,0 -122.366278,37.818844,0
</coordinates>

They can be a class (inheriting from base._XMLObject) so that geometries work nicer with the registry and avoid code duplication. This will also enable finer grained control over the geometry objects.

  • Refactor the geometry classes to take a coordinates object (for Point, LineString, LinearRing) or KML _BaseObjects (for Polygons #301 and Multigeometries)
  • Add functions for the GetKWArgs and SetElement registry Protocols.
  • Remove the _get_kwargs and etree_element methods of KML geometries
  • register the functions in the registry