OpenLayers format reading speed - simple feature (v3)

Revision 3 of this benchmark created on


Description

Geometry - Point Thematic attributes - None

Preparation HTML

<script src="http://openlayers.org/api/2.13.1/OpenLayers.js"></script>

Setup

var proj = {
      'internalProjection': "EPSG:4326",
      'externalProjection': new OpenLayers.Projection("EPSG:4326")
    };
    
    var gml = OpenLayers.Util.extend(
      OpenLayers.Util.extend({}, {
        featureType: "feature",
        featureNS: "http://example.com/feature"
      }),
      proj
    );
    
    var kml = OpenLayers.Util.extend({
      extractStyles: true
    }, proj);
    
    var formats = {
      wkt: new OpenLayers.Format.WKT(proj),
      geojson: new OpenLayers.Format.GeoJSON(proj),
      georss: new OpenLayers.Format.GeoRSS(proj),
      gml2: new OpenLayers.Format.GML.v2(gml),
      gml3: new OpenLayers.Format.GML.v3(gml),
      kml: new OpenLayers.Format.KML(kml),
      gpx: new OpenLayers.Format.GPX(proj),
      ep: new OpenLayers.Format.EncodedPolyline(proj)
    };
    
    var data = {
      wkt: "POINT(100 0)",
      geojson: {
        "type": "Feature",
        "properties": {},
        "geometry": {
          "type": "Point",
          "coordinates": [100, 0]
        },
        "crs": {
          "type": "name",
          "properties": {
            "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
          }
        }
      },
      georss: "<item xmlns='http://backend.userland.com/rss2'><title></title><description></description><georss:point xmlns:georss='http://www.georss.org/georss'>0 100</georss:point></item>",
      gml2: "<gml:featureMember xmlns:gml='http://www.opengis.net/gml' xsi:schemaLocation='http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><feature:feature xmlns:feature='http://example.com/feature'><feature:geometry><gml:Point><gml:coordinates decimal='.' cs=', ' ts=' '>100, 0</gml:coordinates></gml:Point></feature:geometry></feature:feature></gml:featureMember>",
      gml3: "<gml:featureMember xmlns:gml='http://www.opengis.net/gml' xsi:schemaLocation='http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><feature:feature xmlns:feature='http://example.com/feature'><feature:geometry><gml:Point><gml:pos>100 0</gml:pos></gml:Point></feature:geometry></feature:feature></gml:featureMember>",
      kml: "<kml xmlns='http://earth.google.com/kml/2.0'><Folder><name>OpenLayers export</name><description>Exported on Sun Aug 11 2013 14:40:22 GMT+0200 (Central Europe Daylight Time)</description><Placemark><name>OpenLayers_Feature_Vector_67</name><description>No description available</description><Point><coordinates>100, 0</coordinates></Point></Placemark></Folder></kml>",
      gpx: "<gpx xmlns='http://www.topografix.com/GPX/1/1' version='1.1' creator='OpenLayers' xsi:schemaLocation='http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><wpt lon='100' lat='0'><name>OpenLayers_Feature_Vector_67</name><desc>No description available</desc></wpt></gpx>",
      ep: "?_gjaR",
    };
    
    function deserialize(format) {
      return formats[format].read(data[format]);
    }

Teardown


    proj = gml = kml = formats = data = null;
  

Test runner

Ready to run.

Testing in
TestOps/sec
WKT
deserialize("wkt");
ready
GML v2
deserialize("gml2");
ready
GML v3
deserialize("gml3");
ready
KML
deserialize("kml");
ready
GeoJSON
deserialize("geojson");
ready
GeoRSS
deserialize("georss");
ready
Encoded Polyline
deserialize("ep");
ready
GPX
deserialize("gpx");
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.