PDAL / wrench

Point cloud processing made easy!
GNU General Public License v3.0
66 stars 9 forks source link

confusion with datetime and LAS spec #36

Open wiesehahn opened 2 months ago

wiesehahn commented 2 months ago

datetime is defined as

likely the aquisition time (https://github.com/radiantearth/stac-api-spec/blob/main/stac-spec/item-spec/item-spec.md#datetime)

which is also assumed for vpc creation

// Acquisition time: readers.las and readers.copc provide "creation_year" and "creation_doy" (https://github.com/PDAL/wrench/blob/main/src/vpc.cpp#L260)

However I am unsure if this is what "creation_year" and "creation_doy" are defined as (see https://github.com/ASPRSorg/LAS/issues/148) there it simply says

(date) this file was created.

And from my experience this is what providers populate it with, the date at which the file was created after inital processing, so usually this is days to month later than the aquisition date.

In my understanding the definition is unclear and the implementation here is correct, however I am not sure.

Any thoughts on this?

wiesehahn commented 2 months ago

So I just learned that "creation_year" and "creation_doy" are actually referring to the production time and not the aquisition time (see https://github.com/ASPRSorg/LAS/issues/138).

In this case I think populating datetime derived from these attributes might at least be misleading. Although definition is vague too ("likely the aquisition time").

wonder-sk commented 2 months ago

hi @wiesehahn yeah the LAS creation date is ambiguous unfortunately... It would be better to try to extract the datetime information from individual points, but then probably use start/end datetime rather than a single datetime, given that a single file may be composed of multiple swaths from different dates or weeks. Maybe this could be done with an extra command line option, and by default use just the header info.

wiesehahn commented 1 month ago

populating datetime with metadata from File Creation Day of Year and File Creation Year is even more confusing as there is an optional attribute created (https://github.com/radiantearth/stac-spec/blob/master/item-spec/common-metadata.md#date-and-time) which would perfectly fit for those metadata.

So personally I would be definitely in favor of populating created by File Creation Day of Year and File Creation Year. And get start_datetime and end_datetime (https://github.com/radiantearth/stac-spec/blob/master/item-spec/common-metadata.md#date-and-time-range) from timestamps of individual points if this would be possible in an efficient manner. I guess this also fits https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#datetime-selection.

Then it would just be of question how to define datetime? While this is not trivial e.g. same as start_datetime or end_datetime would fit better than creation date for most use-cases I guess