Rethinking CRS

From GeoJSON
Jump to: navigation, search

This is proposed new language for the CRS section of the spec (currently at draft version 5). "CRS Armageddon" in other words.

See also http://lists.geojson.org/pipermail/geojson-geojson.org/2008-March/000366.html

  1. Coordinate Reference Systems: The coordinate reference system (CRS) of a GeoJSON object is determined by its "crs" member. If an object has no "crs" member, its parent object's "crs" member may be acquired. If no CRS can be so acquired, the default CRS shall apply to the GeoJSON object.
    1. Default coordinate reference system: The default is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of decimal degrees.
    2. The "crs" member: The value of a member named "crs" must be an object (referred to as the CRS object below) or null. If the value of CRS is null, it means that no CRS can be assumed.
      1. The CRS object: A CRS object has 2 mandatory members: "type", and "properties".
      2. The "type" member: The value of this required member must be a string, indicating one of the 2 types of CRS objects: "name" or "link".
      3. The "properties" member: The value of this required member must be an object.
    3. CRS object types: There are 2 types of CRS objects.
      1. Named: A CRS object may indicate a coordinate reference system by name. The value of its "properties" member must be an object containing a "name" member. The value of that "name" member must be a string identifying a coordinate reference systems. OGC CRS URNs such as "urn:ogc:def:crs:OGC:1.3:CRS84" shall be preferred over legacy identifiers such as "EPSG:4326".
        1. Example:
          "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}}
      2. Linked: A CRS object may link to CRS parameters on the Web. In this case the value of its "properties" member must be a Link object (see below).
        1. The Link object: A link object has 1 required member: "href", and 1 optional member: "type". The link object is similar to Atom/HTML/RSS links.
          1. The "href" member: The value of this required member must be a dereferenceable URI.
          2. The "type" member: The value of this optional member must be a string that hints at the format used to represent CRS parameters at the provided URI. Suggested values are: "proj4", "ogcwkt", "esriwkt", though others can be used.
        2. Example:
          "crs": {"type": "link", "properties": {"href": "http://example.com/crs/42", "type": "proj4"}}
          Relative links may be used to direct processors to CRS parameters in an auxiliary file:
          "crs": {"type": "link", "properties": {"href": "data.prj", "type": "proj4"}}