13

I sometimes see srsName="EPSG:4326" in GML documents (e.g. https://postgis.net/docs/ST_GeomFromGML.html, although my particular source is not public). The intent (except perhaps for axis order that isn't important here) is clear, and probably interoperable across various systems, but I wonder if that is actually specification compliant.

I've looked at the OGC Naming Authority and OGC URN policy, and they use the urn:ogc:def:crs:EPSG:\d{4,5} form (i.e. it would be urn:ogc:def:crs:EPSG:4326).

The GML Point Profile (OGC 05-029r4) uses srsName="urn:ogc:def:crs:EPSG:6.6:4326" in examples, and requires that to be "well known". I don't see anything in there that actually excludes any particular srsName though.

Is the srsName="EPSG:abcd" form (in particular, srsName="EPSG:4326") specification compliant for a GML 3.1 or 3.2 element (in particular, for Point Profile)?

1
  • 1
    Rejected the add of the postgis tag - the question is not about postgis (or any other implementation), but rather about the spec.
    – BradHards
    May 27, 2017 at 11:37

1 Answer 1

12
+50

Yes, srsName="EPSG:abcd" is GML-3 compliant but only in an application context where EPSG:abcd points to a CRS definition. As of 2013, OGC best practice (documented here) is to use http URIs of the form http://www.opengis.net/def/crs/EPSG/0/4326.

The GML-3.0.0 spec (OCG 02-023r4) section v.2, page xiv states aliasing CRSs is kosher:

in GML we have found it convenient for an identified object to be able to carry several “names” – i.e. labels either assigned by external authorities or commonly used for an object. These may be distinguished from each other by noting the “codeSpace” for a name, which allows a consumer of the information to select the appropriate name for them to use.

The GML-3.2.1 spec (OGC 03-105r1) section 10.1.3.2, page 56 says :

In general the attribute srsName [of type="anyURI"] points to a CRS instance of gml:AbstractCoordinateReferenceSystem (see 12.2.3). For well-known references it is not required that the CRS description exists at the location the URI points to.

While there's no explicit definition of "well-known" within the GML-3 spec, using OGC 05-029r4 (section 4, page 8)'s definition of "well-known" as "not requiring resolution," so long as an application can internally identify a CRS from an URI , you might say the CRS is "well-known." Thus, using GML-3.1 & 3.2's somewhat complicated system of pointing to CRSs by name can be interpreted as the CRSs being well-known, and so EPSG:abcd is perfectly valid. If you want to explore the exact methods with which GML points to a CRS via an srsName, see referenceSystems.xsd in http://schemas.opengis.net/gml/3.1.0/base/ and http://schemas.opengis.net/gml/3.2.1/ .

It is worth noting that after the publication of the white paper "OGC Identifiers-the Case for HTTP URIs" (OGC 10-124r1) came out in 2010, OGC specification documents more or less transitioned to that standard.

11
  • Can you say why you think "EPSG:####" is a URN? From tools.ietf.org/html/rfc8141#section-2 it would have to start with urn: as the registered URI scheme, at least. Also, I don't get what you think this is do with geoserver (which I am fairly familiar with).
    – BradHards
    Jun 3, 2017 at 0:58
  • Yep, my mistake, EPSG:#### is not an URN. I gave the geoserver WFS docs since both it gives some examples of valid srsName formats, but you're right, it's off-topic. I've edited both pieces out. Jun 3, 2017 at 1:08
  • OK, then why is it a valid URI? I don't see that "EPSG" is a registered scheme (not in canonical lower case form). Also, while the schema says anyURI, that is perhaps not sufficient to be spec compliant (i.e. the spec has other requirements, which valid against the schema is just one).
    – BradHards
    Jun 3, 2017 at 1:25
  • 3
    Is there a, definition of anyURI, that excludes individual schemes? Syntactical epsg:code could be a URI. There is no rule for upper or lower case letters in rfc3986. The type anyURI for srsName is not Geotools specific. Its defined in OGC 07-036 "OpenGIS® Geography Markup Language (GML) Encoding Standard" Chapter 10.1.3.2 SRSReferenceGroup. Jun 3, 2017 at 1:48
  • It may not be a valid URI, but it is spec compliant if it is recognizable. See OGC 07-036 GML V3.2.1 section 10.1.3.2 : "In general the attribute srsName points to a CRS instance of gml:AbstractCoordinateReferenceSystem (see 12.2.3). For well-known references it is not required that the CRS description exists at the location the URI points to." Jun 3, 2017 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.