covjson / specification

CoverageJSON specification
https://covjson.org/spec/
45 stars 6 forks source link

start > stop for regular axis encoding? #57

Closed letmaik closed 8 years ago

letmaik commented 8 years ago

Just so that we are aware of it...

Currently, the spec says:

The values of "start" and "stop" must be numbers, and the value of "num" an integer greater than zero. If the value of "num" is 1, then "start" and "stop" must have identical values. For num > 1, the array elements of "values" may be reconstructed with the formula start + i * step where i is the ith element and in the interval [0, num-1] and step = (stop - start) / (num - 1). If num = 1 then "values" is [start].

This means that both { "start": 0, "stop": 10, "num": 5 } and { "start": 10, "stop": 0, "num": 5 } are allowed. I just tested both in my JS libraries and both work. I think we should allow both forms, right? For latitude this is useful (the reverse way) as you can then write down your range array in natural order from top to bottom, corresponding to north -> south or how you would look at the pixels of a rendered (satellite) image.

Any objection?

jonblower commented 8 years ago

Yes, I think we should allow both forms. For one thing this will give easy compatibility with CF-NetCDF.

It would probably be worth explicitly highlighting this in the spec (and/or cookbook) if you haven't done so already, as this may be surprising (and hopefully welcome) for some GIS folk.

letmaik commented 8 years ago

Added this.