0

I am brand new to GEE and JavaScript.

My goal: To add a column in a CSV file with locations and dates with corresponding temperatures

My problem: I am inexperienced with coding and have no history with JavaScript or GEE

I have a very simple CSV file that is structured as follows:

eventDate Elevation
2015/02/15 300
2013/08/04 420

and the geometry has been correctly read into GEE (I'm able to draw the points as a layer).

My specific issue is this: I want to create a loop or function that will allow me to add another column, "MaxTemp", and find corresponding maximum temperature data (for the moment from GRIDMET, but I honestly do not really care) for the locations/dates of my events.

This is how far I've gotten on my own:

//converting my data table of Mountain Chickadee sightings into a FeatureCollection
var MtnChickadee_points = ee.FeatureCollection(table);

//This was the only way I could limit the data after filterBounds() not working for some reason
var clipToCol = function(image){
  return image.clip(geometry);
}

//my attempt at grabbing the 'max temperature' band in the date range (2001-2016) that I care about
//seems to have worked
var dataset = ee.ImageCollection('IDAHO_EPSCOR/GRIDMET')
                    .select('tmmx')   // select 'max temperature' band only
                    .filterDate('2001-01-01', '2016-12-31')
                    .map(clipToCol);



//This was just for me to confirm I had imported the data table correctly
///Map.addLayer(MtnChickadee_points.draw({color: '006600', pointRadius: 5}), {}, 'Mountain Chickadees in Montana');

//using the visualization parameters from the example code of the dataset
var maximumTemperatureVis = {
  min: 273.15,
  max: 314.0,
  palette: ['d8d8d8', '4addff', '5affa3', 'f2ff89', 'ff725c'],
};

//This is where I'm stuck. Here's some psuedo code for what I'm trying to do 
var MtnChickadee_points$MaxTemps = dataset @ MtnChickadee_points(Lat/Long, eventDate);

Now there's all sorts of things that I would need to further do. Likely there are many eventDates that do not have a corresponding temperature data point and so on, so I'd need to make a buffer. But for the moment I am completely stuck at the most simple part of my problem: to add a new column with corresponding temperatures to my events.

1
  • 1
    Have a look at this answer: It is basically doing what you want to do only with a few extras like taking the sum over a time period which you would have to change in your case. But the overall workflow is the exact same. gis.stackexchange.com/questions/388508/… – JonasV Mar 4 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.