gs1 / EPCIS

Draft files being shared for EPCIS 2.0 development
Other
20 stars 7 forks source link

`crs` or `srs` field in sensorReport #266

Open VladimirAlexiev opened 3 years ago

VladimirAlexiev commented 3 years ago

(As suggested at today's call):

Related to #264 "if we have Latitude, Longitude (in decimal degrees), maybe we should also have Easting, Northing (in meters, often used by UK Ordnance Survey)".

But it's not enough to just say "decimal degrees or meters".

These also depend on the adopted origin, the geographic projection, axis orientation, etc. OGC has done a lot of work on Coordinate Reference Systems.
As per https://github.com/qudt/qudt-public-repo/issues/379, neither QUDT nor CBV should attempt to redo this work.

So maybe we need yet another sensorReport field, crs or srs

mgh128 commented 3 years ago

Yes, we should not redo existing work. At present, the GLN data modelling work group / sub-group is proposing to add gs1:geodeticSystem within gs1:GeoCoordinates, expecting a value from a code list, which would include WGS84 and the others that Philip mentioned on the call today, NAD 83, NAD 27, ED 50, SAD 69 and others from http://www.opengis.net/def/crs (though I only see four entries there, rather than hundreds or thousands).

VladimirAlexiev commented 3 years ago

These are folders. Eg see

A search and conversion tool is at https://epsg.io/.

https://epsg.org/ seems to be the official register of EPSG geodetic dataset


@mgh128

BTW searched schema.org, there's nothing about CRS, SRS, geodetic

mgh128 commented 3 years ago

According to https://en.wikipedia.org/wiki/Spatial_reference_system it appears that Spatial Reference System and Coordinate Reference System can be used interchangeably and that a geodetic datum such as WGS84 is an instance of a spatial reference system or coordinate reference system.

dr-shorthair commented 3 years ago

Spatial references include place-names (gazetteers) and spatial indexes, such as DGGS, as well as coordinates. Coordinate references are essentially geometric references, usually expressed as a group of 1-4 real numbers, representing a position vector in 1-4 cartesian dimensions.

So SRS is the more general term, while CRS is reserved for coordinates.

VladimirAlexiev commented 3 years ago

@mgh128:

At present, the GLN data modelling work group / sub-group is proposing to add gs1:geodeticSystem within gs1:GeoCoordinates

@dr-shorthair, would gs1:coordinateReferenceSystem (or gs1:coordinateSystem for short) be a better name for that property?

dr-shorthair commented 3 years ago

In ISO 19111 (and the EPSG database model) a coordinate-system is a set of axes, directions and scales. A coordinate-reference-system is a coordinate-system which is also anchored to a (usually geodetic) datum. So it would not be appropriate to use the former as a shorthand for the latter.

A geodetic system is tied to the Earth, rather than another planet. If GS1 is OK being tied to one planet, then probably OK.

VladimirAlexiev commented 3 years ago

Today at the meeting agreed:

CRS OGC URL to use
WGS 84 http://www.opengis.net/def/crs/OGC/1.3/CRS84
NAD 27
ED 50
SAD 69
RalphTro commented 3 years ago

Dear @VladimirAlexiev: I just reread/reflected on this issue once again and think that (at least :-)) I need your help to fully grasp the impact of this suggestion.

First, I was wondering why we don’t define which system must be used or at least specify a default? For instance, IETF RFC 5870 (defining the Geo URI scheme) does the latter, see https://datatracker.ietf.org/doc/html/rfc5870#section-3.4.1 ("A URI instance uses the default WGS-84 CRS if the 'crs' parameter is either missing or contains the value of 'wgs84'.") Wouldn't that be an easier/less complex approach?

Second, would you mind to insert one or two illustrative example(s) of how a sensorReport with this property would actually look like? That would be really helpful.

Thanks for your support!

mgh128 commented 3 years ago

Dear @RalphTro There was discussion on one of our recent calls in which Philip Heggelund mentioned some of the other coordinate reference systems that are in use in the oil and gas industry. Not sure if you missed that discussion. If a sensor is capable of producing geocoordinates using a coordinate reference system other than WGS84 then we should have a way to explicitly state which coordinate reference system is being used. It is not trivial nor desirable for EPCIS implementations to have the burden of converting all these other coordinate reference systems to/from WGS84 but at least if we ensure that the coordinate reference system can be stated explicitly, an application consuming EPCIS data can perform that conversion. Yes, it does mean that if the data and query both specify coordinate reference system but do not use the same coordinate reference system, then they will not match, even if they refer to the same terrestrial position.

VladimirAlexiev commented 3 years ago

@CraigRe

Here's an example:


BTW, typing "type": "Angle", "uom": "DEG" quickly gets boring, so can we assume that "component": "Latitude" implies these two?

RalphTro commented 3 years ago

@VladimirAlexiev and @mgh128 - thanks so much for your additions/explanations! Much clearer to me now. As to your last point, @VladimirAlexiev : as we agreed that either type or exception needs to be present, I think we have to live with the boring approach for the time being. :-) I took a note to my ToDoList to add an example to GitHub illustrating the usage of coordinateReferenceSystem ((a) without it, i.e. meaning the default, (b) with explicitly referring to it, and (c) referring to another system then WGS84) as you suggested.

