This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Nihat, GridCoordSystem.findXYindexFromLatLon() returns a 2-element array, ret[0] for x index and ret[1] for y index. As you say, one index can be valid (>= 0) and one can be invalid (-1). Therefore, you shouldn't conclude that a given lat/lon is contained within the grid unless both indices are >0. I can see your point that it may be risky to convey the information that way, but sometimes it can be useful to know when a lat is valid and a lon is not, or vice versa. If necessary, the lat/lon is converted into projection coordinates of the grid. Apart from that, there is no interpolation. The documentation for the method isn't as detailed as it could be, but you can follow the code to see what's happening. It's not too complex. The latest source for NetCDF-Java 4.6 can be found on the master branch of our GitHub repo [1]. Cheers, Christian [1] https://github.com/Unidata/thredds/tree/master Ticket Details =================== Ticket ID: HCW-753528 Department: Support netCDF Java Priority: Normal Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.