GIS commands

GIS commands

GISGetFeaturesByLayer

Get the list of features for a layer. This should probably only be used with the default app layer.

Input

layerref

number

The ID of a layer, usually -1 for 'default app layer'

modcode

string

Only get features from this module (eg. “todo” for tasks)

sysref

number

Only get features for this object (used together with modcode), eg. the ID of a task

datatype

string

Only get this type of features, usually not set

Output

features

collection[ feature ]

A collection of features.

If layerref is set to -1 then modcode+sysref should be set.

GISGetCustomBaseLayers

Get the list of base layers (background maps and WMS layers).

Input

changedate

date

Only get baselayers that were changed after this date

changetime

time

Only get baselayers that were changed after this time

Output

layers

collection[ baselayer ]

A collection of baselayers

GISCreateUpdateFeatures

Create or update features in a GIS layer.

Input

features

collection[ feature ]

A collection of features to create/update

Output

None

-

-

Notice that when reading the features (using e.g. GISGetFeaturesByLayer) the returned features do not include details about the layer ID, but when writing the features (using e.g. GISCreateUpdateFeatures) each feature should include the layer ID in the layerref field. If you specify the layer with ID = -1 the default app layer will be used; if the default app layer doesn't exist it will be created.

Map features

See the feature object for more details about the feature object.

Feature types: 1=point, 2=points, 3=text, 11=line, 12=polyline, 21=rectangle, 22=shape, 23=circle, 100=group.

Feature type 1 - point/marker

The data field is a set containing the following name/value pairs:

name

value type

description

name

value type

description

x

float

longitude

y

float

latitude

marker

string

name of the marker to use, may be ignored

text

string

Text to display

The point/marker will be displayed with a suitable icon/marker and the text from the text field in the feature.

Feature type 12 - polyline/freehand

The data field is a set containing the following name/value pairs:

name

value type

description

name

value type

description

points

collection[xy]

a collection of sets, each containing x and y

subtype

string

either “freehand” or “polyline”

A polyline or freehand line is a set of points that is displayed connected by a line.

In the app the polyline is created by clicking on the screen once for each point. A freehand line is created by dragging - the app then adds a point a regular intervals.

colour1 is used for the colour of the circle. size is used for the linewidth (in pixels) of the circle.

Feature type 22 - shape

The data field is a set containing the following name/value pairs:

name

value type

description

name

value type

description

points

collection[xy]

a collection of sets, each containing x and y

colour1 is used for the line colour of the shape. colour2 is used for the fill colour. size is used for the linewidth (in pixels) of the shape.

JSON encoded example:

{"layerref":83, "datatype":22, "data":{"points":[{"x":27,"y":55},{"x":27.5,"y":55},{"x":27,"y":55.5}]}, "colour1":"#ff00ff", "size":2}

Feature type 23 - circle

The data field is a set containing the following name/value pairs:

name

value type

description

name

value type

description

x

float

longitude

y

float

latitude

r

float

radius in degrees, eg. x=55 and r=1 means that the circle covers from x=54 to x=56.

colour1 is used for the colour of the circle. size is used for the linewidth (in pixels) of the circle.