Populate a custom map layer

post

/rest/ofscMetadata/v1/mapLayers/custom-actions/populateLayers

This operation creates a shapefile and converts it into a map layer in Oracle Field Service Cloud. This operation is asynchronous.

Only 10 internal custom map layers are allowed for an Oracle Field Service Cloud instance. Therefore only 10 different labels are allowed in a request to create a map layer.

A shapefile (zip archive) is limited to 2 GB. Not all the information in the zip archive is imported and therefore the maximum amount of data stored as Internal Custom Map Layers is limited to 1 GB per Oracle Field Service Cloud instance. Oracle Field Service Cloud downloads the shapefile from the specified url in the background. You should verify the status of shapefile download and creation using the 'Check custom map layer population status' api.

Request

Body ()
The request body object used for populating a custom map layer.
Root Schema : Populate Layers Request
Type: object
Title: Populate Layers Request
The schema of the request body object for this operation.
Show Source
  • Authentication
    Title: Authentication

    The authentication used for downloading the geo-data from the external source specified in the URL field.

    • If the URL points to an HTTP service, and the type of the authentication specified is 'basic', then Oracle Field Service Cloud sends a request to this URL to authenticate using the HTTP-Basic scheme with the username and password as credentials.
    • If the URL points to an FTP service, and the type of the authentication specified is 'ftp', then Oracle Field Service Cloud connects via the FTP protocol using the username and password as credentials.
    • If the type of the authentication specified is 'none', then Oracle Field Service Cloud downloads the geo-data without any authentication.
  • Title: Layer Label
    Minimum Length: 1
    Maximum Length: 24
    Pattern: ^[A-Za-z0-9_]+$
    The unique identifier of the layer.
  • Shape Hint Columns
    Title: Shape Hint Columns
    The set of objects that define the contents of the hint for the shapes on the map.
  • Title: Shape Title Column
    Minimum Length: 1
    Maximum Length: 255
    The name of the non-spatial column that contains the titles of the shapes that are displayed on the map.
  • Title: SRID
    The spatial reference identifier (SRID) of the geo-data in the shape file.
  • Title: URL
    Minimum Length: 1
    Maximum Length: 255
    The URL of the external source from which the geo-data is downloaded.
Nested Schema : Authentication
Type: object
Title: Authentication

The authentication used for downloading the geo-data from the external source specified in the URL field.

  • If the URL points to an HTTP service, and the type of the authentication specified is 'basic', then Oracle Field Service Cloud sends a request to this URL to authenticate using the HTTP-Basic scheme with the username and password as credentials.
  • If the URL points to an FTP service, and the type of the authentication specified is 'ftp', then Oracle Field Service Cloud connects via the FTP protocol using the username and password as credentials.
  • If the type of the authentication specified is 'none', then Oracle Field Service Cloud downloads the geo-data without any authentication.
Show Source
  • Title: Password
    The password used to authenticate the connection between Oracle Field Service Cloud and the external source.
  • Title: Type
    Allowed Values: [ "basic", "ftp", "none" ]
    The type of the authentication. The allowed values are 'none', 'basic', and 'ftp'.
  • Title: Username
    The username used to authenticate the connection between Oracle Field Service Cloud and the external source.
Nested Schema : Shape Hint Columns
Type: array
Title: Shape Hint Columns
The set of objects that define the contents of the hint for the shapes on the map.
Show Source
Nested Schema : items
Type: object
Show Source
  • Title: Default Column Name
    The unique name of the shapefile column.
  • Title: Source Column Name
    The unique name of the source column in the user's language. The name specified in this parameter is displayed as a hint.
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Populate Layers Response
Type: object
Title: Populate Layers Response
The schema of the response body object for this operation.
Show Source

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Error response
Show Source
Back to Top

Examples

The following example shows how to create a shapefile and convert it into a map layer in Oracle Field Service Cloud by submitting a POST request on the REST resource using cURL.

Example of Request Header

The following shows an example of the request header.

POST /rest/ofscMetadata/v1/mapLayers/custom-actions/populateLayers/

Example of Request Body

The following example shows the contents of the request body in JSON format.

{
    "URL": "https://www.example.com/workzones/shapes/sip/fileData.zip",
    "authentication" : 
    {
        "type" : "basic",       
        "username": "<CLIENT-ID>@<INSTANCE-NAME>",    
        "password": "<CLIENT-SECRET>"       
    },
    "layerLabel": "AIRPORTS",   
    "SRID": 4269,               
    "shapeTitleColumn": "IATA", 
    "shapeHintColumns": 
  [       
      {
        "sourceColumn": "NAME", 
        "defaultName":  "Name"  
      },
      {
        "sourceColumn": "ICAO",
        "defaultName":  "ICAO Code"
      },
      {
        "sourceColumn": "COUNTRY",
        "defaultName":  "Country"
      },
      {
        "sourceColumn": "CITY",
        "defaultName":  "City"
      },
      {
        "sourceColumn": "ALTITUDE",
        "defaultName":  "Altitude (ft)"
      },
      {
        "sourceColumn": "TZNAME",
        "defaultName":  "Time Zone"
      }
  ]
}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK

Example of Response Body

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

{
    "downloadID":5a93c598f92621321d4fd257bf0da6d6,  
    "status":"pending",                             
    "time": "2016-01-05 12:58:54"                   
}
Back to Top