Cucurbita
Cucurbita

Reputation: 11

GEE Feature Collections and Dates

I have a fusiontable based feature collection in Google-Earth-Engine that includes a date column. I would like to cast the FC into an empty image and display with graduated colours for increasing dates - so that when the Inspector is used a human readable date is displayed.

var empty64 = ee.Image().toInt64();
var outlines = empty64.paint({
  featureCollection: SomeFeatureCollection,
  color: 'StartDate',
});

If I add this to the map as a layer I get the date as a 13-digit format that I can't read. How can I change this? Thank you!

Upvotes: 0

Views: 863

Answers (1)

tehhowch
tehhowch

Reputation: 9872

Per the API reference for Image.paint, color must be an object name or a number. To me, that means the EE API will interpret the object as a number, meaning a Date object will be converted from a string to a numerical representation. In this case, that's the "milliseconds since epoch" format.

Without a way to add metadata to a FeatureCollection (i.e. so you could store the associated datestring along with the other parameters of the feature), I don't think you can show a human readable date in the inspector.

Upvotes: 1

Related Questions