Skip to content

Commit

Permalink
First pass at v1 docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMountain committed Nov 10, 2015
1 parent 3dbcecb commit fc7a04d
Showing 1 changed file with 126 additions and 17 deletions.
143 changes: 126 additions & 17 deletions composed_api.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GRiD API
GRiD API v1
========

API Endpoint Reference
Expand Down Expand Up @@ -110,7 +110,7 @@ Endpoint

.. code:: bash
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/aoi
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/aoi
Request Parameters
^^^^^^^^^^^^^^^^^^
Expand All @@ -120,6 +120,8 @@ Request Parameters
+===================+==========================================================+
| geom | *Optional*. A WKT geometry used to filter AOI results. |
+-------------------+----------------------------------------------------------+
| source | *Required*. Your API key. |
+-------------------+----------------------------------------------------------+

Response Format
^^^^^^^^^^^^^^^
Expand All @@ -133,7 +135,7 @@ Example

.. code:: bash
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/export/?geom=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/export/?source=grid&geom=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))
.. code:: json
Expand Down Expand Up @@ -171,7 +173,7 @@ Endpoint

.. code:: bash
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/aoi/{pk}
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/aoi/{pk}
Request Parameters
^^^^^^^^^^^^^^^^^^
Expand All @@ -182,6 +184,12 @@ Request Parameters
| pk | The primary key for the AOI. |
+------------------+--------------------------------+

+-------------------+-------------------------------------------------------+
| Query parameter | Value |
+===================+=======================================================+
| source | *Required*. Your API key. |
+-------------------+-------------------------------------------------------+

Response Format
^^^^^^^^^^^^^^^

Expand All @@ -194,7 +202,7 @@ Example

.. code:: bash
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/aoi/1959
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/aoi/1959?source=grid
.. code:: json
Expand Down Expand Up @@ -260,7 +268,7 @@ Endpoint

.. code:: bash
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/aoi/add
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/aoi/add
Request Parameters
^^^^^^^^^^^^^^^^^^
Expand All @@ -272,6 +280,8 @@ Request Parameters
+-------------------+-------------------------------------------------------+
| geom | *Required*. A WKT geometry describing the AOI. |
+-------------------+-------------------------------------------------------+
| source | *Required*. Your API key. |
+-------------------+-------------------------------------------------------+
| subscribe | *Optional*. True, False, T, F, 1, 0. Default: false |
+-------------------+-------------------------------------------------------+

Expand All @@ -287,7 +297,7 @@ Example

.. code:: bash
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/aoi/add/?name=test&geom=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))&subscribe=True
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/aoi/add/?source=grid&name=test&geom=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))&subscribe=True
.. code:: json
Expand All @@ -313,7 +323,7 @@ Endpoint

.. code:: bash
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/export/{pk}
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/export/{pk}
Request Parameters
^^^^^^^^^^^^^^^^^^
Expand All @@ -324,6 +334,12 @@ Request Parameters
| pk | The primary key for the export. |
+------------------+-----------------------------------+

+-------------------+-----------------------------------+
| Query parameter | Value |
+===================+===================================+
| source | *Required*. Your API key. |
+-------------------+-----------------------------------+

Response Format
^^^^^^^^^^^^^^^

Expand All @@ -336,7 +352,7 @@ Example

.. code:: bash
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/export/3124
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/export/3124?source=grid
.. code:: json
Expand Down Expand Up @@ -379,7 +395,7 @@ Endpoint

.. code:: bash
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/geoname
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/geoname
Request Parameters
^^^^^^^^^^^^^^^^^^
Expand All @@ -389,6 +405,8 @@ Request Parameters
+===================+==================================================+
| geom | *Required*. A WKT geometry describing the AOI. |
+-------------------+--------------------------------------------------+
| source | *Required*. Your API key. |
+-------------------+--------------------------------------------------+

Response Format
^^^^^^^^^^^^^^^
Expand All @@ -402,7 +420,7 @@ Example

.. code:: bash
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/geoname/?geom=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/geoname/?source=grid&geom=POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))
.. code:: json
Expand All @@ -414,24 +432,30 @@ Example
Get Task Details
~~~~~~~~~~~~~~~~

Get task status/details for the provided task\_id.
Get task status/details for the provided task_id.

Endpoint
^^^^^^^^

.. code:: bash
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/task/{task_id}
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/task/{task_id}
Request Parameters
^^^^^^^^^^^^^^^^^^

