{"_id":"589b679bd23c4d1b00855feb","project":"55faeacad0e22017005b8265","parentDoc":null,"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":8,"slug":"algorithm-guide","title":"Algorithms"},"user":"55fae9d4825d5f19001fa379","version":{"_id":"55faeacad0e22017005b8268","project":"55faeacad0e22017005b8265","__v":35,"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","5a009de510890d001c2aabfe"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"v1","version_clean":"1.0.0","version":"1"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-02-08T18:46:51.270Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"# Overview\n\nThe ENVI® Task Engine provides support for the various [ENVI data types](https://www.harrisgeospatial.com/docs/supporteddatatypes.html). This document covers the more complicated use cases of specific ENVI data types. \n\nThese are the currently supported ENVI data types and their GBDX type:\n\n|ENVI Data Type | GBDX Type |\n| --- | --- |\n| [ENVIRaster](#section-enviraster)| Directory |\n|[ENVIURI](#section-enviuri)| Directory |\n|[ENVISpectralLibrary](#section-envispectrallibrary) | Directory |\n|[ENVIROI](#section-enviroi) | Directory |\n|[ENVIGCPSet](#section-envigcpset)| Directory |\n|[ENVITiePointSet](#section-envitiepointset)| Directory |\n|[ENVIVector](#section-envivector)| Directory |\n|[ENVICoordSys](#section-envicoordsys)|  String   |\n|[ENVIGridDefinition](#section-envigriddefinition)|  String   |\n|[ENVISpatialRef](#section-envispatialref) |   None    |\n|[ENVIPseudoRasterSpatialRef](#section-envipseudorasterspatialref) |  String   |\n|[ENVIStandardRasterSpatialRef](#section-envistandardrasterspatialref) |  String   |\n|[ENVIRPCRasterSpatialRef](#section-envirpcrasterspatialref) |  String   |\n|[ENVIGeoJson](#section-envigeojson)|  String   |\n\n\n\n# Find ENVI Port Type\n\nAll of the GBDX task definitions have the ENVI (or IDL) data types in the description of the ports. There are a couple of ways to get the task definition: through API requests (Postman, etc), or through gbdxtools. The easiest and recommended is to use [gbdxtools](http://gbdxtools.readthedocs.io/en/latest/), for example (ipython):\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"In [1]: from gbdxtools import Interface\\nIn [2]: gbdx = Interface()\\nIn [3]: task = gbdx.Task(\\\"ENVI_QuerySpectralIndices\\\")\\n\\nIn [4]: task.inputs\\nOut[4]:\\ninput_raster\\ninput_raster_format\\ninput_raster_filename\\nfile_types\\ninput_raster_band_grouping\\n\\nIn [5]: task.inputs.input_raster\\nOut[5]:\\nPort input_raster:\\n\\ttype: directory\\n\\tdescription: Specify a raster to query for available spectral indices. -- Value Type: ENVIRASTER\\n\\tmultiplex: False\\n\\trequired: True\\n\\tValue: None\\n        \\nIn [6]: task.inputs.file_types\\nOut[6]:\\nPort file_types:\\n\\ttype: string\\n\\tdescription: GBDX Option. Comma seperated list of permitted file type extensions. Use this to filter input files -- Value Type: STRING[*]\\n\\tmultiplex: False\\n\\trequired: False\\n\\tValue: None\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nAs can be seen from the above, the ENVI type for `task.inputs.input_raster` is `ENVIRASTER`, and the IDL type for `task.inputs.file_types` is `String[*]`, meaning a one dimension array of strings.\n\n\n\n# ENVI Data Types\n\nHere are descriptions for the various GBDX supported ENVI data types and their varying usage examples. ENVI data types can be complex, which means some require multiple GBDX input ports to be adequately configured in the task_runner. These ports are described below.\n\n## ENVIRaster\n\n### Input Ports\n\n| Example Input Ports          | GBDX Type | Required | Description                              |\n| ---------------------------- | --------- | -------- | ---------------------------------------- |\n| *input_raster*               | Directory | See Task | Directory containing the files required for the a task. |\n| *input_raster_format*        | String    | False    | A string for selecting the raster format (non-DG format). Please refer to Supported Datasets table below for a list of valid values for currently supported image data products. |\n| *input_raster_filename*      | String    | False    | A string with the filename of the raster for ENVI to open. This overrides any file discovery. |\n| *input_raster_band_grouping* | String    | False    | A string name indentify which band grouping to use for the task. |\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"The example names in the table above are for demonstrating the typical set of ports used to configure an input raster\",\n  \"body\": \"The names for the input rasters can vary by task (ie - input_low_resolution_raster), but the set of supplemental input ports will always be standard.\"\n}\n[/block]\n\n### Description\n\nENVI can open many different datasets from different sensors, the full list can be seen [here](https://www.harrisgeospatial.com/docs/supportedformats.html). However, the ENVI engine requires a JSON object which includes a single file name for the raster dataset. As can be seen from the list of supported sensors, this file is different for each sensor. So the task runner has built-in file discovery for datasets supported by GBDX. The default file discovery is suitable for all DigitalGlobe's  Worldview sensors, as it discovers `*.til` first, then `*.tif`, for example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task('ENVI_QuerySpectralIndices')\\ntask.inputs.input_raster = 's3://<bucket>/<folder>/'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nTo configure the task runner to switch the file discovery logic, use the `*_format` input port to specify the a supported input raster format. Currently the task runner supports all standard DigitalGlobe formats plus `IKONOS`, and `Landsat 8`. The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task('ENVI_QuerySpectralIndices')\\ntask.inputs.input_raster = 's3://<bucket>/<folder>/'\\ntask.inputs.input_raster_format = 'landsat-8'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"See the Supported Datasets table below for the acceptable input_raster_format names.\",\n  \"body\": \"Also, the majority of use cases will also require the *_band_grouping port as ENVI loads all the bands as different indexes.\"\n}\n[/block]\nAlternately, a user can override all file discovery logic by using the `*_filename` input port. This passes the relative file name directly to the ENVI engine. It also supports Python's glob style patterns for file discovery. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task('ENVI_QuerySpectralIndices')\\ntask.inputs.input_raster = 's3://<bucket>/<folder>/'\\ntask.inputs.input_raster_filename = 'landsat8_MTL.txt'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nThis port is particularly useful for use cases where a user has a dataset supported by ENVI, but the task runner doesn't have built in support for it. Also note, depending on how ENVI opens the raster, the `*_band_grouping` port may be required to select an appropriate index for a group of bands.\n\n\n\n#### Raster Band Grouping Selection\n\nWhen ENVI opens standardized raster data products distributed by various geospatial data providers, ENVI has built-in intelligence to open rasters with special metadata assignment and groups certain imagery bands together as individual raster datasets. For example, a typical IKONOS dataset is opened as two raster band groupings, *multispectral* and *panchromatic*. See the table below for datasets currently supported by the GBDX ENVI task runner and the specific band grouping names that can be specified. Even though the band grouping names for DigitalGlobe products (WorldView-\\*, QuickBird, GeoEye-1) are provided in the table below, they are not required as the format has seperate images for each grouping. The following are examples of using `*_band_grouping` continued from above:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# For IKONOS\\n...\\ntask.inputs.input_raster_band_grouping = 'multispectral'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"When using non-Worldview datasets, the ports `*_format` and `*_band_grouping` must be used together.\"\n}\n[/block]\nThis table shows supported datasets and the specific band grouping names.\n\n\n\n##### Supported Datasets\n\n|      Dataset Name      |           Band Grouping Names            | Format Input String |\n| :--------------------: | :--------------------------------------: | :-----------------: |\n| WorldView-1 (see note) |               panchromatic               |     worldview-1     |\n| WorldView-2 (see note) |       multispectral, panchromatic        |     worldview-2     |\n| WorldView-3 (see note) |    multispectral, panchromatic, swir     |     worldview-3     |\n|  GeoEye-1 (see note)   |       multispectral, panchromatic        |      geoeye-1       |\n|  QuickBird (see note)  |       multispectral, panchromatic        |      quickbird      |\n|         IKONOS         |       multispectral, panchromatic        |       ikonos        |\n|       Landsat 8        | multispectral, panchromatic, cirrus, thermal, quality |      landsat-8      |\n|       Sentinel-2       |    M1-10m, M2-20m, M3-60m     |     sentinel-2      |\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Band grouping names do not apply for standard format DG products where the a typical input_raster would have to point to a folder with a multispectral or panchromatic in it. Having both would cause an error with the task runner.\"\n}\n[/block]\n### ENVI DEM Rasters\n\nThere are tasks in the ENVI catalogue that require DEM rasters as inputs, which are implemented as *Special Case ENVIRasters*. These can be considered a subset of ENVIRaster except they allow for using DEM Rasters that are already part of the ENVI software distribution, as well as user provided DEM rasters. Also, the ports `*_format` and `*_band_grouping ` are not applicable for these types of rasters. \n\n#### Input Ports\n\n| Example Input Ports   | GBDX Type | Required | Description                              |\n| --------------------- | --------- | -------- | ---------------------------------------- |\n| *dem_raster*          | Directory | False    | Directory containing the DEM files required for the a task. |\n| *dem_raster_filename* | String    | False    | Special case of ENVI Raster filename. A string with the filename of the raster for ENVI to open. This overrides any file discovery. It also allows for using ENVI built in DEM raster. See below for details. |\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"The example names in the table above are for demonstrating the typical set of ports used to configure an input raster.\",\n  \"body\": \"The names for the input rasters can vary by task (ie - input_dem_raster).\"\n}\n[/block]\n\nUsage example for a user provided DEM raster is as follows:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task('ENVI_RPCOrthorectification')\\ntask.inputs.input_raster = 's3://<bucket>/<folder>/<raster>'\\ntask.inputs.dem_raster = 's3://<bucket>/<folder>/<dem>'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nHowever, ENVI comes with the GMTED2010 DEM raster which is at 30 arc-seconds. And the Docker image for the ENVI task runner includes a 7.5 arc-second version of [GMTED2010](http://www.harrisgeospatial.com/Company/PressRoom/Blogs/ImagerySpeaksDetail/TabId/901/ArtMID/2927/ArticleID/14401/Upgrading-the-GMTED2010-global-elevation-data-included-with-ENVI.aspx). These two rasters can be summarized as follows:\n\n| Filename            | Resolution     | Notes                          |\n| ------------------- | -------------- | ------------------------------ |\n| GMTED2010.jp2       | 7.5 arc-second | Excludes Greenland & Antarctic |\n| GMTED2010_polar.jp2 | 30 arc-second  | Global Coverage                |\n\nTo use these files, the port `*_filename` can be used to specify which of the above files to use as the DEM file for the task. The following is an example:\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Use the 30 arc-second DEM\\n...\\ntask = gbdx.Task('ENVI_RPCOrthorectification')\\ntask.inputs.input_raster = 's3://<bucket>/<folder>/<raster>'\\ntask.inputs.dem_raster_filename = 'GMTED2010_polar.jp2'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"The dem_raster port is optional, and if it is missing, the task runner will use the GMTED2010.jp2 DEM file.\"\n}\n[/block]\n## ENVIURI\n\n### Input Ports\n\n| Example Input Ports       | GBDX Type | Required | Description of Use Case                  |\n| ------------------------- | --------- | -------- | ---------------------------------------- |\n| *input_raster_uri*        | Directory | See Task | Directory containing the files required for the task. |\n| *input_raster_uri_filter* | String    | False    | A single string or list of strings used to filter the input directory. Supports Python glob2 syntax. See below for more details. |\n\n\n\n### Description\n\nThis input port is a generic file input for the ENVI task runner. The data type has no specific file type(s). However, the ENVI engine will only accept a single file name. By default, the task runner will search the input directory for any [supported file type](https://www.harrisgeospatial.com/docs/supportedformats.html). This can result in multiple files being found by the task runner, which will cause an error. So, in order to use a port of this type, the task runner must be told which files to search for. This is done using the `*_filter` input port, which is prefixed with the name of the ENVIURI port. A usage example of this type of port is as follows:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"from gbdxtools import Interface\\ngbdx = Interface()\\n\\ntask = gbdx.Task(\\\"ENVI_BuildRasterSeries\\\")\\ntask.inputs.input_raster_uri = \\\"s3://<bucket>/<folder>/\\\"\\ntask.inputs.input_raster_uri_filter = \\\"*.dat\\\"\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nThe `*_filter` port needs to be a single string filter, each filter string must be a Python [globe2](https://docs.python.org/2/library/glob.html) style pattern. For example, a single string like `\"**/*_MTL.txt\"` will recursively look for files ending in `_MTL.txt`, or a string like `*.dat` will non-recursively look for files ending in `.dat`.   \n\n\n\n## ENVISpectralLibrary\n\n### Input Ports\n\n| Example Input Ports               | GBDX Type | Required | Description                              |\n| --------------------------------- | --------- | -------- | ---------------------------------------- |\n| *input_spectral_library*          | Directory | False    | Directory containing the files required for the task. |\n| *input_spectral_library_filename* | String    | False    | String name of the ENVI spectral library file. |\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Both ports above are shown as not required, however one of the two is required. The task runner will return an error if none of them are provided.\"\n}\n[/block]\n### Description\n\nThis data type has two ports for two different use cases: providing the task runner with a spectral library file (S3 location), or using one of the spectral library files that is bundled with ENVI. When providing a spectral library file, the task runner will search the input directory for a file with the `*.sli` extension. The following example shows this use case:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task('ENVI_GetSpectrumFromLibrary')\\ntask.inputs.input_spectral_library = 's3://<bucket>/<folder>/'\\ntask.inputs.spectrum_name = '<spectrum_name>'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"\",\n  \"title\": \"When providing a *.sli file, an ENVI header (*.hdr) is also required. The creation of this file is left to the user.\"\n}\n[/block]\nTo use one of the spectral library files bundled with the ENVI software, only the file name is required. The following example shows this use case:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task('ENVI_GetSpectrumFromLibrary')\\ntask.inputs.input_spectral_library_filename = 'veg_2grn.sli'\\ntask.inputs.spectrum_name = 'Dry Grass'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Use the ENVI desktop application to find an appropriate *.sli file name.\"\n}\n[/block]\n## ENVIROI\n\n### Input Ports\n\n| Example Input Ports | GBDX Type | Required | Description                              |\n| ------------------- | --------- | -------- | ---------------------------------------- |\n| *input_roi*         | Directory | See Task | Directory containing the files required for the task. |\n\n### Description\n\nThis input port allows a user to provide an S3 location for the region of interest input files. The task runner will search the input directory for a `*.xml` file. The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task(\\\"ENVI_ROIToClassification\\\")\\ntask.inputs.input_roi = 's3://<bucket>/<folder>/'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVIGCPSet\n\n### Input Ports\n\n| Example Input Ports | GBDX Type | Required | Description                              |\n| ------------------- | --------- | -------- | ---------------------------------------- |\n| *input_gcp*         | Directory | See Task | Directory containing the files required for the task. |\n\n### Description\n\nThis input port allows a user to provide an S3 location for the ground control point input files. The task runner will search the input directory for a `*.pts` file. The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task(\\\"ENVI_RPCOrthorectification\\\")\\ntask.inputs.input_gcp = 's3://<bucket>/<folder>/'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVITiePointSet\n\n### Input Ports\n\n| Example Input Ports | GBDX Type | Required | Description                              |\n| ------------------- | --------- | -------- | ---------------------------------------- |\n| *input_tiepoints*   | Directory | See Task | Directory containing the files required for the task. |\n\n### Description\n\nThis input port allows a user to provide an S3 location for the tie points input files. The task runner will search the input directory for a `*.pts` file. The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task(\\\"ENVI_GenerateGCPsFromTiePoints\\\")\\ntask.inputs.input_tiepoints = 's3://<bucket>/<folder>/'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVIVector\n\n### Input Ports\n\n| Example Input Ports | GBDX Type | Required | Description                              |\n| ------------------- | --------- | -------- | ---------------------------------------- |\n| *input_vector*      | Directory | See Task | Directory containing the files required for the task. |\n\n### Description\n\nThis input port allows a user to provide an S3 location for the vector input files. The task runner will search the input directory for a `*.shp` file. The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"......\\ntask = gbdx.Task(\\\"ENVI_VectorAttributeToROIs\\\")\\ntask.inputs.input_vector = 's3://<bucket>/<folder>/'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVICoordSys\n\nHarris documentation Reference: https://www.harrisgeospatial.com/docs/envicoordsys.html \n\n### Input Attributes\n\n| Attribute Name   | Required | Description                              |\n| ---------------- | -------- | ---------------------------------------- |\n| *factory*        | True     | Sting value of ` CoordSys`               |\n| *coord_sys_code* | False    | An integer indicating the geographic or projected coordinate system code to use. |\n| *coord_sys_str*  | False    | A string indicating the geographic or projected coordinate system string. |\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"The coord_sys_code and coord_sys_string keys are mutually exclusive.\"\n}\n[/block]\n### Description\n\nThis input port uses a string json object and its attributes to describe a coordinate system. The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task(\\\"ENVI_ReprojectRaster\\\")\\ntask.inputs.coord_sys = '{\\\"factory\\\": \\\"CoordSys\\\", \\\"coord_sys_code\\\": 00000}'\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVIGridDefinition\n\nHarris documentation Reference: http://www.harrisgeospatial.com/docs/ENVIGridDefinition.html\n\n### Input Attributes\n\n| Attribute Name | Required | Description                              |\n| -------------- | -------- | ---------------------------------------- |\n| *factory*      | True     | Sting value of ` GridDefinition`         |\n| *coord_sys*    | True     | An `ENVICoordSys` object that indicates the coordinate system of the grid definition |\n| *extents*      | True     | The geographic extent of the grid.       |\n| *nrows*        | True     | Number of rows in the grid.              |\n| *ncolumns*     | True     | Number of columns in the grid            |\n\n### Description\n\nThis input port uses a string json object and it's attributes to describe a grid definition. The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task(\\\"ENVI_RegridRaster\\\")\\ntask.inputs.grid_definition = '''{\\n  \\\"factory\\\": \\\"GridDefinition\\\",\\n  \\\"coord_sys\\\": {\\\"factory\\\": \\\"CoordSys\\\", \\\"coord_sys_code\\\": 00000},\\n  \\\"extents\\\": [0.0, 0.0, 0.0, 0.0],\\n  \\\"nrows\\\": 0,\\n  \\\"ncolumns\\\": 0\\n}\\n'''\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVISpatialRef\n\nThis type may be identified as `_ENVISPATIALREF` in the GBDX task definitions, and is a wrapper (abstract type) for similar ENVI spatial reference objects. The sub types are as follows:\n\n- [ENVIPseudoRasterSpatialRef](#ENVIPseudoRasterSpatialRef)\n- [ENVIStandardRasterSpatialRef](#ENVIStandardRasterSpatialRef)\n- [ENVIRPCRasterSpatialRef](#ENVIRPCRasterSpatialRef)\n\nThis means any of these sub types can be used for the parent type `_ENVISPATIALREF`. See the below sections for descriptions of each.\n\n## ENVIPseudoRasterSpatialRef\n\nHarris Documentation Reference: http://www.harrisgeospatial.com/docs/envipseudorasterspatialref.html\n\n### Input Attributes\n\n| Attribute Name       | Required | Description                              |\n| -------------------- | -------- | ---------------------------------------- |\n| *factory*            | True     | Sting value of `PseudoRasterSpatialRef`  |\n| *pseudo_geo_point_1* | True     | A four-element array [*X Pixel*, *Y Pixel*, *Longitude*, *Latitude*] specifying a geographic corner for a non-georeferenced file. |\n| *pseudo_geo_point_2* | True     | A four-element array [*X Pixel*, *Y Pixel*, *Longitude*, *Latitude*] specifying a geographic corner for a non-georeferenced file. |\n| *pseudo_geo_point_3* | True     | A four-element array [*X Pixel*, *Y Pixel*, *Longitude*, *Latitude*] specifying a geographic corner for a non-georeferenced file. |\n| *pseudo_geo_point_4* | True     | A four-element array [*X Pixel*, *Y Pixel*, *Longitude*, *Latitude*] specifying a geographic corner for a non-georeferenced file. |\n\n### Description\n\nThis input port uses a string JSON object and its attributes to describe a pseudo taster spatial reference . The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask.inputs.spatial_reference = '''{\\n  \\\"factory\\\": \\\"PseudoRasterSpatialRef\\\",\\n  \\\"pseudo_geo_point_1\\\": [1.0, 1.0, -117.07201, 32.893801],\\n  \\\"pseudo_geo_point_2\\\": [1000.0, 1.0, -116.95856, 32.873647],\\n  \\\"pseudo_geo_point_3\\\": [1.0, 1000.0, -117.09961 32.806283],\\n  \\\"pseudo_geo_point_4\\\": [1000.0, 1000.0, -116.98626, 32.786154],\\n}'''\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVIStandardRasterSpatialRef\n\nHarris Documentation Reference: http://www.harrisgeospatial.com/docs/envistandardrasterspatialref.html\n\n### Input Attributes\n\n| Attribute Name   | Required | Description                              |\n| ---------------- | -------- | ---------------------------------------- |\n| *factory*        | True     | Sting value of `StandardRasterSpatialRef` |\n| *coord_sys_code* | False    | An integer indicating the geographic or projected coordinate system code to use. |\n| *coord_sys_str*  | False    | A string indicating the geographic or projected coordinate system string. |\n| pixel_size       | True     | A two-element double-precision array with the [x,y] pixel size in the same units as the associated coordinate system. |\n| rotation         | False    | A double-precision floating-point value indicating the rotation of the image, degrees clockwise from North. |\n| tie_point_pixel  | False    | A two-element double-precision array with the pixel coordinates of the tie point. If you do not set this key. DEFAULT: [0,0] |\n| tie_point_map    | True     | A two-element double-precision array with the map coordinates of the tie_point_pixel location. Must be in the same units as the coordinate system. |\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"The coord_sys_code and coord_sys_string keys are mutually exclusive.\"\n}\n[/block]\n### Description\n\nThis input port uses a string JSON object and its attributes to describe a standard raster spatial reference. The following is an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask.inputs.input_ = '''{\\n  \\\"factory\\\": \\\"StandardRasterSpatialRef\\\",\\n  \\\"coord_sys_code\\\": [1.0, 1.0, -117.07201, 32.893801],\\n  \\\"pixel_size\\\": [9.186, 9.186],\\n  \\\"tie_point_pixel\\\": [0.0, 0.0],\\n  \\\"tie_point_map\\\": [3075299.7946,1246937.9905],\\n}'''\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVIRPCRasterSpatialRef\n\nHarris Documentation Reference: http://www.harrisgeospatial.com/docs/envirpcrasterspatialref.html\n\n### Input Attributes\n\n| Attribute Name       | Required | Description                              |\n| -------------------- | -------- | ---------------------------------------- |\n| *factory*            | True     | Sting value of `RPCRasterSpatialRef`     |\n| *rpc_offsets*        | True     | A five-element, double-precision array that specifies the *Line_Offset*, *Sample_Offset*, *Latitude_Offset*, *Longitude_Offset*, and *Height_Offset* values |\n| *rpc_scales*         | True     | A five-element, double-precision array that specifies the *Line_Scale*, *Sample_Scale*, *Latitude_Scale*, *Longitude_Scale*, and *Height_Scale* values. |\n| *rpc_line_num_coeff* | True     | A 20-element, double-precision array of RPC line numerator coefficients. |\n| *rpc_line_den_coeff* | True     | A 20-element, double-precision array of RPC line denominator coefficients. |\n| *rpc_samp_num_coeff* | True     | A 20-element, double-precision array of RPC sample numerator coefficients. |\n| *rpc_samp_den_coeff* | True     | A 20-element, double-precision array of RPC sample denominator coefficients. |\n\n\n\n### Description\n\nThis input port uses a string JSON object and its attributes to describe a RPC raster spatial reference. The following is an example:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask.inputs.input_ = '''{\\n  \\\"factory\\\": \\\"StandardRasterSpatialRef\\\",\\n  \\\"coord_sys_code\\\": [1.0, 1.0, -117.07201, 32.893801],\\n  \\\"pixel_size\\\": [9.186, 9.186],\\n  \\\"tie_point_pixel\\\": [0.0, 0.0],\\n  \\\"tie_point_map\\\": [3075299.7946,1246937.9905],\\n}'''\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\n## ENVIGeoJson\n\nHarris Documentation Reference: https://harrisgeospatial.com/docs/envigeojson.html\n\nHarris ENVIGeoJSONToROITask Documentation Reference: https://harrisgeospatial.com/docs/envigeojsontoroitask.html\n\n### Description\n\nThis input port supports valid GeoJSON, and will accept the GeoJSON as a string. A detailed example can be seen on the above-referenced Harris documentation for `ENVIGeoJSONToROITask`. There are some constraints on the contents of the GeoJSON:\n\n- ENVI currently supports GeometryCollection type objects. These objects can only contain one or more MultiPolygon type geometries.\n- The crs tag is not required. If the code contains this tag, ENVI converts it to a string. Otherwise, it uses a default value of wgs84.\n- You can add name and color properties to each MultiPolygon object.\n\nFor example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"...\\ntask = gbdx.Task(\\\"ENVI_GeoJSONToROI\\\")\\ntask.inputs.input_geojson = ''' {\\n  \\\"type\\\": \\\"GeometryCollection\\\",\\n  \\\"geometries\\\": [\\n    {\\\"type\\\": \\\"MultiPolygon\\\",\\n  ...\\n} # See the Harris code example for more details.\\n'''\\n...\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"envi-task-runner-inputs","type":"basic","title":"ENVI® Task Runner Inputs"}

ENVI® Task Runner Inputs


# Overview The ENVI® Task Engine provides support for the various [ENVI data types](https://www.harrisgeospatial.com/docs/supporteddatatypes.html). This document covers the more complicated use cases of specific ENVI data types. These are the currently supported ENVI data types and their GBDX type: |ENVI Data Type | GBDX Type | | --- | --- | | [ENVIRaster](#section-enviraster)| Directory | |[ENVIURI](#section-enviuri)| Directory | |[ENVISpectralLibrary](#section-envispectrallibrary) | Directory | |[ENVIROI](#section-enviroi) | Directory | |[ENVIGCPSet](#section-envigcpset)| Directory | |[ENVITiePointSet](#section-envitiepointset)| Directory | |[ENVIVector](#section-envivector)| Directory | |[ENVICoordSys](#section-envicoordsys)| String | |[ENVIGridDefinition](#section-envigriddefinition)| String | |[ENVISpatialRef](#section-envispatialref) | None | |[ENVIPseudoRasterSpatialRef](#section-envipseudorasterspatialref) | String | |[ENVIStandardRasterSpatialRef](#section-envistandardrasterspatialref) | String | |[ENVIRPCRasterSpatialRef](#section-envirpcrasterspatialref) | String | |[ENVIGeoJson](#section-envigeojson)| String | # Find ENVI Port Type All of the GBDX task definitions have the ENVI (or IDL) data types in the description of the ports. There are a couple of ways to get the task definition: through API requests (Postman, etc), or through gbdxtools. The easiest and recommended is to use [gbdxtools](http://gbdxtools.readthedocs.io/en/latest/), for example (ipython): [block:code] { "codes": [ { "code": "In [1]: from gbdxtools import Interface\nIn [2]: gbdx = Interface()\nIn [3]: task = gbdx.Task(\"ENVI_QuerySpectralIndices\")\n\nIn [4]: task.inputs\nOut[4]:\ninput_raster\ninput_raster_format\ninput_raster_filename\nfile_types\ninput_raster_band_grouping\n\nIn [5]: task.inputs.input_raster\nOut[5]:\nPort input_raster:\n\ttype: directory\n\tdescription: Specify a raster to query for available spectral indices. -- Value Type: ENVIRASTER\n\tmultiplex: False\n\trequired: True\n\tValue: None\n \nIn [6]: task.inputs.file_types\nOut[6]:\nPort file_types:\n\ttype: string\n\tdescription: GBDX Option. Comma seperated list of permitted file type extensions. Use this to filter input files -- Value Type: STRING[*]\n\tmultiplex: False\n\trequired: False\n\tValue: None", "language": "python" } ] } [/block] As can be seen from the above, the ENVI type for `task.inputs.input_raster` is `ENVIRASTER`, and the IDL type for `task.inputs.file_types` is `String[*]`, meaning a one dimension array of strings. # ENVI Data Types Here are descriptions for the various GBDX supported ENVI data types and their varying usage examples. ENVI data types can be complex, which means some require multiple GBDX input ports to be adequately configured in the task_runner. These ports are described below. ## ENVIRaster ### Input Ports | Example Input Ports | GBDX Type | Required | Description | | ---------------------------- | --------- | -------- | ---------------------------------------- | | *input_raster* | Directory | See Task | Directory containing the files required for the a task. | | *input_raster_format* | String | False | A string for selecting the raster format (non-DG format). Please refer to Supported Datasets table below for a list of valid values for currently supported image data products. | | *input_raster_filename* | String | False | A string with the filename of the raster for ENVI to open. This overrides any file discovery. | | *input_raster_band_grouping* | String | False | A string name indentify which band grouping to use for the task. | [block:callout] { "type": "info", "title": "The example names in the table above are for demonstrating the typical set of ports used to configure an input raster", "body": "The names for the input rasters can vary by task (ie - input_low_resolution_raster), but the set of supplemental input ports will always be standard." } [/block] ### Description ENVI can open many different datasets from different sensors, the full list can be seen [here](https://www.harrisgeospatial.com/docs/supportedformats.html). However, the ENVI engine requires a JSON object which includes a single file name for the raster dataset. As can be seen from the list of supported sensors, this file is different for each sensor. So the task runner has built-in file discovery for datasets supported by GBDX. The default file discovery is suitable for all DigitalGlobe's Worldview sensors, as it discovers `*.til` first, then `*.tif`, for example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task('ENVI_QuerySpectralIndices')\ntask.inputs.input_raster = 's3://<bucket>/<folder>/'\n...", "language": "python" } ] } [/block] To configure the task runner to switch the file discovery logic, use the `*_format` input port to specify the a supported input raster format. Currently the task runner supports all standard DigitalGlobe formats plus `IKONOS`, and `Landsat 8`. The following is an example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task('ENVI_QuerySpectralIndices')\ntask.inputs.input_raster = 's3://<bucket>/<folder>/'\ntask.inputs.input_raster_format = 'landsat-8'\n...", "language": "python" } ] } [/block] [block:callout] { "type": "info", "title": "See the Supported Datasets table below for the acceptable input_raster_format names.", "body": "Also, the majority of use cases will also require the *_band_grouping port as ENVI loads all the bands as different indexes." } [/block] Alternately, a user can override all file discovery logic by using the `*_filename` input port. This passes the relative file name directly to the ENVI engine. It also supports Python's glob style patterns for file discovery. For example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task('ENVI_QuerySpectralIndices')\ntask.inputs.input_raster = 's3://<bucket>/<folder>/'\ntask.inputs.input_raster_filename = 'landsat8_MTL.txt'\n...", "language": "python" } ] } [/block] This port is particularly useful for use cases where a user has a dataset supported by ENVI, but the task runner doesn't have built in support for it. Also note, depending on how ENVI opens the raster, the `*_band_grouping` port may be required to select an appropriate index for a group of bands. #### Raster Band Grouping Selection When ENVI opens standardized raster data products distributed by various geospatial data providers, ENVI has built-in intelligence to open rasters with special metadata assignment and groups certain imagery bands together as individual raster datasets. For example, a typical IKONOS dataset is opened as two raster band groupings, *multispectral* and *panchromatic*. See the table below for datasets currently supported by the GBDX ENVI task runner and the specific band grouping names that can be specified. Even though the band grouping names for DigitalGlobe products (WorldView-\*, QuickBird, GeoEye-1) are provided in the table below, they are not required as the format has seperate images for each grouping. The following are examples of using `*_band_grouping` continued from above: [block:code] { "codes": [ { "code": "# For IKONOS\n...\ntask.inputs.input_raster_band_grouping = 'multispectral'\n...", "language": "python" } ] } [/block] [block:callout] { "type": "info", "title": "When using non-Worldview datasets, the ports `*_format` and `*_band_grouping` must be used together." } [/block] This table shows supported datasets and the specific band grouping names. ##### Supported Datasets | Dataset Name | Band Grouping Names | Format Input String | | :--------------------: | :--------------------------------------: | :-----------------: | | WorldView-1 (see note) | panchromatic | worldview-1 | | WorldView-2 (see note) | multispectral, panchromatic | worldview-2 | | WorldView-3 (see note) | multispectral, panchromatic, swir | worldview-3 | | GeoEye-1 (see note) | multispectral, panchromatic | geoeye-1 | | QuickBird (see note) | multispectral, panchromatic | quickbird | | IKONOS | multispectral, panchromatic | ikonos | | Landsat 8 | multispectral, panchromatic, cirrus, thermal, quality | landsat-8 | | Sentinel-2 | M1-10m, M2-20m, M3-60m | sentinel-2 | [block:callout] { "type": "info", "title": "Band grouping names do not apply for standard format DG products where the a typical input_raster would have to point to a folder with a multispectral or panchromatic in it. Having both would cause an error with the task runner." } [/block] ### ENVI DEM Rasters There are tasks in the ENVI catalogue that require DEM rasters as inputs, which are implemented as *Special Case ENVIRasters*. These can be considered a subset of ENVIRaster except they allow for using DEM Rasters that are already part of the ENVI software distribution, as well as user provided DEM rasters. Also, the ports `*_format` and `*_band_grouping ` are not applicable for these types of rasters. #### Input Ports | Example Input Ports | GBDX Type | Required | Description | | --------------------- | --------- | -------- | ---------------------------------------- | | *dem_raster* | Directory | False | Directory containing the DEM files required for the a task. | | *dem_raster_filename* | String | False | Special case of ENVI Raster filename. A string with the filename of the raster for ENVI to open. This overrides any file discovery. It also allows for using ENVI built in DEM raster. See below for details. | [block:callout] { "type": "info", "title": "The example names in the table above are for demonstrating the typical set of ports used to configure an input raster.", "body": "The names for the input rasters can vary by task (ie - input_dem_raster)." } [/block] Usage example for a user provided DEM raster is as follows: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task('ENVI_RPCOrthorectification')\ntask.inputs.input_raster = 's3://<bucket>/<folder>/<raster>'\ntask.inputs.dem_raster = 's3://<bucket>/<folder>/<dem>'\n...", "language": "python" } ] } [/block] However, ENVI comes with the GMTED2010 DEM raster which is at 30 arc-seconds. And the Docker image for the ENVI task runner includes a 7.5 arc-second version of [GMTED2010](http://www.harrisgeospatial.com/Company/PressRoom/Blogs/ImagerySpeaksDetail/TabId/901/ArtMID/2927/ArticleID/14401/Upgrading-the-GMTED2010-global-elevation-data-included-with-ENVI.aspx). These two rasters can be summarized as follows: | Filename | Resolution | Notes | | ------------------- | -------------- | ------------------------------ | | GMTED2010.jp2 | 7.5 arc-second | Excludes Greenland & Antarctic | | GMTED2010_polar.jp2 | 30 arc-second | Global Coverage | To use these files, the port `*_filename` can be used to specify which of the above files to use as the DEM file for the task. The following is an example: [block:code] { "codes": [ { "code": "# Use the 30 arc-second DEM\n...\ntask = gbdx.Task('ENVI_RPCOrthorectification')\ntask.inputs.input_raster = 's3://<bucket>/<folder>/<raster>'\ntask.inputs.dem_raster_filename = 'GMTED2010_polar.jp2'\n...", "language": "python" } ] } [/block] [block:callout] { "type": "info", "title": "The dem_raster port is optional, and if it is missing, the task runner will use the GMTED2010.jp2 DEM file." } [/block] ## ENVIURI ### Input Ports | Example Input Ports | GBDX Type | Required | Description of Use Case | | ------------------------- | --------- | -------- | ---------------------------------------- | | *input_raster_uri* | Directory | See Task | Directory containing the files required for the task. | | *input_raster_uri_filter* | String | False | A single string or list of strings used to filter the input directory. Supports Python glob2 syntax. See below for more details. | ### Description This input port is a generic file input for the ENVI task runner. The data type has no specific file type(s). However, the ENVI engine will only accept a single file name. By default, the task runner will search the input directory for any [supported file type](https://www.harrisgeospatial.com/docs/supportedformats.html). This can result in multiple files being found by the task runner, which will cause an error. So, in order to use a port of this type, the task runner must be told which files to search for. This is done using the `*_filter` input port, which is prefixed with the name of the ENVIURI port. A usage example of this type of port is as follows: [block:code] { "codes": [ { "code": "from gbdxtools import Interface\ngbdx = Interface()\n\ntask = gbdx.Task(\"ENVI_BuildRasterSeries\")\ntask.inputs.input_raster_uri = \"s3://<bucket>/<folder>/\"\ntask.inputs.input_raster_uri_filter = \"*.dat\"\n...", "language": "python" } ] } [/block] The `*_filter` port needs to be a single string filter, each filter string must be a Python [globe2](https://docs.python.org/2/library/glob.html) style pattern. For example, a single string like `"**/*_MTL.txt"` will recursively look for files ending in `_MTL.txt`, or a string like `*.dat` will non-recursively look for files ending in `.dat`. ## ENVISpectralLibrary ### Input Ports | Example Input Ports | GBDX Type | Required | Description | | --------------------------------- | --------- | -------- | ---------------------------------------- | | *input_spectral_library* | Directory | False | Directory containing the files required for the task. | | *input_spectral_library_filename* | String | False | String name of the ENVI spectral library file. | [block:callout] { "type": "info", "title": "Both ports above are shown as not required, however one of the two is required. The task runner will return an error if none of them are provided." } [/block] ### Description This data type has two ports for two different use cases: providing the task runner with a spectral library file (S3 location), or using one of the spectral library files that is bundled with ENVI. When providing a spectral library file, the task runner will search the input directory for a file with the `*.sli` extension. The following example shows this use case: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task('ENVI_GetSpectrumFromLibrary')\ntask.inputs.input_spectral_library = 's3://<bucket>/<folder>/'\ntask.inputs.spectrum_name = '<spectrum_name>'\n...", "language": "python" } ] } [/block] [block:callout] { "type": "info", "body": "", "title": "When providing a *.sli file, an ENVI header (*.hdr) is also required. The creation of this file is left to the user." } [/block] To use one of the spectral library files bundled with the ENVI software, only the file name is required. The following example shows this use case: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task('ENVI_GetSpectrumFromLibrary')\ntask.inputs.input_spectral_library_filename = 'veg_2grn.sli'\ntask.inputs.spectrum_name = 'Dry Grass'\n...", "language": "python" } ] } [/block] [block:callout] { "type": "info", "title": "Use the ENVI desktop application to find an appropriate *.sli file name." } [/block] ## ENVIROI ### Input Ports | Example Input Ports | GBDX Type | Required | Description | | ------------------- | --------- | -------- | ---------------------------------------- | | *input_roi* | Directory | See Task | Directory containing the files required for the task. | ### Description This input port allows a user to provide an S3 location for the region of interest input files. The task runner will search the input directory for a `*.xml` file. The following is an example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task(\"ENVI_ROIToClassification\")\ntask.inputs.input_roi = 's3://<bucket>/<folder>/'\n...", "language": "python" } ] } [/block] ## ENVIGCPSet ### Input Ports | Example Input Ports | GBDX Type | Required | Description | | ------------------- | --------- | -------- | ---------------------------------------- | | *input_gcp* | Directory | See Task | Directory containing the files required for the task. | ### Description This input port allows a user to provide an S3 location for the ground control point input files. The task runner will search the input directory for a `*.pts` file. The following is an example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task(\"ENVI_RPCOrthorectification\")\ntask.inputs.input_gcp = 's3://<bucket>/<folder>/'\n...", "language": "python" } ] } [/block] ## ENVITiePointSet ### Input Ports | Example Input Ports | GBDX Type | Required | Description | | ------------------- | --------- | -------- | ---------------------------------------- | | *input_tiepoints* | Directory | See Task | Directory containing the files required for the task. | ### Description This input port allows a user to provide an S3 location for the tie points input files. The task runner will search the input directory for a `*.pts` file. The following is an example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task(\"ENVI_GenerateGCPsFromTiePoints\")\ntask.inputs.input_tiepoints = 's3://<bucket>/<folder>/'\n...", "language": "python" } ] } [/block] ## ENVIVector ### Input Ports | Example Input Ports | GBDX Type | Required | Description | | ------------------- | --------- | -------- | ---------------------------------------- | | *input_vector* | Directory | See Task | Directory containing the files required for the task. | ### Description This input port allows a user to provide an S3 location for the vector input files. The task runner will search the input directory for a `*.shp` file. The following is an example: [block:code] { "codes": [ { "code": "......\ntask = gbdx.Task(\"ENVI_VectorAttributeToROIs\")\ntask.inputs.input_vector = 's3://<bucket>/<folder>/'\n...", "language": "python" } ] } [/block] ## ENVICoordSys Harris documentation Reference: https://www.harrisgeospatial.com/docs/envicoordsys.html ### Input Attributes | Attribute Name | Required | Description | | ---------------- | -------- | ---------------------------------------- | | *factory* | True | Sting value of ` CoordSys` | | *coord_sys_code* | False | An integer indicating the geographic or projected coordinate system code to use. | | *coord_sys_str* | False | A string indicating the geographic or projected coordinate system string. | [block:callout] { "type": "info", "title": "The coord_sys_code and coord_sys_string keys are mutually exclusive." } [/block] ### Description This input port uses a string json object and its attributes to describe a coordinate system. The following is an example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task(\"ENVI_ReprojectRaster\")\ntask.inputs.coord_sys = '{\"factory\": \"CoordSys\", \"coord_sys_code\": 00000}'\n...", "language": "python" } ] } [/block] ## ENVIGridDefinition Harris documentation Reference: http://www.harrisgeospatial.com/docs/ENVIGridDefinition.html ### Input Attributes | Attribute Name | Required | Description | | -------------- | -------- | ---------------------------------------- | | *factory* | True | Sting value of ` GridDefinition` | | *coord_sys* | True | An `ENVICoordSys` object that indicates the coordinate system of the grid definition | | *extents* | True | The geographic extent of the grid. | | *nrows* | True | Number of rows in the grid. | | *ncolumns* | True | Number of columns in the grid | ### Description This input port uses a string json object and it's attributes to describe a grid definition. The following is an example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task(\"ENVI_RegridRaster\")\ntask.inputs.grid_definition = '''{\n \"factory\": \"GridDefinition\",\n \"coord_sys\": {\"factory\": \"CoordSys\", \"coord_sys_code\": 00000},\n \"extents\": [0.0, 0.0, 0.0, 0.0],\n \"nrows\": 0,\n \"ncolumns\": 0\n}\n'''\n...", "language": "python" } ] } [/block] ## ENVISpatialRef This type may be identified as `_ENVISPATIALREF` in the GBDX task definitions, and is a wrapper (abstract type) for similar ENVI spatial reference objects. The sub types are as follows: - [ENVIPseudoRasterSpatialRef](#ENVIPseudoRasterSpatialRef) - [ENVIStandardRasterSpatialRef](#ENVIStandardRasterSpatialRef) - [ENVIRPCRasterSpatialRef](#ENVIRPCRasterSpatialRef) This means any of these sub types can be used for the parent type `_ENVISPATIALREF`. See the below sections for descriptions of each. ## ENVIPseudoRasterSpatialRef Harris Documentation Reference: http://www.harrisgeospatial.com/docs/envipseudorasterspatialref.html ### Input Attributes | Attribute Name | Required | Description | | -------------------- | -------- | ---------------------------------------- | | *factory* | True | Sting value of `PseudoRasterSpatialRef` | | *pseudo_geo_point_1* | True | A four-element array [*X Pixel*, *Y Pixel*, *Longitude*, *Latitude*] specifying a geographic corner for a non-georeferenced file. | | *pseudo_geo_point_2* | True | A four-element array [*X Pixel*, *Y Pixel*, *Longitude*, *Latitude*] specifying a geographic corner for a non-georeferenced file. | | *pseudo_geo_point_3* | True | A four-element array [*X Pixel*, *Y Pixel*, *Longitude*, *Latitude*] specifying a geographic corner for a non-georeferenced file. | | *pseudo_geo_point_4* | True | A four-element array [*X Pixel*, *Y Pixel*, *Longitude*, *Latitude*] specifying a geographic corner for a non-georeferenced file. | ### Description This input port uses a string JSON object and its attributes to describe a pseudo taster spatial reference . The following is an example: [block:code] { "codes": [ { "code": "...\ntask.inputs.spatial_reference = '''{\n \"factory\": \"PseudoRasterSpatialRef\",\n \"pseudo_geo_point_1\": [1.0, 1.0, -117.07201, 32.893801],\n \"pseudo_geo_point_2\": [1000.0, 1.0, -116.95856, 32.873647],\n \"pseudo_geo_point_3\": [1.0, 1000.0, -117.09961 32.806283],\n \"pseudo_geo_point_4\": [1000.0, 1000.0, -116.98626, 32.786154],\n}'''\n...", "language": "python" } ] } [/block] ## ENVIStandardRasterSpatialRef Harris Documentation Reference: http://www.harrisgeospatial.com/docs/envistandardrasterspatialref.html ### Input Attributes | Attribute Name | Required | Description | | ---------------- | -------- | ---------------------------------------- | | *factory* | True | Sting value of `StandardRasterSpatialRef` | | *coord_sys_code* | False | An integer indicating the geographic or projected coordinate system code to use. | | *coord_sys_str* | False | A string indicating the geographic or projected coordinate system string. | | pixel_size | True | A two-element double-precision array with the [x,y] pixel size in the same units as the associated coordinate system. | | rotation | False | A double-precision floating-point value indicating the rotation of the image, degrees clockwise from North. | | tie_point_pixel | False | A two-element double-precision array with the pixel coordinates of the tie point. If you do not set this key. DEFAULT: [0,0] | | tie_point_map | True | A two-element double-precision array with the map coordinates of the tie_point_pixel location. Must be in the same units as the coordinate system. | [block:callout] { "type": "info", "title": "The coord_sys_code and coord_sys_string keys are mutually exclusive." } [/block] ### Description This input port uses a string JSON object and its attributes to describe a standard raster spatial reference. The following is an example: [block:code] { "codes": [ { "code": "...\ntask.inputs.input_ = '''{\n \"factory\": \"StandardRasterSpatialRef\",\n \"coord_sys_code\": [1.0, 1.0, -117.07201, 32.893801],\n \"pixel_size\": [9.186, 9.186],\n \"tie_point_pixel\": [0.0, 0.0],\n \"tie_point_map\": [3075299.7946,1246937.9905],\n}'''\n...", "language": "python" } ] } [/block] ## ENVIRPCRasterSpatialRef Harris Documentation Reference: http://www.harrisgeospatial.com/docs/envirpcrasterspatialref.html ### Input Attributes | Attribute Name | Required | Description | | -------------------- | -------- | ---------------------------------------- | | *factory* | True | Sting value of `RPCRasterSpatialRef` | | *rpc_offsets* | True | A five-element, double-precision array that specifies the *Line_Offset*, *Sample_Offset*, *Latitude_Offset*, *Longitude_Offset*, and *Height_Offset* values | | *rpc_scales* | True | A five-element, double-precision array that specifies the *Line_Scale*, *Sample_Scale*, *Latitude_Scale*, *Longitude_Scale*, and *Height_Scale* values. | | *rpc_line_num_coeff* | True | A 20-element, double-precision array of RPC line numerator coefficients. | | *rpc_line_den_coeff* | True | A 20-element, double-precision array of RPC line denominator coefficients. | | *rpc_samp_num_coeff* | True | A 20-element, double-precision array of RPC sample numerator coefficients. | | *rpc_samp_den_coeff* | True | A 20-element, double-precision array of RPC sample denominator coefficients. | ### Description This input port uses a string JSON object and its attributes to describe a RPC raster spatial reference. The following is an example: [block:code] { "codes": [ { "code": "...\ntask.inputs.input_ = '''{\n \"factory\": \"StandardRasterSpatialRef\",\n \"coord_sys_code\": [1.0, 1.0, -117.07201, 32.893801],\n \"pixel_size\": [9.186, 9.186],\n \"tie_point_pixel\": [0.0, 0.0],\n \"tie_point_map\": [3075299.7946,1246937.9905],\n}'''\n...", "language": "python" } ] } [/block] ## ENVIGeoJson Harris Documentation Reference: https://harrisgeospatial.com/docs/envigeojson.html Harris ENVIGeoJSONToROITask Documentation Reference: https://harrisgeospatial.com/docs/envigeojsontoroitask.html ### Description This input port supports valid GeoJSON, and will accept the GeoJSON as a string. A detailed example can be seen on the above-referenced Harris documentation for `ENVIGeoJSONToROITask`. There are some constraints on the contents of the GeoJSON: - ENVI currently supports GeometryCollection type objects. These objects can only contain one or more MultiPolygon type geometries. - The crs tag is not required. If the code contains this tag, ENVI converts it to a string. Otherwise, it uses a default value of wgs84. - You can add name and color properties to each MultiPolygon object. For example: [block:code] { "codes": [ { "code": "...\ntask = gbdx.Task(\"ENVI_GeoJSONToROI\")\ntask.inputs.input_geojson = ''' {\n \"type\": \"GeometryCollection\",\n \"geometries\": [\n {\"type\": \"MultiPolygon\",\n ...\n} # See the Harris code example for more details.\n'''\n...", "language": "python" } ] } [/block]