Closed thareUSGS closed 2 years ago
Thank you for your contribution!
Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'
If no additional action is taken, this issue will be automatically closed in 180 days.
@thareUSGS Any updates on this API?
Thank you for your contribution!
Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'
If no additional action is taken, this issue will be automatically closed in 180 days.
Description
This is related to ticket #3939 (first it sounds like that will get a short-term fix to correct that issue). But for the long-term we should update Qview to request nomenclature features based on the WFS standard. Unfortunately, we are in the process moving from Mapserver to Geoserver thus this task should be on hold (or blocked) until Geoserver is stable and documented. This ticket is here just to eventually add to a future sprint.
Example
While the server will change (from Mapserver to Geoserver), the methods and calls below should be identical. Here is our list of WFS and WMS services (per body). https://astrowebmaps.wr.usgs.gov/webmapatlas/Layers/maps.html Note this means one would need to build the URL to the WFS end-point based on the target name (that might change with Geoserver if we support a layer with all names across all targets).
WFS API introductions and Geoserver reference. https://en.wikipedia.org/wiki/Web_Feature_Service https://docs.geoserver.org/latest/en/user/services/wfs/reference.html
Just a bunch of samples for future reference (Once Geoserver upgrade is in place):
Quick lunar call (with bounding box and output=geojson): https://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/mars/mars_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MARS_POINT&REQUEST=getfeature&BBOX=50,-20,65,10&outputformat=application/json;%20subtype=geojson
Based on this general pattern (using the featureType's native CRS, which for us is simple Lat/Lon degrees):
Moon WFS "get capabilities" (for nomenclature): https://wms.wr.usgs.gov/cgi-bin/mapserv?map=/maps/earth/moon_nomen_wfs.map&service=WFS&request=GetCapabilities
Mars WFS "get capabilities": https://wms.wr.usgs.gov/cgi-bin/mapserv?map=/maps/mars/mars_nomen_wfs.map&service=WFS&request=GetCapabilities
More WFS queries
boundbox (example order global -always positive East 0 to 360 for nomenclature BBOX=0,-90.0,360.0,90.0) http://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/earth/moon_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MOON_POINT&REQUEST=getfeature&BBOX=70,0,75,10
http://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/mars/mars_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MARS_POINT&REQUEST=getfeature&BBOX=50,-20,65,10
Get first 100 features http://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/earth/moon_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MOON_POINT&REQUEST=getfeature&MAXFEATURES=10
Ask for a particular ID http://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/earth/moon_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MOON_POINT&REQUEST=getfeature&featureid=MOON_POINT.Arnold%20K
A more advanced example hitting a nomenclature WFS site using the XML-based filter API (not the easier CQL API): https://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/earth/moon_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MOON_POINT&REQUEST=getfeature&MAXFEATURES=100&PropertyName=clean_feature&Filter=%3CFilter%3E%3CPropertyIsLike%20wildcard=%27*%27%20singleChar=%27.%27%20escape=%27!%27%3E%3CPropertyName%3Eclean_feature%3C/PropertyName%3E%3CLiteral%3EA*%3C/Literal%3E%3C/PropertyIsLike%3E%3C/Filter%3E --this returns all names on the Moon which start with "A".
more human readable (without HTML codes like "%3E"):
For JSON output, to above lines you need to add "&outputformat=application/json; subtype=geojson"
https://wms.wr.usgs.gov/cgi-bin/mapserv?map=/var/www/html/mapfiles/earth/moon_nomen_wfs.map&service=WFS&version=1.1.0&&TYPENAME=MOON_POINT&REQUEST=getfeature&MAXFEATURES=100&PropertyName=clean_feature&outputformat=application/json;%20subtype=geojson&Filter=%3CFilter%3E%3CPropertyIsLike%20wildcard=%27*%27%20singleChar=%27.%27%20escape=%27!%27%3E%3CPropertyName%3Eclean_feature%3C/PropertyName%3E%3CLiteral%3EA*%3C/Literal%3E%3C/PropertyIsLike%3E%3C/Filter%3E
We plan to support CQL for our WFS also (better than just WFS XML API calls). More are adding CQL support also (including OGCX standards -- mostly GIS standards). https://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html
GeoServer also has a REST interface which I think the OGC/WFS 3(?) might be moving towards (but this is still in the works).
https://docs.geoserver.org/stable/en/user/rest/index.html