Processes
The use of Processes and Process Operations have been substantially updated and are used extensively within the HTTP API to perform analysis and data manipulation.
Processes can be performed on single items, a group of items or an entire overlay.
They can be built into SIS Desktop for testing with user-defined Processes being stored in the Named Object Library.
Processes can be added as parameters (defined as JSON) after identifying the items which need to be included in the operation.
e.g. Process JSON for defining a buffer
{ "Operation": "Item.Buffer", "PropertyMap": { "_radius@": "1" } }
This needs to be added as a parameter:
GET http://CCL642.cadcorp.net:4444/geognosis/9/sessions/b2fe1626-7a87-44f9-87a1-f9496dc9a06f/Map/Overlays/2/items/I1/Geometry.geojson?process={"Operation":"Item.Buffer","PropertyMap":{"_radius@":500}}
Source Items
Be aware when running processes, the source is always left unchanged.
For example, if you run the following request to intersect two area features:
…/Map/Overlays/7/Items.json?process={"Operation":"Item.Intersect"}
the intersect operation will not delete the original features.
After running the process the overlay has two original items and an intersected area (item). Use the DELETE verb to remove original items if they are not required.
Accessing Libraries
Any processes you create in SIS and save are stored in a Named Object Library (NOL). These can then be accessed by the HTTP API.
A NOL can be added to the installation folder of GeognoSIS (usually C:\Program Files\Cadcorp GeognoSIS 9\Libraries). This is then automatically loaded into every session.
Alternatively you can load the NOL in a session using this request. This creates a usable NOL file into the session from its location at C:\temp\test.nol
For eg:
http://(user):4626/GeognoSIS/9.0/Sessions/43d3661d-2721-4ec7-a4d8-3d86df42f13f/Libraries.json?
path=c:\\temp\\test.nol
Result
{"Result":"Created",
"View":"Libraries/test.nol.json"}
You can check the Libraries available to you by using a GET request.
http://(user):4626/GeognoSIS/9.0/Sessions/43d3661d-2721-4ec7-a4d8-3d86df42f13f/Libraries.json
Result
{"Data":["Libraries/(temporary).json",
"Libraries/(standard).json",
"Libraries/test.nol.json"],
"Up":"../43d3661d-2721-4ec7-a4d8-3d86df42f13f.json",
"Representations":"Libraries",
"Operations":"Libraries.json?"}
TIP: Notice the new library is included in the list. From here you can explore the contents of the library further.
Moving through the Library structure you can find the ObjectTypes stored there, including Processes using Libraries/test.nol/ObjectTypes/Process/
Running the following GET request will return the JSON structure of the process:
http://ccd616:4626/GeognoSIS/8.0/Sessions/d5b3d66a-b3ac-4eaa-810f-761937c1f408/
Libraries/test1.nol/ObjectTypes/Process/tesing.bufferradiusitem.json
Response
{"Data":{"Operations":[{"Operation":"Item.Buffer","Properties":{"PropertyMap":{"_radius@":"BufferRadius&"}}}]},
"Up":"../Process.json","Representations":"tesing.bufferradiusitem","Operations":"tesing.bufferradiusitem.json?"}
The JSON for the process is defined here as: {"_radius@":"BufferRadius&"}
To use this in a subsequent request, you need to encode the variable type, in this case
&: {"_radius@":"BufferRadius%26%"}
JSON Representation of Processes
The process methods listed below are described using their JSON in the following pages.
General
Copies an existing Item |
|
Breaks down Items with complex geometry into separate Items |
|
Filter Items using an expression |
|
Group Items using an expression |
|
Sort Items by a value |
Construction
Creates a rectangular Polygon, around a centre point |
|
Creates an elliptical Polygon |
|
Creates a LineString from a bearing and distance |
|
Creates a Point Item |
|
Creates random points inside a Polygon |
|
Creates random points along a LineString |
|
Creates a sector Polygon from a bearing and angle |
|
Creates a sector Polygon from a start and end angle |
|
Join points |
Joins the origin points of Items together into a LineString Item |
Join points (advanced) |
Joins the origin points of Items together into one or more LineString Items |
Geometry
Gets the boundary of an Item. |
|
Clips parts of source Items that are inside a clipping Item from another Overlay |
|
Clips parts of source Items that are outside a clipping Item from another Overlay |
|
Closes any open geometry, joining the end to the start |
|
Creates a convex hull Polygon around an Item |
|
Creates an envelope Polygon around the extents of an Item |
|
Explodes each 'part', of an Item into a separate LineString |
|
Explodes each 'segment' |
|
Explodes each vertex of an Item into a separate Point |
|
Facets curved geometry segments into straight geometry |
|
Fills the boundary of an Item |
|
Joins LineString Items together to make a longer LineString Item, within a tolerance |
|
Moves an Item in X and/or Y and/or Z |
|
Removes interior loops (holes and islands) from Polygons, leaving only exterior loops |
|
Reverses the geometry of an Item |
|
Rotates the geometry of an Item about a hook point |
|
Scales the geometry of an Item about a hook point |
|
Smoothes the geometry of an Item, keeping segment mid-points fixed |
|
Smkkoothes the geometry of an Item, keeping vertices fixed |
|
Strips the geometry of an Item, leaving an Empty Item |
Clean/Simplify
Generalises geometry using a variation of the Douglas-Peucker algorithm that is limited by the number of output points |
|
Generalises geometry using the Douglas-Peucker algorithm |
|
Generalise(Perpendicular Distance) |
Generalises geometry using the Perpendicular Distance algorithm |
Generalise (Radial Distance) |
Generalises geometry using the Radial Distance algorithm |
Generalises geometry using the Reumann-Witkam algorithm |
|
Removes duplicate items based on an expression |
|
Removes duplicate items based on their geometry |
|
Removes self-intersections, e.g. a bow-tie |
|
Removes segments shorter than a tolerance |
|
Removes vertices that cause a spike |
|
Removes vertices between straight, or near straight segments |
|
Simplifies the geometry of an item, so that it matches the OGC 'simple' form |
Properties
Remove all attributes |
Removes all attributes from an Item |
Remove attribute |
Removes an attribute from an Item |
Set property |
Sets a property on an Item |
Set styles |
Sets styling information on an Item |
Strip styles |
Strips all styling information from an Item. Returns Brush, Pen and Symbol Items to "By Overlay" |
Analysis
Buffer |
Creates a buffer around an Item |
Cluster |
Clusters Items together within regular, rectangular grid cells |
Create Thiessen Polygons |
Creates Thiessen Polygons of influence around the hook point of Items |
Dissolve |
Merges Items based on attribute values. |
Geodetic buffer |
Creates a 'geodetic' buffer around an Item |
Intersect |
Combines the Items using the intersect boolean operation |
QZone buffer |
Creates a QZone buffer around an Item |
Subtract |
Combines the Items using the subtract boolean operation |
Symmetric difference |
Combines the Items using the symmetric difference boolean operation |
Union |
Combines the Items using the union operation |
Viewshed (as Grids) |
Creates 'Viewshed' Grids from the Item origin over source Grid Items from another Overlay |
Viewshed (as QZone) |
Creates a'Viewshed' QZone from the Item origin over source Grid Items from another Overlay |
Viewshed (as binary Grids) |
Creates 'Viewshed' Grids from the Item origin over source Grid Items from another Overlay, containing only the cell values 1 (in Viewshed) and 0 (not in Viewshed) |
Raster
Compress | Compresses a bitmap |
Convert to grayscale | Converts a colour bitmap to a grayscale bitmap |
Convert to sepia | Converts a colour bitmap to a sepia bitmap |
Crop | Crops a bitmap |
Grid
Creates a Terrain Ruggedness Index map |
|
Creates a Topographic Position Index map |
|
Create aspect |
Creates an Aspect map |
Create contours (fixed intervals) |
Creates contour LineString Items from a Grid, at fixed intervals |
Create contours (fixed levels) |
Creates contour LineString Items from a Grid, at fixed levels |
Creates a shaded relief map from a Grid |
|
Explodes a Grid Item into one Point Item per Grid cell |
|
Creates a coverage of Polygon Items from a Grid |
|
Explodes a Grid Item into one Polygon Item per Grid cell |
|
Creates a Roughness map |
|
Creates a Slope map |
|
Sets the value of all Grid cells that match a comparison against the 'from' value to the 'to' value |
Geocode
Connects to the MapQuest Open Geocoding service |
|
Connects to the Microsoft Bing Maps geocoding service |
|
Searches OS (GB) Code-Point Open data, by postcode |
|
Matches search strings against OS (GB) National Grid References |
|
Matches search strings against OS (GB) National Grid References for Jersey |
User-defined
Removes all attributes from an Item |
|
Strips all styling information from an Item |