OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
800 stars 293 forks source link

[Bug] What is the difference between equal and equals in the manual of t.select? #1528

Open NikosAlexandris opened 3 years ago

NikosAlexandris commented 3 years ago

The issue

There is no clear distinction between the temporal relations terms equal and equals in the manual of t.select. Both however are used in different examples throughout the manual.

In the manual of t.select, the temporal relations table lists only the equals term.

One equals example in the manual:

C = A {:, equals} B

and one equal example in the manual:

C = A {!:,equal} B

Are all references to equals typographic errors? Or does this term indeed exist?

To Reproduce

Simple t.select examples in the command line, derive different results. For example,

t.select -s -d expression='A = A1 {!:, equals} A2'
{'STDS': {}, 'processes': [], 'register': [], 'remove': []}

does not return anything as seen above, whereas

t.select -s -d expression='A = A1 {!:, equal} A2

returns

{'STDS': {'name': 'A', 'stdstype': 'strds', 'temporal_type': 'absolute'},
 'processes': [],
 'register': [('A1_09_2018_12_27T00_00_00',
               '2018-12-27 00:00:00',
               'None'),
              ('A1_2019_01_01T00_00_00',
               '2019-01-01 00:00:00',
               'None'),
              ('A1_2019_01_09T00_00_00',
               '2019-01-09 00:00:00',
               'None'),
              ('A1_2019_01_17T00_00_00',
               '2019-01-17 00:00:00',
               'None'),
...

What to do?

Depends if the equals occurences in the manual are typographic errors or not. If yes, such an important part of the temporal framework documentation needs to be updated as soon as possible. If the latter, the manual needs to be updated accordingly to differentiate between the two terms and their functionality.

neteler commented 3 years ago

While I cannot contribute in detail - did you already see the related publication?

Gebbert, S., Leppelt, T., Pebesma, E., 2019. A topology based spatio-temporal map algebra for big data analysis. Data 4, 86., https://doi.org/10.3390/data4020086

NikosAlexandris commented 3 years ago

On 2021-04-15 16:30, Markus Neteler wrote:

While I cannot contribute in detail - did you already see the related publication?

Gebbert, S., Leppelt, T., Pebesma, E., 2019. A topology based spatio-temporal map algebra for big data analysis. Data 4, 86., https://doi.org/10.3390/data4020086

Thank you Markus. Yes I did. I am trying to get a grip on fine details.

There are many examples in the manuals, but they seem to be 'theoretical' ones, not real examples executed in the command line.

Nikos

ps- I might have found another issue to report: probably it makes a difference to write, inside an expression

{!:, equal, l}

than the same without spaces:

{!:,equal,l}

The first will fail, the last will work! (?) Need to test more.

NikosAlexandris commented 3 years ago

Given the pattern for temporal selections

{"temporal selection operator", "topological relations", "temporal operator"}

it seems there is no signle test in https://github.com/OSGeo/grass/blob/99464f8f520a8778564bafa9b2b47bcd8f893bf8/temporal/t.rast.algebra/testsuite/test_raster_algebra.py that demonstrates an example with a space after the "topological relations", part. All examples in the tests are (typographically speaking) either

{"temporal selection operator","topological relations","temporal operator"}
# no spaces -----------------^^^---------------------^^^

or

{"temporal selection operator", "topological relations","temporal operator"}
# ----- spaces only here -----^^^ ---but not here ------^^^

Adding a space in the last part, causes failures here. If this is true (and not only something in my system), it is hard to understand and learn why some expressions fail.

NikosAlexandris commented 3 years ago

This comment transferred in https://github.com/OSGeo/grass/issues/1530

NikosAlexandris commented 3 years ago

While I cannot contribute in detail - did you already see the related publication?

Gebbert, S., Leppelt, T., Pebesma, E., 2019. A topology based spatio-temporal map algebra for big data analysis. Data 4, 86., https://doi.org/10.3390/data4020086

In the end of section 3.1.3:

expression{+,equals|during|equivalent,l}expression

But in Figure 3 only equal is mentioned.

neteler commented 3 years ago

The authors may likely know...

NikosAlexandris commented 3 years ago

Note also the equivalent. This is nowhere mentioned in the t.* manuals, if I am not wrong. At least not in t.select and t.rast.algebra.

neteler commented 3 years ago

You/all are highly invited to propose updated examples (ideally, NC sample data set based) and explanation.

veroandreo commented 3 years ago

All the tests in t.select and t.rast.algebra use equal as temporal topological relation. It seems to be defined as equal here as well.

In the paper, the temporal topological relation is also called equal, though in the examples, it is used as equals. Maybe that inconsistency is the root of manual pages glitches. No idea.

Equivalent, according to what I understand from the paper, refers to spatial topological relation. So, that's a different story.

In any case, I'd trust the code ;)

Also @NikosAlexandris, if you could explain what you intend to do with t.select, ideally with a fully reproducible example (create maps, stds, register them and so on), maybe we can understand better and help

NikosAlexandris commented 3 years ago

All the tests in t.select and t.rast.algebra use equal as temporal topological relation. It seems to be defined as equal here as well.

In the paper, the temporal topological relation is also called equal, though in the examples, it is used as equals. Maybe that inconsistency is the root of manual pages glitches. No idea.

Equivalent, according to what I understand from the paper, refers to spatial topological relation. So, that's a different story.

In any case, I'd trust the code ;)

Also @NikosAlexandris, if you could explain what you intend to do with t.select, ideally with a fully reproducible example (create maps, stds, register them and so on), maybe we can understand better and help

I would like to see internal consistency. Having terms like equals that aren't actually defined can be a source for errors in workflows.

NikosAlexandris commented 3 years ago

It seems to be defined as equal here as well.

Thanks for the link!

veroandreo commented 3 years ago

Maybe @huhabla and @m4sth0 can help us here, so we can fix the manuals consistently