Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geo coordinates must be floats #369

Closed
thill-odi opened this issue Feb 17, 2021 · 5 comments
Closed

Geo coordinates must be floats #369

thill-odi opened this issue Feb 17, 2021 · 5 comments
Labels
good first issue Good for newcomers rule A rule suggestion for implementation

Comments

@thill-odi
Copy link

geo.latitude and geo.longitude need to be expressed as floats with a minimum precision of four decimal places. They MUST NOT be rounded to integers.

@thill-odi thill-odi added rule A rule suggestion for implementation good first issue Good for newcomers labels Feb 17, 2021
@Lathrisk Lathrisk self-assigned this Feb 26, 2021
@Lathrisk
Copy link

Lathrisk commented Mar 2, 2021

I noticed that this issue states that the precision should be 4 or more decimal places, but the OpenActive spec specifies 2 or more decimal places.

@Lathrisk
Copy link

Lathrisk commented Mar 2, 2021

And to mix that up a little more, there is already a precision rule that covers latitude to 3 decimal places.

@nickevansuk
Copy link
Contributor

nickevansuk commented Mar 3, 2021

I was just about to comment on this issue @Lathrisk but you beat me to it with your discovery of the precision rule - the issue itself is in fact largely redundant, though hopefully still a good academic exercise to get your head into the codebase.

minDecimalPlaces currently displays a notice that covers the requirement here, and is only used for latitude and longitude.

The reason this is a notice and not an error or warning is that some data does actually legitimately have 1, 2 or 3 decimal places. Limited historical context: openactive-archive/developer-microsite#39

A real example:

Stevenage Swimming Centre, St George's Way, Stevenage, Hertfordshire, SG1 1XY, United Kingdom
51.9047222, -0.2

Data model reference:

https://github.com/openactive/data-models/blob/2acafeed5636973d38e4c456ca035fdd683ecf18/versions/2.x/models/GeoCoordinates.json#L21-L40

    "latitude": {
      "fieldName": "latitude",
      "sameAs": "https://schema.org/latitude",
      "requiredType": "https://schema.org/Number",
      "minDecimalPlaces": 3,
      "example": 51.522338,
      "description": [
        "The latitude of a location. For example 51.522338 (WGS 84)."
      ]
    },
    "longitude": {
      "fieldName": "longitude",
      "sameAs": "https://schema.org/longitude",
      "requiredType": "https://schema.org/Number",
      "minDecimalPlaces": 3,
      "example": -0.083437,
      "description": [
        "The longitude of a location. For example -0.083437 (WGS 84)."
      ]
    }

@Lathrisk
Copy link

Lathrisk commented Mar 3, 2021

Thanks for the update, Nick. That makes sense. It's been a good introduction to the validator, the spec, and the models!

@Lathrisk Lathrisk removed their assignment Mar 4, 2021
@nickevansuk
Copy link
Contributor

Closing this based on the above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers rule A rule suggestion for implementation
Projects
None yet
Development

No branches or pull requests

3 participants