Print This Post

GML and Coordinate Systems

You may have wondered how in GML we designate the coordinate system used to interpret the coordinates in a <gml:coordinates>, <gml:pos> or <gml:posList> element.

Unlike KML or geoRSS (at least thus far) GML does NOT assume a single, fixed coordinate system. It must be specified by the creator of the data. The coordinate system is specified (what OGC calls a Coordinate Reference System) using the srsName attribute. This is attached to a geometry object as shown in the following example:

1
2
3
    <gml:Point gml:id="p1" srsName="#srs36">
      <gml:coordinates>100,200</gml:coordinates>
    </gml:Point>

The value of the srsName attribute is a URI. It refers to a definition of the coordinate reference system that is used to interpret the coordinates in the geometry. This definition may live in a document (e.g. a flat file) or in an online web service.

The srsName URI may also be a URN. This then provides a well known string for referencing common CRS definitions. The OGC has developed a set of URN strings for some common coordinate systems. It is intended that these URN's resolve through a URN resolver to CRS definitions.

GML provides a means of encoding CRS definitions. A draft URN structure has been created by the OGC in part for this purpose and specific URN names have been created. The OGC maintains various documents for reference: