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)?

BradHards
  • 12,881
  • 2
  • 37
  • 70
  • 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 '17 at 11:37

1 Answers1

12

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.

Pang
  • 209
  • 1
  • 7
Steven Kalt
  • 480
  • 4
  • 9
  • Can you say why you think "EPSG:####" is a URN? From https://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 03 '17 at 00: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. – Steven Kalt Jun 03 '17 at 01: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 03 '17 at 01: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. – Andreas W. Bartels Jun 03 '17 at 01: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." – Steven Kalt Jun 03 '17 at 01:52
  • @AndreasW.Bartels I understand that URI schemes are required to be registered with IANA. I still don't understand the reference to a product - this is about spec compliance, not about interoperability. – BradHards Jun 03 '17 at 02:45
  • @StevenKalt: Is this a claim that "EPSG:abcd" form "well-known" in a specification sense? That could work. Do you have a reference? – BradHards Jun 03 '17 at 02:46
  • @BradHards unfortunately, I can't find any references to support that claim. I have found a 2013 OGC best practices paper describing adoption of HTTP URIs over URNs, and all OGC standards after a 2010 white paper on http URIs using srsNames in that form. I'm going to edit my answer to use the best practices paper rather than the WFS docs. – Steven Kalt Jun 04 '17 at 21:11
  • @BradHards: While there's no explicit definition of "well-known" within the GML-3 spec., using OGC 05-029r4'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." The intent to allow applications to understand shortened srsNames shows in the spec of aliasing of CRSs via the codeSpace attribute: see the GML-3.2 spec (OGC 07-036) sections 4.1.8 and D.2.7.2. – Steven Kalt Jun 04 '17 at 22:22
  • @StevenKalt There is a lot of good stuff in the comments. Do you want to try to build a single answer out of this? – BradHards Jun 08 '17 at 06:19
  • @BradHards: Yes, I'll have that by EOD, after trying to verify if gml:codeSpace obviates srsName resolution. – Steven Kalt Jun 08 '17 at 16:16