4

When storing spatiotemporal data, there is a need to store dates or time data. I know raster files can store numeric data (integer or float), but what about storing of dates data?

I'm currently looking at the following options:

  • Raster — Data are numeric values of the passed seconds from the Unix Epoch, 1970-01-01 00:00:00 being the zeroth second
  • ENVI .hdr labelled raster — Labels are in YYYY-MM-DD date format
  • Raster + CSV file — CSV file contains YYYY-MM-DD date format along with numerical value lookup for the raster
  • Raster — Data are numeric day-of-the-year, negative values and values larger than 365 are offsets and will be treated a different year

Is there a raster data format that can store dates instead of numeric values or utilizing labels and/or adding extra files?

If there aren't, at least, is there a de facto convention of how to store them on a raster file?

7
  • 1
    Data is just data, computers do what you tell them to, you can store dates as floating point seconds past an epoch but it wont look pretty. Assuming you're using python to access the times there is a serial date format stackoverflow.com/questions/6706231/… what is a better question is what are you going to do with the datetime objects? Is this going to be a raster date lookup (click here, get the applicable date) or do you want to perform some sort of analysis on it? Mar 15, 2021 at 4:36
  • I am building a software. The raster will be used in the software as inputs. The raster will not be analyzed but more of a temporal starting point for the analysis. Preparing these date datatype raster data can be tedious. As much as possible I want that the format is highly opinionated and is well practiced because the software and its users will adhere to that convention. That is why I am asking the question. Mar 15, 2021 at 5:21
  • 1
    Date data types are the worst for user input not just considering Julian and Gregorian calendars but time zones and date standards (MM/DD/YYYY or DD/MM/YYYY or my preferece YYYYMMDD) then there's standard epochs to reduce the date to increase resolution GPS absolute oc.nps.edu/oc2902w/gps/timsys.html and standard 1970, common era en.wikipedia.org/wiki/Common_Era#History_of_the_use_of_the_CE/… and that's if the user is doing it right! not just 1/1/1s. do all you can to avoid having users type into a date field. Do these times have an X,Y coordinate? Mar 15, 2021 at 5:59
  • @MichaelStimson Yes. Basically just latitude, longitude, and date. Mar 15, 2021 at 6:10
  • 5
    GeoTIFF with a band of datatype Int32 for holding Unix Epoch data feels simple.
    – user30184
    Mar 15, 2021 at 9:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.