We have information about ships coming in, and would like to augment the placement information with information about the depth of the water where they are. We have a feature service with the depth info, in the form of lines of depth.
So I want to do something like find the nearest line, take the depth from it, and apply that depth to the ship's info.
The only way I can come up with, that I'm sure is feasible, is to write a custom processor that will query the depth data, getting all the lines, check the distance to each line using the java geometry library, and pick the closest one. I was hoping there was an easier way, both for ease of development (the Java API for querying seems horribly cumbersome, and we're new to this) and for efficiency (any spatial index will be bypassed, and this will get called a lot).
So, is there a way to query the feature service such that the results are sorted by distance from a given point? Or a way to just get the closest feature, explicitly? The only distance usage I can see in the query interface is to get all features within a set distance from the point I'm looking for, which is of limited use. And the closest I can find is the GeoAnalytics REST API has a findNearest, but that doesn't seem terribly helpful, for several different reasons (not least that I'm looking for nearest to one point, not for every point in a feature service. Also, the limit of 5k features would likely be problematic).
Also, to stave off any suggestions using outside services, I need to point out that this will be running on an isolated network. So unless that entire service can be downloaded, it won't be helpful.
Thanks in advance for any pointers,