Ellipsis Drive
  • πŸ‘‹Welcome to Ellipsis Drive!
  • Getting Started
    • ⚑Quick Start!
      • 1. Sign up for Ellipsis Drive
      • 2. Creating Vector Layers
      • 3. Creating Raster Layers
      • 4. Creating Point Cloud Layers
      • 5. Data sharing and user access
      • 6. Map building
    • 🏒Set up your organisation
    • πŸ‘₯User Types
      • πŸ”ŽData Scientists
      • πŸ–₯️Developers
      • 🌐GIS professionals
      • πŸ—ΊοΈNon-technical users
    • Capabilities table
    • πŸ“šGlossary
    • πŸ“„Metadata
  • Advanced Usage
  • 🌍Working With Vector Data
    • πŸ–ŒοΈVector styling methods
    • β˜‘οΈFilter vector data
    • πŸ”ŽInspect vector data
    • ✏️Edit vector data
  • 🌏Working With Raster Data
    • πŸ“ˆCreating time series with raster data
    • πŸ–ŒοΈRaster styling methods
    • πŸ”ŽAnalyse raster data
  • πŸš€Sharing & Collaboration
    • πŸ“‚Sharing Folders & Layers
    • πŸ’²Subscriptions on spatial data
    • πŸ“€Transferring spatial data
  • πŸ’‘Good to know
    • 🌍Adding third party layer
    • ⬇️Downloading data
    • ⏳Processing Units
    • 🌏How to change the host location
    • πŸ”Marketplace vs Reseller vs Ellipsis Drive
  • Integrate & automate
    • πŸ”—Integration options
      • πŸ’»Use Ellipsis Drive viewer as embedded window
      • Creating (signed) viewer url's
      • πŸ—ΊοΈDisplay Ellipsis Drive layers in your app
      • πŸ’ΎUse Ellipsis Drive layers in third party software
      • πŸ“‰Query layers from your app
      • πŸ“‚Use Ellipsis Drive to ingest client data
      • πŸ”—Connect Ellipsis Drive to your platform
      • πŸ“ŠPerform analytics on Ellipsis Drive layers
      • 🌐Publish your outputs as Ellipsis Drive layers
    • βš™οΈAPI v3
      • Account
        • Create new account
        • Get account details
        • Login to your account
        • Edit profile
        • Update username
        • Delete account
        • Get transactions
        • List root folders
        • Get user history
        • Change your subscription
        • Change your default storage location
        • Add billing information to your account
        • Security
          • Update email
          • Validate email
          • Update password
          • Reset password
          • Validate password
        • Access tokens
          • Create access token
          • Get your access tokens
          • Delete access token
        • External Layer
          • Add external layer
          • Delete external layer
          • Retrieve external layer
      • Users
        • Search users
        • Get user
        • Invite user
        • Contact user
      • Path
        • Get path
        • Search path
        • Move path
        • Rename path
        • Trash or recover a path
        • Hard delete path
        • Edit path public access
        • Edit path metadata
        • Favorite path
        • White list domains
        • Request access
        • Update hosting location
        • Export for download
          • Export layer or folder
          • Get exports
          • Download an export
        • Hashtags
          • Add hastag
          • Remove hashtag
          • Search for hashtag
        • Invites
          • Invite user to path
          • Revoke Invite
          • Accept invite
          • Get your invites
          • Get path invites
        • Path members
          • Get list of members
          • Remove member
          • Edit member
        • Path subscription plans
          • Add subscription plan
          • Get subscription plans
          • Delete Subscription
          • Subscribe to a path
        • Path Usage
          • Path active users
          • Path usage of user
          • Path aggregated processing units
        • Transfer ownership of path
          • Create transfer
          • Revoke transfer Invite
          • Get transfer invites
          • Accept/Reject transfer invite
      • Path/folder
        • Create new folder
        • List folder
        • Traverse folder
      • Path/vector
        • Create new vector layer
        • Timestamps
          • Add timestamp
          • Edit timestamp
          • Trash timestamp
          • Hard delete timestamp
          • Get timestamp bounds
          • Get feature changelog
          • Find features by ids
          • Search feature by extent
          • Search features by tiles
          • Get the compressed features list
          • List features
          • Location information
          • Vector Features
            • Add feature
            • Edit the features
            • Delete feature
            • Feature Versions
            • Feature Messages
              • Get messages on a feature
              • Get message image
              • Add message to a feature
              • Delete message
            • Feature Time Series
              • Get series
              • Get series info
              • Add series
              • Delete series
              • Series Changelog
          • Upload vector data
            • Upload vector file
            • Get uploads
            • Revert the upload
            • Delete failed upload
            • Download file
          • Export vector data
            • Export vector data
            • Get exports
            • Download an export
        • Styles
          • Add style
          • Edit Style
          • Delete Style
        • Vector Layer Properties
          • Add vector property
          • Delete vector property
          • Edit vector properties
        • Vector layer projections
          • Add a projection
          • Remove a projection
        • Edit filter
        • Edit saved data
      • Path/raster
        • Create new raster
        • Timestamps
          • Tile service
          • Stack rasters
          • Get raster
          • Analyse raster data
          • Location information
          • Add timestamp
          • Edit timestamp
          • Get timestamp bounds
          • Activate timestamp
          • Deactivate timestamp
          • Delete timestamp
          • Trash timestamp
          • Upload Raster
            • Upload raster file
            • Get uploads
            • Delete upload
            • Trash upload
            • Download file
          • Export raster data for download
            • Export raster data for download
            • Get exports
            • Download export
        • Styles
          • Add style
          • Edit style
          • Delete style
        • Edit Raster
        • Edit raster band
        • Raster layer projections
          • Add a projection
          • Remove a projection
      • Path/pointCloud
        • Create new point cloud
        • Timestamps
          • 3D tiles
          • Add timestamp
          • Edit timestamp
          • Get timestamp bounds
          • Activate timestamp
          • Deactivate timestamp
          • Delete timestamp
          • Trash timestamp
          • Point cloud uploads
            • Upload point cloud file
            • Get uploads
            • Delete upload
            • Trash upload
            • Download file
          • Export point cloud for download
            • Export point cloud data
            • Get exports
            • Download export
      • Path/file
        • Create new file
        • Download file
      • Path/bookmark
        • Create new bookmark
        • Fetch bookmark details
        • Update bookmark details
      • Path/setUpTasks
        • Add task
        • Get tasks
      • Path/process
        • Create new process
        • Update a process
        • Execute a process
        • Fetch your process jobs
        • Fetch proces jobs of a path
      • OGC Protocols
        • WMTS
        • OGC API - Features
        • TMS/XYZ
        • WMS
        • Processes API (INFORMATION FACTORY INSTANCE ONLY)
          • Landing
          • Conformance
          • Process list
          • Execute a process
          • Get job status
          • Get job results
        • WCS
        • STAC
          • Landing
          • Root Catalog
          • Folder Catalog
          • Layer Collection
          • Timestamp Item
          • Search
        • Terrain RGB
        • MVT
        • WFS
        • 3D tiles
      • Fast read
        • Vector data
        • Raster data
      • OAuth
        • Authorization
        • Authorization code variant
        • Refresh token variant
      • Ellipsis Drive Pricing
        • Public pricing
        • User pricing
      • Ellipsis Drive locations
        • Get locations
      • Top Up
    • πŸ”ŒPlugins & Packages
    • πŸ”Authentication Options
    • Backwards compatibility
      • Add vector style
      • Add raster style
  • Extra
    • πŸ›‘οΈCertification & Compliance
    • ❓Troubleshoot Issues
      • Failing to upload features with properties of type object or array
      • My raster data does not look good on low zoomlevel
      • Connecting webservice to QGIS and ArcGIS
      • Why don't all features show on every zoom level?
      • Failing to upload a .csv
      • Trouble with EPSG or CRS
      • Failing to upload a Shape file
      • Fix Visualisation Transparency
    • Creating a process
  • PRIVATE DEPLOYMENT
    • ℹ️Introduction
    • πŸ“ƒOverview
    • πŸ› οΈDeployment
      • πŸ”ŒIntegration with existing storage
      • πŸ’½Recommended hardware
      • πŸ“ˆManaging your instance
      • ♻️Backup and recovery
      • πŸ”Security and Compliance
      • ☁️Supported clouds
