You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm unsure if this would be classified as out of scope for this project or not, however it could be useful to myself and likely others to extract additional details from KML file (and other formats).
For example I'm extracting a set of polygons, however the source file also has a 'name' tag which would be useful to my purposes.
The geometry class could simply have an attributes array added to it, and in KML.class.php: geomFromXML() it just needs to append any non-supported XML nodes to the attributes array if they can be parsed as text.
The library shouldn't make any assumption of what the fields actually are since they could differ from user to user.
The text was updated successfully, but these errors were encountered:
@NickStallman - I just now implemented geoPHP + kml + name/description.
While it would be nice for geoPHP to support KML attributes "out of the box" - the way kml is setup - it allows for meta data to exist on BOTH placemarks and "folders". Therefore geoPHP wouldn't be really able to expose all the meta data (at least not directly on the geometry objects). In which case, I would prefer to keep the two separate.
However, I did see a recent PR that included additional attributes from the KML parser. I would take a look around the recent PRs if I were you.
--
Here is how I implemented meta data on KML import:
Load kml file as a simplexml_load_string()
Loop through each folder; loop through each placemark
Extract meta data
Use geoPHP to import the geometry. You don't have to pass in a full xml file into geoPHP for it parse your kml! Passing just the polygon/point/geometry: $xmlPlacemark->asXml() works!
I'm unsure if this would be classified as out of scope for this project or not, however it could be useful to myself and likely others to extract additional details from KML file (and other formats).
For example I'm extracting a set of polygons, however the source file also has a 'name' tag which would be useful to my purposes.
The geometry class could simply have an attributes array added to it, and in KML.class.php: geomFromXML() it just needs to append any non-supported XML nodes to the attributes array if they can be parsed as text.
The library shouldn't make any assumption of what the fields actually are since they could differ from user to user.
The text was updated successfully, but these errors were encountered: