Predicting Temperature Values Based on Latitude,Longitude,Time

Hi Everyone,

I work for an agtech firm which focuses on crop and pest modelling. To power our models, we have to process a stream of gridded satellite imagery and weather data. I have spent the last two (2) weeks just reading about HTM and watching the YouTube videos on HTM school, and I think that it can help us in creating data-driven models on the fly. The idea I am experimenting involves client farms which range anywhere from 0.25 sq. km-200 sq. km in size. These farms are then transformed into grids with each cell size having a resolution of 100x100 meter. So, a 100 sq. km farm (which is not unheard of) will consist of roughly 1,000,000 cells. At each cell location, we have the following input variables derived from GPS and satellite data:

  1. Latitude,Longitude,and Altitude
  2. Timestamp (roughly one hourly rate but varies according to client needs)
  3. Surface emissivity (which varies based on crop type and planting stage)
  4. Sun Elevation Angle

The output - which is soil temperature - is a different story. We have sensors distributed throughout each farm right now in uneven spatial configurations and quantities (10-200) measuring soil temperature.The usual approach to this problem is to use some spatial interpolation scheme such as kriging ( or inverse-distance weighting to estimate the soil temperature at each grid location. However, I would like to incorporate past data when carrying out these predictions. So, the approach I am thinking of involves:

  1. creating a Multi encoder scheme that takes in a Geospatial encoder (with lat/lon/altitude as inputs), a Date encoder (for time stamp), and scalar encoders (for surface emissivity and sun angle) to create a final composite SDR
  2. feed in the output of the Multi encoder at each sensor location along with the main output which will be soil temperature
  3. Once the model is trained, I use it to predict soil temperature at other cells where data is missing by inputting Latitude, Longitude, Altitude, Timestamp, Surface Emissivity, Sun Elevation Angle

OK, for those who felt this post has been tl;dr now we come to the end:

  1. The above are the thoughts going on in my mind, but I have no idea how to implement it. Any ideas or pointers to get started?
  2. A hiccup I am facing is that inputs should be fed in temporal order as in
    however I have multiple time series at different GPS coordinates so this is tricky for me to do. Would it be possible to use resets here to make this work? I guess a more general question is: how to I feed my data in while preserving temporal order?
  3. Are there any relevant examples or source code that you can point me to as I have not found a similar application anywhere?

Thanks and sorry for the long post!


Hi @Guru_Pradhan and welcome to the forum.

I see a problem with your approach. The GeospatialCoordinateEncoder has only been used to encode the location of moving objects over time. It is specifically designed with this in mind, and includes the tracking of past points to indicate how close an object is to past points, which is important semantic information wrt moving objects.

I’m not sure your approach with encoding the GPS locations of non-moving sensors on the ground is going to add any semantic value to the encoding.

The way I would do it would require an HTM model for each soil sensor on the ground. I know that @passiweinberger has some experience with this type of problem, and has thought about applying HTM to it. Pascal, are you there? Can you comment on your experience with this problem?


@rhyolight Thank you for the heads up, I am sort of passively absorbing the traffic here, but you built this just wayyyy to big to keep up with it now! Great job on that, i remember the times where i could catch up with every conversation on the mailing list, this is faaaaar too much now!
You’re skyrocketing! :smiley:

Hey @Guru_Pradhan!

As mentioned by Matt, we have been working on the similar problem for a while now. As we’re developing this as a product, i am afraid that i cannot be too specific here.
I’d be happy to have a one-to-one conversation with you though.

In general, we have started with a geospacial context model as well, but found it less useful, you want to see every sensor as a single model, or (what works well up to a number of say 10 sensors) build your own encoder, that adds the sensors in one field with the common statistics, like variance etc., so you have a better correlated picture of a fields’ data.

Looking forward to hearing from you and maybe helping you a bit more in the process!




Hey Mark a.k.a @rhyolight, thanks for the input and the reference to Pascal. Also, keep up the good work on HTM School!
Hey Pascal @passiweinberger : thanks for reaching out to me! It appears that we have a mutual goal :slight_smile: I have been wracking my brains about how to incorporate HTM for spatio-temporal modelling for a while now. So far, I have been experimenting with Long Short Term Memory (LSTM) nets, convolutional neural nets, and combinations of both with mixed results (not sure how to add geospatial context and things like spatial autocorrelation/covariance to the network. Also, I have been using batch learning but would like to shift to online/out-of-core learning - which is where HTM shines).
As for your suggestions, thanks a lot! It definitely got my brain juices flowing. Some thoughts I had:

  1. Creating a separate model at each sensor will be useful in perhaps predicting soil temperature at future timesteps at these locations. I can then use kriging or some other interpolation scheme then to predict future soil temperature maps for the client field. But I am not sure how these separate models could be used for predicting temperature values at field locations where sensor information is unavailable. What am I missing?
  2. The second option (building an encoder to take in common sensor statistics) sounds a lot more useful but I am unsure as to how to approach this issue.
    I would love to touch base with you regarding this. How can I contact you further? My email is

Thanks a lot,
Guru Pradhan
GIS Data Specialist
Fertyle, Inc (