Process raster files previously upload to HDFS using spark

post

/spatialviewer/api/v1/raster/spark/operations/process

Request

Supported Media Types
Query Parameters
Body ()
Raster process object with all the required details and configuration to apply to the process.
Root Schema : RasterProcessOperationPayloadObject
Type: object
Show Source
  • Algorithm used to process multiple files to produce a result: 1 - Last Modified, 2 - Size, 3 - Resolution. Default value is 1.
    Example: 1
  • Indicates if the algorithm to process multiple files will be apply in ascedent or descendent order. If you specify another value different to true it will take the value of false by default.
    Example: true
  • Bands number of the output. Some formats only admit certain bands number.
    Example: 3
  • XML value string with the details of the source files involved in the process.
    Example: <?xml version='1.0'?><catalog type='HDFS'><image><source>Hadoop File System</source><type>HDFS</type><raster>/user/hdfs/upload/maui.tif.ohif</raster><url>http://system3.example.com:8080/spatialviewer/files/spatialworkspace/raster/thumbs/88f1f12fff7316308d22d69b8a7102f7217d3a28_thumb.jpg?time=1532973102684</url><bands datatype='1' config='1,2,3'>3</bands></image></catalog>
  • Name of the jar used to include custom user processing during the raster process operation.
    Example: external-analysis.jar
  • HDFS block size in megabytes, determines the size of the tiles created when loading a raster in HDFS. It is only required when you choose output to HDFS. This value will only be read when you choose the hadoop implementation, when the selected format allows the output to HDFS and if you choose HDFS as the output file system.
    Example: 128
  • Value used to reserve memory for the driver in megabytes. If you send this value for a hadoop process it will be ignored.
    Example: 2048
  • Value used to reserve memory for the executors in megabytes. If you send this value for a hadoop process it will be ignored.
    Example: 1024
  • Output file name. You must avoid invalid filenames following normal the rules that apply to file names in all systems.
    Example: defaultMosaic
  • Pixel Height for raster output (Pixel Y size).
    Example: -26.018635967483096
  • Geo rotation x. Not supported yet.
    Example: 0
  • Geo rotation y. Not supported yet.
    Example: 0
  • Pixel Width for raster output (Pixel X size).
    Example: 26.018635967483096
  • This is the upper left X point in the MBR defined for raster output.
    Example: 735199.991159022
  • This is the upper left Y point in the MBR defined for raster output.
    Example: 2329795.373044142
  • Height of the result.
    Example: 2068
  • String that contains an array with the objects that describe the details of the operations to add to the raster.
    Example: [{"name":"Local Not","id":"localNot","params":null}]
  • Hexadecimal value to fill the pixels with no data, # will be add in the server if not provided. Also this value must be accord to the selected pixel type of the output. If you do not provide this value a value with 0's will be used. If you do not provide the full value the value will be fill with 0's. The value have relation with the data type, value length must be two.
    Example: 0
  • "Output folder of the result. It could be a HDFS path or a normal filesystem path. If you choose output to HDFS you can not use ':' due a HDFS filesystem restrictions, all the invalid chars for paths apply for this value. The server could add the NFS mount point to save the result in HDFS."
    Example: /scratch/swap
  • Supported output format. You could check the supported formats using the gdal formats service including the format restrictions.
    Example: GTIFF
  • Indicates that the output will be HDFS or not. If you indicate another value different from true, default value will be used. By default is false. This value only works for hadoop implementation, it will produce a raster load to load the outcome to HDFS.
    Example: false
  • Data type of the pixels of the output. Valid values are: 1 - Byte, 2 - Unsigned Int 16 Bits, 3 - Int 16 Bits, 4 - Unsigned Int 32 Bits, 5 - Int 32 Bits, 6 - Float 32 Bits, 7 - Float 64 Bits.
    Example: 1
  • A string with an array of entry objects with that have the full name of the class as key and parameters as value (separated by commas). The full class names of the custom user implementations could be from the custom jar upload by the user or available in the Oracle raster api.
    Example: [{"oracle.spatial.raster.HillShade": "1,2,3"}]
  • Raster process type value, could be 0 for single raster processing, 1 for multiple rasters with same mbr or 2 for a normal mosaic.
    Example: 0
  • Output SRID of the raster process. Must be a number.
    Example: 26904
  • Width of the result.
    Example: 3200
