-
Notifications
You must be signed in to change notification settings - Fork 47
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
Lon and lat ranges (max of 180 vs 360 deg) in geospatial data #435
Comments
Coordinate values in CF files must be stored monotonically increasing or decreasing, so you could extract the first and last coordinate values stored to determine the domain. |
Hi @taylor13, thanks for the prompt reply! I'm not sure I completely understand. For instance, in my examples:
and
both The issue is that sometimes only a small region or a city will be captured in the data and for example the region at the longitude of (50, 60) could work for both ranges (0-360 and -180-180). |
In my experience, when it comes to this issue, it's better to check the data explicitly than infer the answer from metadata. Even when the choice of longitude range was specified by convention, I have run into a lot of data that did not conform to the spec. Plus, it's very easy for attributes recording min & max values to become out of sync with the actual contents of the file. Unless I am certain that nobody has touched the file since it was originally written, I regard them as unreliable. As Karl said, coordinate variables have to be monotonic, so you only need to check the first and last coordinates rather than the whole thing. If one of them is > 180, the domain is 0:360. If one of them is <0, the domain is -180:180. If both are between 0 and 180, the answer is indeterminate. The CF Conventions doesn't have anything to say about Latitude should always be in the [-90:90] range. |
Closing this issue because the question has been answered |
TLDR
In some geospatial data longitude is given in the range of 0-360 degrees, while in the others the range is -180-180 degrees. Does the CF-Convention contain information which range is used in the data, and how is it denoted?
Does this ambiguity sometimes exist for latitude also, or it is always in the range -90-90 degrees?
Question
Hi everyone,
We are trying to automatically extract metadata from geospatial files (netCDF and HDF5) and populate that information in the geospatial metadata fields in the Dataverse (dataverse.org) data repository. In particular, we have a
geographicBoundingBox
metadata field that we want to populate using the info from the standard fieldsgeospatial_lat_min
,geospatial_lat_max
,geospatial_lon_min
,geospatial_lon_max
that are typically found within these data.The issue is that
lon
is sometimes given in the range of 0-360, and sometimes in the range of -180-180 degrees.Does the CF-convention denote which range is used for
lon
andlat
in the data?From what I've seen, if the
units
attribute is set todegrees_east
, then the range is typically 0-360 for longitude, while if theunits
isdegrees_west
the range is -180-180 (see examples below). Is this the general rule, or there is a better way to see the range?Also, does this ambiguity sometimes exist for latitude, or it is always in the range -90-90 degrees?
Example
One of our test datasets contains the following metadata:
Another example contains this metadata:
The text was updated successfully, but these errors were encountered: