diff --git a/docs/MapColonies/Raster/Guides/raster-wfs.mdx b/docs/MapColonies/Raster/Guides/raster-wfs.mdx new file mode 100644 index 000000000..0841cc34c --- /dev/null +++ b/docs/MapColonies/Raster/Guides/raster-wfs.mdx @@ -0,0 +1,258 @@ +--- +id: raster-wfs-guide +slug: raster-wfs-guide +title: WFS Guide +tags: + - guide + - wfs + - raster +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import PlaygroundFrame from '@site/src/components/PlaygroundFrame' + +## WFS query Guide step-by-step +The following guide will help you understand, ***Step-by-step*** the best practices of how to work with the Map Colonies WFS Sevice and how to query layer parts data. + +WFS querying capabilities Reference is [here](/docs/MapColonies/Raster/services/LayerParts/layer-parts) + +**Note:** In order to get the layer id (mc:id) you have the following options: +1. Open map-colonies catalog application and locate the required layer +
+ +
+2. Query all records via CSW GetRecords operation and search it in the result response +- [Query Examples](/docs/ogc/protocols/ogc-csw/ogc-csw-examples) + +## Flow diagram + +The following flow will show you one of our main use-case's + +```mermaid +flowchart LR + subgraph CSW + direction LR + b1[STEP 1
Query CSW catalog] + b1 --> b3[STEP 3
Get layer id - mc:id] + end + + subgraph Prerequisite + direction LR + a1[Get Product_ID] + a2[Get Auth Token] + end + + a1 -- product_id --> b1 + a2 -- token --> b1 +``` + +## Query Catalog Service (Step 1) +Query **RASTER CSW catalog** service to find item(s) according to desired filter [example are here](/docs/ogc/protocols/ogc-csw/ogc-csw-examples). + +:::warning +Pay attention to set the following parameter 'outputSchema="http://schema.mapcolonies.com/raster"' in order to get full catalog data +::: + +There are a few ways to acquire the productId, for example: + + + + +To fetch a specific layer you need to aquire 2 properties values: +1. `productType` +2. `productId` +To get unique product when you already have the ***productType*** and ***productId*** you can use the following query (both can be coppied from our catalog app, for example for ***Best Orthophoto*** use the following) + +POST Request + +url: +```'/csw'``` + +body (XML): +```xml + + + + full + + + + + mc:productType + OrthophotoBest + + + mc:productId + ORTHOPHOTO_MOSAIC_BASE + + + + + + +``` + + + + +You can enquire all raster products, use maxRecords and startPosition for pagination: + +POST Request + +url: +```'/csw'``` + +body (XML): +```xml + + + + full + + + + + mc:productId + productId + + + mc:productType + productType + + + + + + +``` + + + + +You will get GetRecords XML Response with product **metadata**. + +
+ Response example + + ``` xml title="GetRecords Response" + + + + + + + 4 + 2022-02-13T13:04:23Z + World Wide 2020 + {"type":"Polygon","coordinates":[[[-180,-90],[-180,90],[180,90],[180,-90],[-180,-90]]]} + 3 + 3b3164a7-280d-4392-a82f-d60a76e69092 + 2022-02-13T13:04:23Z + 2022-02-13T13:04:41Z + image/jpeg + '/service?REQUEST=GetCapabilities' + '/wms' + '/wmts/1.0.0/WMTSCapabilities.xml' + '/service?REQUEST=GetCapabilities&SERVICE=WMTS' + '/wmts' + NEW: -----> '/wfs?request=GetCapabilities' <----- + 0.1 + IDFMU + -180,-90,180,90 + ORTHOPHOTO_MOSAIC_BASE + אורתופוטו מתעדכן + OrthophotoBest + 1.0 + World + 0.000171661376953125 + UNDEFINED + 2020-05-21 + 2020-05-21 + 4326 + WGS84GEO + OPAQUE + RECORD_RASTER + 2022-02-13T13:03:07Z + + -180.0 90.0 + 180.0 90.0 + + + + + ``` +
+ +## Get layer URI (Step 2) + +In the `catalog` response from the first step, look for the `links` tags. + +:::warning +Each layer has it's own links, so make sure to filter for your wanted layer +::: + +```xml title="Example links for a layer" + + +'/wfs?request=GetCapabilities' + +``` + +You need to save the `[desired_layer_identifier]` value for later use. + +## Query WFS layer GetCapabilities (Step 3) +Now you need to make an WFS `GetCapabilities` query request for the desired layer. + +[Service Reference](/docs/MapColonies/Raster/services/LayerParts/layer-parts#getcapabilities) + +Identify the WFS GetCapabilities from above step: + +```xml title="Link for WFS in RESTfull Format" + + '/wfs' + +``` + + +Make a GET request to this link. The response contains the details of all available layers in following format: + +```xml title="Example links for a layer" + + + + + + + + + + application/gml+xml; version=3.2 + + + + + + + + + + + +``` + + +## Query WFS operations (Step 4) +As you can see, above xml response represents links to wfs operations query names (GetFeature/DescribeFeature) +Now all you have to do is query the desired WFS operation link by those references that we mantioned. + +```xml + +``` + Reference: [DescribeFeatureType](/docs/MapColonies/Raster/services/LayerParts/layer-parts#describefeaturetype) + + +```xml + +``` +Reference: [GetFeature](/docs/MapColonies/Raster/services/LayerParts/layer-parts#getfeature) \ No newline at end of file