Back to Top

Response

Supported Media Types

201 Response

raster process operation has been done successfully
Body ()
Root Schema : RasterProcessOperationFinishedSuccessfullyResponse
Type: object
Show Source
Nested Schema : response
Type: object
Object with the result details
Show Source
  • Informative message about the success response.
    Example: Raster process finished succesfully
  • URL of the original result.
    Example: http://system3.example.com:8080/spatialviewer/files/spatialworkspace/raster/temp/defaultMosaic.tif
  • URL of the generated thumbnail file which can be used to visualize the result in a web browser.
    Example: http://system3.example.com:8080/spatialviewer/files/spatialworkspace/raster/thumbs/41ae77fe360a3d5f4c418a9a21c678e22635f110_thumb.jpg

202 Response

raster process operations was schedule
Body ()
Root Schema : RasterOperationAcceptedResponse
Type: object
Show Source

406 Response

invalid parameters
Body ()
Root Schema : RasterOperationsInvalidParametersResponse
Type: object
Show Source

417 Response

job finished unsuccessfully
Body ()
Root Schema : RasterProcessSparkOperationUnsuccessResponse
Type: object
Show Source

500 Response

unknow error
Body ()
Root Schema : RasterErrorGenericResponse
Type: object
Show Source

503 Response

GDAL set up is incomplete
Body ()
Root Schema : GDALSetUpIsIncompleteResponse
Type: object
Show Source
Back to Top

Examples

Schedules a raster process job using spark to process the raster(s) files into hdfs and produce an output

The following example shows how to submit a raster process using spark as implementation by submitting a POST request on the REST resource using cURL.

curl -X POST "http://localhost:8045/spatialviewer/api/v1/raster/spark/operations/process?async=false" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"srid\":\"26904\",\"outputFolder\":\"/net/den01spo/scratch/swap/spatialviewer/\",\"filename\":\"defaultMosaic\",\"bands\":\"3\",\"outputSystem\":false,\"outputFormat\":\"GTIFF\",\"pixelType\":\"1\",\"width\":\"3200\",\"height\":\"2092\",\"algorithm\":\"1\",\"algorithmDescendent\":false,\"geoX\":\"738557.0997649715\",\"geoWidth\":\"6.118082558417227\",\"geoRotationX\":\"0.0\",\"geoY\":\"2280853.0201499914\",\"geoHeight\":\"-6.118082558417227\",\"geoRotationY\":\"0.0\",\"processType\":0,\"catalog\":\"
  
  
   
   Hadoop File System
   
    HDFS
   
   
    /user/hdfs/upload/kahoolawe.tif.ohif
   
   
    http://system3.example.com:8080/spatialviewer/files/spatialworkspace/raster/thumbs/e79e2fe7388a3a40dff3b22fa801a2939c92b226_thumb.jpg?time=1535141524167
   
   
    3
   
  \",\"noData\":\"#000000\",\"customJarName\":\"external-analysis.jar\",\"processClasses\":\"[]\",\"driverMemoryMB\":\"2048\",\"executorsMemoryMB\":\"1024\",\"multipleOperations\":\"[{\\\"name\\\":\\\"Local Not\\\",\\\"id\\\":\\\"localnot\\\",\\\"params\\\":null}]\"}"

Example of Response Header

Example of Response Header

HTTP/1.1 100 Continue HTTP/1.1 201 Created Date: Fri, 24 Aug 2018 20:27:54 GMT Content-Type: application/json Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, DELETE, PUT Access-Control-Allow-Headers: Content-Type, Accept Transfer-Encoding: chunked

Example of the Response Body

The following example shows the contents of the response body in JSON format

{ "status" : "success", "title" : "Raster process finished succesfully.", "o:successCode" : "SVR-00210", "response" : { "url_thumbnail" : "http://system3.example.com:8080/spatialviewer/files//spatialworkspace/raster/thumbs/efa0e3543d047e4227d24d97baa2321920c4e56a_thumb.jpg", "url_original" : "http://system3.example.com:8080/spatialviewer/files//spatialworkspace/raster/temp/defaultMosaic.tif", "message" : "Raster process finished succesfully" } }
Back to Top