DuckScapePhilip commented 3 years ago

Unfortunately, I was not able to meet with my contact in the petroleum industry this week. I will try to follow up with him today.

VladimirAlexiev commented 3 years ago

@DuckScapePhilip EPSG comes from the petroleum industry, so hopefully https://epsg.org and https://epsg.io already give us all the info we need.

@RalphTro it would be nice if you browse around some more, and include some text to let EPCIS users know where to find coordinateReferenceSystem URLs to use.

I have no idea about the following (@dr-shorthair could you provide some advice on these points?)

Cheers!

dr-shorthair commented 3 years ago

8.5 is the EPSG release. Actually this 'version' field in the URI is a hang-over from an older identifier model, and it is not good practice to include a version number in an identifier if the definition is not intended to change across releases. In OGC-land you can put /0/ instead, and this refers to 'the current or un-versioned definition'.

There is some discussion about updating the OGC naming rules to simplify the URIs - see https://github.com/opengeospatial/om-swg/issues/136

In the OGC definitions service, it is very sparsely populated away from the /EPSG/ branch. There really are only a few that matter

The multiplicity of NAD CRSs is probably because they are defined for states or regions.

RalphTro commented 3 years ago

Dear @dr-shorthair, Thanks! From your point of view, which of these URIs could or should we include as a (non-normative) note in the CBV standard? Ideally, the CBV should point to the most common/relevant ones. In this context: would these URIs be stable/persistent enough so that we are comfortable to include them in the first place?

In light of what @VladimirAlexiev suggested, I made a quick research on other relevant systems, and found e.g. the following: On https://www.w3.org/2015/spatial/wiki/Coordinate_Reference_Systems, it is said that "...using WGS84 explicitly or implicitly is just the easiest way because it is the favoured CRS in many specifications. (...) Because WGS84 is unsuitable in Europe, European guidelines (like INSPIRE) recommend using ETRS89." But I was not able to find ETRS89 on OGC's platform.

The EPSG registry (http://www.epsg-registry.org/) as "...the traditional source of CRS definitions in GIS (...)", uses EPSG codes (e.g. EPSG::4258) to refer to CRS definitions, i.e. no URIs. Are you aware of 'official'/well-established URIs we can recommend with good conscience?

Thanks a lot in advance for your help/support in this, @dr-shorthair !

dr-shorthair commented 3 years ago

ETRS89 == epsg:4258 == http://www.opengis.net/def/crs/EPSG/0/4258

In general the EPSG identifiers are the most widely known and used and likely to be persistent. There is an ISO register here https://geodetic.isotc211.org/register/geodetic/GeodeticCRS, but it is very unclear if this would supplant the EPSG list in practice. The http://www.opengis.net/def/crs/EPSG/0/ versions are the official OGC URIs for the EPSG-definitions.

The /OGC/ entities listed above represent a set of 'gaps' in the EPSG dataset, as of the time they were coined. The primary tension is that historical practice in Geography is to give global coordinates in the order (latitude, longitude) - i.e. (y,x). This contrasts with most projected systems which are usually (easting, northing) - i.e. (x,y) - and also surprises most non-geographers, including web developers. Hence http://www.opengis.net/def/crs/OGC/1.3/CRS84 is identical to http://www.opengis.net/def/crs/EPSG/0/4326 except for the axis order.

The other significant issue is that many web-mapping systems assume that the earth is a sphere, whereas the geodetic systems are based on ellipsoids.

epsg:3785 is an attempt to define the typical web-mapping projection ("Web mercator") as a formal CRS.

dr-shorthair commented 3 years ago

Thanks a lot in advance for your help/support in this, @dr-shorthair !

I'll send you an invoice.

RalphTro commented 3 years ago

Thanks a lot for your quick answer, @dr-shorthair! Really glad that you have joined this discussion.

My last remaining question at this moment in time is: which CRS URIs would you recommend the group to include in the standard (as non-normative examples to help/assist our users)?

dr-shorthair commented 3 years ago

2D systems -

dr-shorthair commented 3 years ago

Give my regards to @philarcher (at GS1) if you know him

RalphTro commented 3 years ago

GREAT - we will use your suggestion as a basis for decision in our next group call. A bit anxious about the prospect of getting your invoice now though...;-)

philarcher commented 3 years ago

Waving at @dr-shorthair :-)

VladimirAlexiev commented 3 years ago

@RalphTro I edited my example https://github.com/gs1/EPCIS/issues/266#issuecomment-844997138 to use /0/ and the correct unit DD for decimal degrees.

I think CBV should recommend the OGC URLs because they incorporate all of EPSG, and are used in GeoSPARQL.

RalphTro commented 3 years ago

Thanks, @VladimirAlexiev ! Just added two corresponding xml events to https://github.com/gs1/EPCIS/blob/master/XSD/SensorDataExamples.xml If you agree content-wise, I can also add the corresponding JSON/JSON-LD files.

VladimirAlexiev commented 3 years ago

Tasks and status as of 21 Sep 2021:

@CraigRe I think you should provide in CBV guidance on how to express geographic coordinates: