- Google KML Reader/Writer
- Google KML Quick Facts
- Resource Traversal
- Reader Parameters
- Writer Parameters
- Feature Types
- Writer Pipelines
- Atom Metadata
- Style Management and Common Styles
- Document Element Omission
- Raw Text
- Update Mode
- Feature Representation
- KML Dataset Structure
- File Structure
- Identifying Elements
- Documents and Folders
- Tours
- Extended Data
- Layers and Feature Type Fanout
- Feature Attributes
- Geometry
- 3D
- Common Element Attributes
- Common Format Attributes
- NetworkLinkControl
- Document
- Folder
- Placemark
- ScreenOverlay
- GroundOverlay
- PhotoOverlay
- NetworkLink
- Style
- StyleMap
- Tour
- AnimatedUpdate
- FlyTo
- SoundCue
- TourControl
- Wait
You are here: Popular Formats > Google KML Reader/Writer > Feature Representation > Documents and Folders > Element Order
Element Order
The KML writer uses the following criteria to determine the order of the contents of a KML Folder or Document:
- If the container has a "sort-by" attribute name specified via the kml_sort_by_attribute format attribute, the value of that attribute on each feature will be used to sort the contents of the container in ascending alphanumeric order. The "sort-by" attribute can also be specified using the KML21_SORT_BY_ATTRIBUTE defline parameter for features with user-defined schema
- Individual features can over-ride the value of any "sort-by" attribute with the kml_sort_value format attribute; the value of which will be used for determining the sort order.
- If neither of the above criteria is met, then the arrival order of each feature is used to determine the order of the feature in the container. This makes it possible to sort the features prior to being written to the KML writer.