o2r-project / geoextent

Python library for extrating geospatial extent of files and directories with multiple data formats
https://o2r.info/geoextent/
MIT License
1 stars 4 forks source link

Tbox output in ISO8601 format, Pandas & Numpy required, test changed #79

Closed SbastianGarzon closed 3 years ago

SbastianGarzon commented 3 years ago

Closes #78 Closes #81 Closes #82

After tbox extraction, the 2 dates (strings with an unknown date format) are parsed into a pandas timestamp with the same datetime format and then are transformed into ISO8601 date format ('%Y-%m-%d').

To identify the 'common datetime format' the function _guess_datetime_format_for_array is used to extract the 'datetime' format for each string. In most of the cases, the ''guessed" formats are expected to be the same. However for ambiguous dates (e.g 01.05.2010), the transformation takes into account the ''guessed" format of the other date. The transformation is successful only if the 'common datetime format' returns a valid pandas.timestamp date for both transformations. After the timestamps are transformed into pandas.Timestamp both are finally parsed into ISO8601.

Expected geoextent test results are modified (to ISO8601 format).