Powered by GitBook
On this page
  • Access Level Rules
  • Processing Units
  • Parameters

Was this helpful?

  1. Integrate & automate
  2. API v3
  3. Path/vector
  4. Styles

Add style

Description

Adds a vector style.

Endpoint

/path/{pathId}/vector/style

Method

POST

Access Level Rules

Minimum Access Level

edit+

Processing Units

Minimum processing units

2

Parameters

Name
Description
Required
Default

pathId

The id of the vector layer.

true

name

The name of the style to add.

true

parameters

The parameters for the style. See details below.

true

description

A description of the style as string.

false

Default null.

The parameters should have the following form:

{    //required
    "alphaMultiplier": 1,//A float between 0 and 1
    "radius":numberMapping, //A mapping that assigns a float
    "width":numberMapping, //A mapping that assigns a float
    "fill": colorMapping/iconMapping/patternMapping , //A mapping that assigns a hex color, pattern or icon
    //optional
    "popOver":{"color": colorMapping, "text":stringMapping}, //A mapping that assigns a string    
    "dashedLine":[number, number], //An array containing 2 numbers
    "borderColor":colorMapping, //A mapping that assigns a hex color
    "elevation":numberMapping, //A mapping that assings a value
}

Aside from the alphaMultiplier which should be a float, all properties in the parameters should be mappings. These mappings should be objects. There is a couple of mapping types you can use. All of these types are listed in the table below.