+------------------+-----------------------+
| Path parameter | Value |
+==================+=======================+
| task\_id | The ID of the task. |
| task_id | The ID of the task. |
+------------------+-----------------------+

+-------------------+-----------------------------------+
| Query parameter | Value |
+===================+===================================+
| source | *Required*. Your API key. |
+-------------------+-----------------------------------+

Response Format
^^^^^^^^^^^^^^^

Expand All @@ -444,7 +468,7 @@ Example

.. code:: bash
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/task/bacb736e-e900-457c-9b24-fd409bc3019d/
curl -u <username> http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/task/bacb736e-e900-457c-9b24-fd409bc3019d/?source=grid
.. code:: json
Expand All @@ -467,7 +491,7 @@ Endpoint

.. code:: bash
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v0/aoi/{pk}/generate/pointcloud
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/aoi/{pk}/generate/pointcloud
Request Parameters
^^^^^^^^^^^^^^^^^^
Expand All @@ -478,7 +502,92 @@ Request Parameters
| pk | The primary key of the AOI. |
+------------------+-------------------------------+

+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| Query parameter | Value |
+=========================+===========================================================================================================================================+
| source | *Required*. Your API key. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| collects | *Required*. A list of collection primary keys to include in the export, separated by ``+`` or ``,``. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| hsrs | *Optional*. Accepts an EPSG code. Defaults to AOI SRS. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| intensity | *Optional*. Whether or not to export intensity. Default: True. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| dim\_classification | *Optional*. Whether or not to export classification. Default: True. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| file\_export\_options | *Optional*. Determine file merging strategy. Accepts ``individual``, ``collect``, and ``super``. Default: ``individual``. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| compressed | *Optional*. Whether or not to export compressed data. Default: True. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| send\_email | *Optional*. Whether or not to notify user via email upon completion. Default: False. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| generate\_dem | *Optional*. Whether or not to generate a DEM from the export. Default: False. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| cell\_spacing | *Optional*. Used together with ``generate_dem``. Default: 1.0. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| pcl\_terrain | *Optional*. Used to trigger a PMF Bare Earth export. Accepts ``urban``, ``suburban``, ``mountainous``, and ``foliated``. Default: None. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| sri\_hres | *Optional* Used to trigger a Sarnoff Bare Earth export. Accepts the horizontal resolutions. Default: None. |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+

Response Format
^^^^^^^^^^^^^^^

On success, the HTTP status code in the header response is ``200`` OK
and the response body contains a `Generate export
object <#generate-export-object>`__ in JSON format.

Example
^^^^^^^

.. code:: bash
curl -u <username> http://gridte.rsgis.erdc.dren.mil/api/v1/aoi/2389/generate/pointcloud/?source=grid&collects=100+102
.. code:: json
{
"started" : true,
"task_id" : "774b4666-5706-4237-8661-df0f96cd7b9c"
}
Generate Raster Export
~~~~~~~~~~~~~~~~~~~~~~

Generate raster export for the given AOI primary key and collect primary
keys.

Endpoint
^^^^^^^^

.. code:: bash
GET http://gridte.rsgis.erdc.dren.mil/te_ba/api/v1/aoi/{pk}/generate/raster
Request Parameters
^^^^^^^^^^^^^^^^^^

+------------------+-------------------------------+
| Path parameter | Value |
+==================+===============================+
| pk | The primary key of the AOI. |
+------------------+-------------------------------+

+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| Query parameter | Value |
+=========================+=================================================================================================================+
| source | *Required*. Your API key. |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| collects | *Required*. A list of collection primary keys to include in the export, separated by ``+`` or ``,``. |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| hsrs | *Optional*. Accepts an EPSG code. Defaults to AOI SRS. |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| file\_export\_options | *Optional*. Determine file merging strategy. Accepts ``individual`` and ``collect``. Default: ``individual``. |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| compressed | *Optional*. Whether or not to export compressed data. Default: True. |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| send\_email | *Optional*. Whether or not to notify user via email upon completion. Default: False. |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+

Response Format
^^^^^^^^^^^^^^^
Expand All @@ -492,7 +601,7 @@ Example

.. code:: bash
curl -u <username> http://gridte.rsgis.erdc.dren.mil/api/v0/aoi/2389/generate/pointcloud/?collects=100+102
curl -u <username> http://gridte.rsgis.erdc.dren.mil/api/v1/aoi/2389/generate/raster/?source=grid&collects=100+102&send_email=True&file_export_options=collect
.. code:: json
Expand Down

0 comments on commit fc7a04d

Please sign in to comment.