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. This operation is asynchronous.

Only 10 internal custom map layers are allowed for an Oracle Field Service environment. 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 environment. Oracle Field Service 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 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 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 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.
  • Plugin or form map layer hint button
    Title: Plugin or form map layer hint button
    The object representing selected Custom Form or Plugin will be displayed as a button on layer hint. Parameters specified in Plugin/Form Field will be sent to the selected Custom Form or Plugin.
  • 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. Supported protocols: HTTPS only.
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 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 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 downloads the geo-data without any authentication.
Show Source
  • Title: Password
    The password used to authenticate the connection between Oracle Field Service 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 and the external source.
Nested Schema : Plugin or form map layer hint button
Type: object
Title: Plugin or form map layer hint button
The object representing selected Custom Form or Plugin will be displayed as a button on layer hint. Parameters specified in Plugin/Form Field will be sent to the selected Custom Form or Plugin.
Show Source
  • Title: PluginForm Type
    Allowed Values: [ "plugin", "form" ]
    The type of plugin or form the activity hint button on map layer.
  • Title: Label for plugin or form
    Minimum Length: 1
    Maximum Length: 64
    The label plugin or form for map layer hint.
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
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
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