I am building a weather API that will respond with a JSON-formatted forecast when given a coordinate.

My input is a NetCDF store from which I generated a raster layer. I intended to use the WMS GetFeatureInfo endpoint and draw an extremely small bbox around the given coordinate. It looks like this approach would work fine if my user only cares about the weather forecast at a specific coordinate, but if my user wants to know the forecast at 10,000 coordinates he would have to make 10,000 requests.

I was wondering if it's possible to use a WPS service to retrieve the data for multiple coordinates simultaneously. It seems like perhaps the gs:Query method with a gs:RasterAsPointCollection subprocess might work, but how would I specify the filter?

A related question is - what if the 10,000 points that I want are in a vector layer? Can I use WPS to interrogate my NetCDF raster layer at the points specified in my vector layer?

An example of either solution would be amazing, but just links to relevant documentation would be much appreciated as well.

  • What exactly are you doing to generate those forecasts? I ask because it seems so much simpler to send a coordinate pair to your backend and respond with your JSON, or have the user upload a CSV/Shapefile/Whatever; despite the issue with sending 10000 requests, most users very likely don't want to click or type in coordinate pairs 10000 times... – geozelot Mar 10 '20 at 13:12
  • @geozelot There is a complex backend process to generate netCDF forecast files from model data. This API is for a specific client, who has 25k locations that they want to know the forecast for every hour. I would like them to be able to receive all 25k locations simultaneously with one request. – Mike Furlender Mar 11 '20 at 16:27
  • A GetFeatureInfo request is for a pixel location in an image, not a polygon, and not a real world coordinate. – nmtoken Jul 12 '20 at 9:53
  • What about using a WCS/WCPS, and supplying a mask of the points required, not sure if GeoServer supports it though – nmtoken Jul 12 '20 at 10:29

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.