A mapping outputs a specific target based on the rules of the mapping in question. Targets can be of type string, number, color pattern or string. See below for documentation on how to define targets.

//Sent an expression to a seeded random color, this mapping can only be used to assign hex colors
{
    "type": "seededRandom", //should be seededRandom
    "expressionObject": {"expression":"2*property1+1", "properties":["myProperty"]} , //An expression to use as seed to create a random hex color
}
//Assign a target based on conditions 
{
    "type": "caseMap", //must be caseMap
    "defaultTarget":target //A target object of type color, number, pattern or icon. See documentation below
    "caseMap": [
            {
                "expressionObject": {"expression":"property1<0", "properties":["myProperty"]} , //An expression to evaluate
                "target": target //A target object of type color, number, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            },
            {
                "expressionObject": {"expression":"property1==1", "properties":["myProperty"]} , //An expression to evaluate
                "target": target //A target object of type color, number, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            },
            {
                "expressionObject": {"expression":"property1>2", "properties":["myProperty"]} , //An expression to evaluate
                "target": target //A target object of type color, number, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            }
        ],
}
//Assign a target based on ranges of an expression . 
{
    "type": "rangeMap", //must be rangeMap
    "gradient":true, //Boolean indicating whether to apply a gradient to the mapping
    "expressionObject":{"expression":"2*property1+1", "properties":["myProperty"]}, //expression which outcome to apply the rangeMap to
    "defaultTarget":target, //A target object of type color, number, pattern or icon. See documentation below
    "rangeMap": [
            {
                "value": 1 , //Start of the range
                "target": target //A target object of type color, number, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            },
            {
                "value": 2 , //Start of the range
                "target": target //A target object of type color, number, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            },
            {
                "value": 3 , //Start of the range
                "target": target //A target object of type color, number, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            }
        ],
}

//Assign a target based on values of an expression.
{
    "type": "valueMap", //must be valueMap
    "expressionObject":{"expression":"property1", "properties":["myProperty"]}, //expression which outcome to apply the valueMap to
    "defaultTarget":target, //A target object of type color, number, pattern or icon. See documentation below
    "valueMap": [
            {
                "value": 1 , //Value to map
                "target": target //A target object of type color, float, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            },
            {
                "value": 2 , //Value to map
                "target": target //A target object of type color, float, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            },
            {
                "value": 3 , //Value to map
                "target": target //A target object of type color, float, pattern or icon. See documentation below
                "label":"label" //An optional label to use in the legend
            }
        ],
}
//Always assign the same target.
{
    "type": "constant", //must be constant
    "target":target, //A target object of type color, number, pattern, icon or string. See documentation below
}
// Assing the expression as a target
{
    "type":"expression",
    "defaultTarget":target, //A target object of type color, number, pattern, icon or string. See documentation below
    "expressionObject":{properties:["myProperty"], "expression":"2*property1+1"}
}

Expressions

Mappings can use expressions. An expressionObject is an object that consists of a properties and an expression.

expressionObject = {"expression":expression, "properties":properties, "values":values,

The properties should be an array of strings. Each element in the array should be the name of a property of the features within the layer that you are styling.

For example if your layer contains features with properties "constructionMaterial", "Height", and "housingType" then your properties array can be:

properties = ["housingType", "constructionMaterial","Height"]

The values should be an array of strings. Each element in the array should be any string value you want to use in the expression.

For example if your layer contains features with properties "constructionMaterial", "Height", and "housingType" then your values array can be:

values = ["flat", "concrete"]

The expression should be a string that can be interpreted as a formula or logical expression outputting either a number or boolean.

You can use the values of the properties array by referencing them as "property1", "property2",... and the values as "value1", "value2"...

For example:

expression="property1==value1 && property3>5"

Here property1 refers to the first element in the properties array which is in this case "housingType", the second to "Height" and value1 refers to the string "flat". That is to say the expression results in true for all features with housing type "flat" and altitude higher than 3 and false otherwise.

The expression can contain standard operators such as:

*,+,-,/, round(_), floor(_), ceil(_),),(

and logical operators such as:

&&, ||, not, ==,<=,<,>,>=,!=

An expressionObject can simply assign the value of a property:

expressionObject = {"expression":"property1", "properties":["housingType"]:, "values": []}

Or an expression can also simply be a number:

expressionObject={"expression":"1", "properties":[], "values": []}

Or boolean:

expressionObject ={"expression":"true", "properties":[], "values": []}

An expression can also be used to apply more complicated logic. For example finding the population density based on the properties "surfaceArea" and "population":

expressionObject = {"expression:"property2/property1", "properties":["surfaceArea", "population"], "values": []}

We can also make a more complicated logical expression:

expressionObject = {"expression":"property2!= 2 and property1 > 5", "properties":["surfaceArea", "population"], "values": []}

Target

A target is an object that can be of type color, pattern, icon, number or string. It signifies the value that is being assigned by the mapping.

In case of a colorMapping the target should be of type color, in case of a patternMapping of type pattern etc.

target = {type:"color/pattern/icon/number", "color":null, "pattern":null, "icon":null, "number":null}

Type color

In case of type color the target needs to contain a hex color:

target = {"type":"color", "color":"#99f53f"}

Type number

In case of type number the target needs to contain a number:

target = {"type":"number", "number":3.2}

Type string

In case of type string the target needs to contain a string:

target = {"type":"number", "string":"hello"}

type pattern

In case of type pattern the target must contain a pattern

target = {"type":"pattern", "pattern":pattern}

A pattern must be an object with:

  • type: One of solid, diagonal, horizontal or vertical

  • width: a float between 1 and 50

  • backgroundColor: a hex color, optional.

Example:

pattern = {"type":"diagonal", "width": 2, "color":"#f34f14", "backgroundColor":"#934314"}

Alternatively the pattern can be an object of type drive. In this case you need to include a pathId of a png that is stored on the Drive.

Example:

pattern = {"type":"drive", "pathId":"4d695990-ace7-434e-b703-e1d5ae006800"}

In this case the png will be used as pattern.

In case of type icon the target must contain an icon

target = {"type":"icon", "icon":icon}

Type icon

An icon must be an object with

  • type: must be the string 'predefined'

  • name: the name of the icon as a string. All allowed values can be found using GET /images/listIcons.

  • color: a hex color

Example:

icon = {"name":"dog", "type":"predefined", "color":"#f34f14"}

Alternatively the icon can be an object of type drive. In this case you need to include a pathId of a png that is stored in Ellipsis Drive.

Example:

pattern = {"type":"drive", "pathId":"4d695990-ace7-434e-b703-e1d5ae006800"}

In this case the png will be used as icon.

RECOMMENDED READING

PreviousStylesNextEdit Style

Last updated 2 months ago

Was this helpful?

βš™οΈ
πŸ–ŒοΈRaster styling methods