XML
A number of Layer types in OpenLayers use Extensible Markup Language (XML) to load structured data from a file or URL. This makes it easy to draw complex layers with little or no additional coding. There is also support for non-XML formats in several forms like WKT and GeoJSON.
In particular this means that data can be combined from a number of sources without requiring any server side processing as layers are assembled by the client.
In many cases current support for these formats is (currently) very minimal: Primarily designed to get people started.
This page describes and compares the various formats, linking to examples and language specifications where available.
A useful comparison of the various formats is provided by the vector-formats example [but which lacks example data???] - http://openlayers.org/dev/examples/vector-formats.html
Vector layers are probably best suited to displaying XML type data, and can include markers displayed as external images via styling in a vector layer, as in the vector-features example - http://openlayers.org/dev/examples/vector-features.html
GeoRSS - Geographically Encoded Objects for RSS feeds
"GeoRSS is an emerging standard for encoding location as part of an RSS feed." - wikipedia
Currently, there are two forms of GeoRSS parsing.
There is the GeoRSS *layer*, which uses parsing in the layer, and only supports GeoRSS simple points and W3C Geo Points. This creates markers and popups for the features for you.
There is also the GeoRSS Format parser, which allows reading and writing of Vector Features from GeoRSS simple documents, including points, lines, and polygons. This section addresses the GeoRSS Format parser.
Read: Can read W3C Geo points and most GeoRSS Simple features. Does not support georss:box.
- Point
- Line
- Polygon
Write: Can be used to serialise vector data drawn with the editing toolbar - http://openlayers.org/dev/examples/georss-serialize.html
Question: Can GeoRSS display vector data such as that created with the serialise example?
- Yes, it can. However, the current GeoRSS layer does not use the Format.GeoRSS class, and therefore can not display anything other than points.
- Specification: http://georss.org/
- Format: http://dev.openlayers.org/docs/files/OpenLayers/Format/GeoRSS-js.html
- Layer: http://dev.openlayers.org/docs/files/OpenLayers/Layer/GeoRSS-js.html
GML - Geography Markup Language
"The Geography Markup Language (GML) is the XML grammar defined by the Open Geospatial Consortium (OGC) to express geographical features. GML serves as a modeling language for geographic systems as well as an open interchange format for geographic transactions on the Internet." - - wikipedia
Read: Full support for all geometries, including reading of attributes. http://openlayers.org/dev/examples/gml-layer.html
- Point
- LineString
- Polygon
- MultiPoint
- MultiLineString
- MultiPolygon
Write: Serialise vector data drawn with the editing toolbar [example does not seem to work in firefox 2.0???] - http://openlayers.org/dev/examples/gml-serialize.html
- Specification: http://portal.opengeospatial.org/files/?artifact_id=4700 (requires EULA to read)
- Format: http://dev.openlayers.org/docs/files/OpenLayers/Format/GML-js.html
- Layer: http://dev.openlayers.org/docs/files/OpenLayers/Layer/GML-js.html
KML - Keyhole Markup Language
"KML (Keyhole Markup Language) is an XML-based language for managing the display of three-dimensional geospatial data in application programs. " wikipedia
The KML specification is defined by Google and is used in GoogleMaps.
Read: Example [broken???] - http://openlayers.org/dev/examples/kml-layer.html
- Specification: http://code.google.com/apis/kml/documentation/
- Format: http://dev.openlayers.org/docs/files/OpenLayers/Format/KML-js.html
- Layer: http://dev.openlayers.org/docs/files/OpenLayers/Layer/KML-js.html
GeoJSON
"JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. GeoJSON is a collaborative project to to determine what, if any, geographic content can be encoded in JSON. http://wiki.geojson.org/
Read: Example???
Write: Example???
- Specification: http://wiki.geojson.org/GeoJSON_draft_version_2
- Format: http://dev.openlayers.org/docs/files/OpenLayers/Format/GeoJSON-js.html
- Layer: ???
