{"_id":"57dc3b77de08c819002a163e","user":"55fae9d4825d5f19001fa379","category":{"_id":"573b4f62ef164e2900a2b881","__v":0,"project":"55faeacad0e22017005b8265","version":"55faeacad0e22017005b8268","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-17T17:05:38.443Z","from_sync":false,"order":7,"slug":"algorithm-guide","title":"Certified Algorithms"},"parentDoc":null,"project":"55faeacad0e22017005b8265","__v":1,"version":{"_id":"55faeacad0e22017005b8268","project":"55faeacad0e22017005b8265","__v":34,"createdAt":"2015-09-17T16:31:06.800Z","releaseDate":"2015-09-17T16:31:06.800Z","categories":["55faeacbd0e22017005b8269","55faf550764f50210095078e","55faf5b5626c341700fd9e96","55faf8a7825d5f19001fa386","560052f91503430d007cc88f","560054f73aa0520d00da0b1a","56005aaf6932a00d00ba7c62","56005c273aa0520d00da0b3f","5601ae7681a9670d006d164d","5601ae926811d00d00ceb487","5601aeb064866b1900f4768d","5601aee850ee460d0002224c","5601afa02499c119000faf19","5601afd381a9670d006d1652","561d4c78281aec0d00eb27b6","561d588d8ca8b90d00210219","563a5f934cc3621900ac278c","5665c5763889610d0008a29e","566710a36819320d000c2e93","56ddf6df8a5ae10e008e3926","56e1c96b2506700e00de6e83","56e1ccc4e416450e00b9e48c","56e1ccdfe63f910e00e59870","56e1cd10bc46be0e002af26a","56e1cd21e416450e00b9e48e","56e3139a51857d0e008e77be","573b4f62ef164e2900a2b881","57c9d1335fd8ca0e006308ed","57e2bd9d1e7b7220000d7fa5","57f2b992ac30911900c7c2b6","58adb5c275df0f1b001ed59b","58c81b5c6dc7140f003c3c46","595412446ed4d9001b3e7b37","59e76ce41938310028037295"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"v1","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-16T18:35:35.509Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":35,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"This task uses an old version of the automated land cover classification algorithm\",\n  \"body\": \"Please use the new [Automated Land Cover Classification (LULC)](doc:automated-land-cover-classification-1).\"\n}\n[/block]\n## Table of Contents\n\nSection | Description\n--- | ---\n[Imagery Examples](#Imagery Examples) | Before and after example\n[Quickstart](#Quickstart) | Get started with a Python-based quickstart tutorial\n[Task Runtime](#Task Runtime) | Benchmark runtimes for the algorithm\n[Input Options](#Input Options) | Required and optional task inputs\n[Outputs](#Outputs) | Task outputs and example contents\n[Advanced Options](#Advanced Options) | Additional information for advanced users\n[Known Issues](#Known Issues) | Issues users should be aware of\n\n\n\n## <a name=\"Imagery Examples\"></a>Imagery Example\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/96a57c2-RAW800x320.png\",\n        \"RAW800x320.png\",\n        800,\n        320,\n        \"#28261d\"\n      ],\n      \"caption\": \"Output image with water mask applied\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Please use the new [Automated Land Cover Classification (LULC)](doc:automated-land-cover-classification-1).\"\n}\n[/block]\n## <a name=\"Quickstart\"></a>Quickstart Tutorial\nThis script gives the example of a water mask with a single tif file as input. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Quickstart Example producing a single band water mask from a tif file.\\n# First Initialize the Environment\\n\\nfrom gbdxtools import Interface\\ngbdx = Interface()\\n\\n#Edit the following path to reflect a specific path to an image\\nraster = 's3://gbd-customer-data/CustomerAccount#/PathToImage/'\\nprototask = gbdx.Task(\\\"protogenV2RAW\\\", raster=raster)\\n\\nworkflow = gbdx.Workflow([ prototask ])  \\n#Edit the following line(s) to reflect specific folder(s) for the output file (example location provided)\\nworkflow.savedata(prototask.outputs.data, location=\\\"RAW\\\")\\nworkflow.execute()\\n\\nprint workflow.id\\nprint workflow.status\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## <a name=\"Task Runtime\"></a>Task Runtime\nThese are the average runtimes for this algorithm. All benchmark tests were run using a standard set of images, based on our most common customer scenarios. Runtime benchmarks apply to the specific algorithm, and don’t represent the runtime of a complete workflow.\n\n  Sensor Name  |  Total Pixels   |  Total Area (k2)  |  Time(secs)  |  Time/Area k2\n--------|:----------:|-----------|----------------|---------------\nWV02|35,872,942|329.87|230.29|0.70\nWV03|35,371,971|196.27| 300.31|1.53\n\n\n## <a name=\"Input Options\"></a>Input Options\nThis task will process only WorldView 2 or WorldView 3 multi-spectral imagery (8-band optical and VNIR data sets) that has been atmospherically compensated by the Advanced Image Preprocessor (AOP_Strip_Processor).  Supported formats are .TIF, .TIL, .VRT, .HDR.\n\nThe following table lists the Water Mask task inputs.\nAll inputs are **required**.\n\nName                     |       Default         |        Valid Values             |   Description\n-------------------------|:---------------------:|---------------------------------|-----------------\nraster                   |          N/A          | S3 URL   .TIF only              | S3 location of input .tif file processed through AOP_Strip_Processor.\ndata                     |         true          | Folder name in S3 location      | This will explain the output file location and provide the output in .TIF format.\n\n**OPTIONAL SETTINGS: Required = False**\n\nNo additional optional settings for this task exist.\n\n\n## <a name=\"Outputs\"></a>Outputs\n\nThe following table lists the Water Mask task outputs:\n\nName | Required |   Description\n-----|:--------:|-----------------\ndata |     Y    | This will explain the output file location and provide the output in .TIF format.\nlog  |     N    | S3 location where logs are stored.\n\n## <a name=\"Advanced Options\"></a>Advanced Options\nTo link the workflow of one input image into Advanced Image Preprocessor (AOP_Strip_Processor) into this task, you must use the follow gbdxtoools script in python:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#First initalize the environment\\n#AOP strip processor has input values known to complete the Protogen tasks\\n\\nfrom gbdxtools import Interface\\ngbdx = Interface()\\n\\n#Edit the following path to reflect a specific path to an image\\ndata = 's3://gbd-customer-data/CustomerAccount#/PathToImage/'\\n\\naoptask2 = gbdx.Task('AOP_Strip_Processor', data=data, bands='MS', enable_acomp=True, enable_pansharpen=False, enable_dra=False)     # creates acomp'd multispectral image\\n\\ngluetask = gbdx.Task('gdal-cli')      \\n# move aoptask output to root where prototask can find it\\ngluetask.inputs.data = aoptask2.outputs.data.value\\ngluetask.inputs.execution_strategy = 'runonce'\\ngluetask.inputs.command = \\\"\\\"\\\"mv $indir/*/*.tif $outdir/\\\"\\\"\\\"\\nprototask = gbdx.Task('protogenV2RAW')\\nprototask.inputs.raster = gluetask.outputs.data.value\\n\\n\\nworkflow = gbdx.Workflow([aoptask2, gluetask, prototask])\\n#Edit the following line(s) to reflect specific folder(s) for the output file (example location provided)\\nworkflow.savedata(prototask.outputs.data, location='RAW')\\n\\nworkflow.execute()\\n\\nworkflow.status\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n\n**Data Structure for Expected Outputs:**\n\nYour processed imagery will be written as binary .TIF image type UINT8x1 and placed in the specified S3 Customer Location (e.g.  s3://gbd-customer-data/unique customer id/named directory/).  \n\n## <a name=\"Known Issues\"></a>Known Issues\n\n1) To run the task in a single workflow with Advanced Image Preprocessor, the tif file must first be removed from the AOP folder with the additional python commands listed in the Advanced section.\n\n2)False positives maybe present due to certain types of concrete roofs or shadows.\n\n#### Contact Us   \nIf you have any questions or issues with this task, please contact [**gbdx-support:::at:::digitalglobe.com** ](mailto:gbdx-support@digitalglobe.com).","excerpt":"This task uses 8-band imagery to detect a mask of water. It supplements Land Use Land Cover.This is an unsupervised process that produces a binary image. Intensity 255 indicates the presence of water while intensity 0 is the absence of water. \n\n**GBDX Registered Name**: protogenV2RAW\n**Provider**: GBDX\n**Inputs**: .TIF, .TIL,  .HDR\n**Outputs**: TIF image type UINT8x1\n**Compatible bands & sensors**: WorldView 2 or WorldView 3 multi-spectral imagery (8-band optical and VNIR data sets) that has been atmospherically compensated by the AOP processor.","slug":"water-mask","type":"basic","title":"Water Mask"}

Water Mask

This task uses 8-band imagery to detect a mask of water. It supplements Land Use Land Cover.This is an unsupervised process that produces a binary image. Intensity 255 indicates the presence of water while intensity 0 is the absence of water. **GBDX Registered Name**: protogenV2RAW **Provider**: GBDX **Inputs**: .TIF, .TIL, .HDR **Outputs**: TIF image type UINT8x1 **Compatible bands & sensors**: WorldView 2 or WorldView 3 multi-spectral imagery (8-band optical and VNIR data sets) that has been atmospherically compensated by the AOP processor.

[block:callout] { "type": "warning", "title": "This task uses an old version of the automated land cover classification algorithm", "body": "Please use the new [Automated Land Cover Classification (LULC)](doc:automated-land-cover-classification-1)." } [/block] ## Table of Contents Section | Description --- | --- [Imagery Examples](#Imagery Examples) | Before and after example [Quickstart](#Quickstart) | Get started with a Python-based quickstart tutorial [Task Runtime](#Task Runtime) | Benchmark runtimes for the algorithm [Input Options](#Input Options) | Required and optional task inputs [Outputs](#Outputs) | Task outputs and example contents [Advanced Options](#Advanced Options) | Additional information for advanced users [Known Issues](#Known Issues) | Issues users should be aware of ## <a name="Imagery Examples"></a>Imagery Example [block:image] { "images": [ { "image": [ "https://files.readme.io/96a57c2-RAW800x320.png", "RAW800x320.png", 800, 320, "#28261d" ], "caption": "Output image with water mask applied" } ] } [/block] [block:callout] { "type": "info", "body": "Please use the new [Automated Land Cover Classification (LULC)](doc:automated-land-cover-classification-1)." } [/block] ## <a name="Quickstart"></a>Quickstart Tutorial This script gives the example of a water mask with a single tif file as input. [block:code] { "codes": [ { "code": "# Quickstart Example producing a single band water mask from a tif file.\n# First Initialize the Environment\n\nfrom gbdxtools import Interface\ngbdx = Interface()\n\n#Edit the following path to reflect a specific path to an image\nraster = 's3://gbd-customer-data/CustomerAccount#/PathToImage/'\nprototask = gbdx.Task(\"protogenV2RAW\", raster=raster)\n\nworkflow = gbdx.Workflow([ prototask ]) \n#Edit the following line(s) to reflect specific folder(s) for the output file (example location provided)\nworkflow.savedata(prototask.outputs.data, location=\"RAW\")\nworkflow.execute()\n\nprint workflow.id\nprint workflow.status", "language": "python" } ] } [/block] ## <a name="Task Runtime"></a>Task Runtime These are the average runtimes for this algorithm. All benchmark tests were run using a standard set of images, based on our most common customer scenarios. Runtime benchmarks apply to the specific algorithm, and don’t represent the runtime of a complete workflow. Sensor Name | Total Pixels | Total Area (k2) | Time(secs) | Time/Area k2 --------|:----------:|-----------|----------------|--------------- WV02|35,872,942|329.87|230.29|0.70 WV03|35,371,971|196.27| 300.31|1.53 ## <a name="Input Options"></a>Input Options This task will process only WorldView 2 or WorldView 3 multi-spectral imagery (8-band optical and VNIR data sets) that has been atmospherically compensated by the Advanced Image Preprocessor (AOP_Strip_Processor). Supported formats are .TIF, .TIL, .VRT, .HDR. The following table lists the Water Mask task inputs. All inputs are **required**. Name | Default | Valid Values | Description -------------------------|:---------------------:|---------------------------------|----------------- raster | N/A | S3 URL .TIF only | S3 location of input .tif file processed through AOP_Strip_Processor. data | true | Folder name in S3 location | This will explain the output file location and provide the output in .TIF format. **OPTIONAL SETTINGS: Required = False** No additional optional settings for this task exist. ## <a name="Outputs"></a>Outputs The following table lists the Water Mask task outputs: Name | Required | Description -----|:--------:|----------------- data | Y | This will explain the output file location and provide the output in .TIF format. log | N | S3 location where logs are stored. ## <a name="Advanced Options"></a>Advanced Options To link the workflow of one input image into Advanced Image Preprocessor (AOP_Strip_Processor) into this task, you must use the follow gbdxtoools script in python: [block:code] { "codes": [ { "code": "#First initalize the environment\n#AOP strip processor has input values known to complete the Protogen tasks\n\nfrom gbdxtools import Interface\ngbdx = Interface()\n\n#Edit the following path to reflect a specific path to an image\ndata = 's3://gbd-customer-data/CustomerAccount#/PathToImage/'\n\naoptask2 = gbdx.Task('AOP_Strip_Processor', data=data, bands='MS', enable_acomp=True, enable_pansharpen=False, enable_dra=False) # creates acomp'd multispectral image\n\ngluetask = gbdx.Task('gdal-cli') \n# move aoptask output to root where prototask can find it\ngluetask.inputs.data = aoptask2.outputs.data.value\ngluetask.inputs.execution_strategy = 'runonce'\ngluetask.inputs.command = \"\"\"mv $indir/*/*.tif $outdir/\"\"\"\nprototask = gbdx.Task('protogenV2RAW')\nprototask.inputs.raster = gluetask.outputs.data.value\n\n\nworkflow = gbdx.Workflow([aoptask2, gluetask, prototask])\n#Edit the following line(s) to reflect specific folder(s) for the output file (example location provided)\nworkflow.savedata(prototask.outputs.data, location='RAW')\n\nworkflow.execute()\n\nworkflow.status", "language": "python" } ] } [/block] **Data Structure for Expected Outputs:** Your processed imagery will be written as binary .TIF image type UINT8x1 and placed in the specified S3 Customer Location (e.g. s3://gbd-customer-data/unique customer id/named directory/). ## <a name="Known Issues"></a>Known Issues 1) To run the task in a single workflow with Advanced Image Preprocessor, the tif file must first be removed from the AOP folder with the additional python commands listed in the Advanced section. 2)False positives maybe present due to certain types of concrete roofs or shadows. #### Contact Us If you have any questions or issues with this task, please contact [**gbdx-support@digitalglobe.com** ](mailto:gbdx-support@digitalglobe.com).