Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The /selection resource represents the selection capabilities of Weave. In Weave, selections are a set of unique identifiers against an entity.

E.g.: For property entity (corresponding to addresspoi layer), a selection may consist of the entityId ('property') and a list of unique featureids, each denoting a single property.

The /selection resource supports stateful operations, i.e. for an authenticated user session, Weave will add, delete or modify selections and perform other operations based on the selections that are stored in the user session.


For /selection resource to function properly, the server must support user sessions. Additionally, the following parameter must be set:

Code Block
languagebash
themeConfluence
-Dcom.cohga.server.stateless=false



Sub-resources

1. /selection/sizes

Provides the current selection size of all available entities.

Example 1

Code Block
languagebash
themeEmacs
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/selection/sizes'


Output

Code Block
languagejs
collapsetrue
{
  "results": [
    {
      "count": 0,
      "entity": "landscaped_area",
      "ids": []
    },
    {
      "count": 0,
      "entity": "local_government_area",
      "ids": []
    },
    {
      "count": 0,
      "entity": "land_zoning",
      "ids": []
    },
    {
      "count": 0,
      "entity": "contribution_plan",
      "ids": []
    },
    {
      "count": 0,
      "entity": "postcode",
      "ids": []
    },
    {
      "count": 0,
      "entity": "heritage",
      "ids": []
    },
    {
      "count": 0,
      "entity": "floor_space_ratio",
      "ids": []
    },
    {
      "count": 0,
      "entity": "flood",
      "ids": []
    },
    {
      "count": 0,
      "entity": "areasearch",
      "ids": []
    },
    {
      "count": 0,
      "entity": "wetlands",
      "ids": []
    },
    {
      "count": 0,
      "entity": "height_of_building",
      "ids": []
    },
    {
      "count": 0,
      "entity": "bulk_water_supply",
      "ids": []
    },
    {
      "count": 0,
      "entity": "front_building_line",
      "ids": []
    },
    {
      "count": 1,
      "entity": "property",
      "ids": ["1048996_11_Smith_Avenue_106_Albion_Park_DP793040"]
    },
    {
      "count": 0,
      "entity": "suburb",
      "ids": []
    },
    {
      "count": 0,
      "entity": "local_government_area",
      "ids": []
    },
    {
      "count": 0,
      "entity": "lot_size",
      "ids": []
    },
    {
      "count": 0,
      "entity": "gross_floor_area",
      "ids": []
    }
  ]
}
Response Code


2. /selection/size/{entity}

Provides the current size of the selection for the specified entity, i.e. number of features selected for the given entity.

Example 2

Code Block
languagebash
themeEmacs
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/selection/size/property?includeids=true'


Output

Code Block
languagejs
{
  "count": 1,
  "entity": "property",
  "ids": [
    "1048996_11_Smith_Avenue_106_Albion_Park_DP793040"
  ]
}



3. /selection/clear


Clear the current selection for all available entities.

Example 3

Code Block
languagebash
themeEmacs
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/selection/clear/property'


Output

Code Block
languagejs
collapsetrue
{
  "results": [
    {
      "count": 0,
      "entity": "state_significant_dev_sites",
      "ids": []
    },
    {
      "count": 0,
      "entity": "landscaped_area",
      "ids": []
    },
    {
      "count": 0,
      "entity": "environmental_cons_area",
      "ids": []
    },
    {
      "count": 0,
      "entity": "new_local_government_area",
      "ids": []
    },
    {
      "count": 0,
      "entity": "groundwater_vulnerability",
      "ids": []
    },
    {
      "count": 0,
      "entity": "land_zoning",
      "ids": []
    },
    {
      "count": 0,
      "entity": "contribution_plan",
      "ids": []
    },
    {
      "count": 0,
      "entity": "postcode",
      "ids": []
    },
    {
      "count": 0,
      "entity": "heritage",
      "ids": []
    },
    {
      "count": 0,
      "entity": "floor_space_ratio",
      "ids": []
    },
    {
      "count": 0,
      "entity": "flood",
      "ids": []
    },
    {
      "count": 0,
      "entity": "areasearch",
      "ids": []
    },
    {
      "count": 0,
      "entity": "wetlands",
      "ids": []
    },
    {
      "count": 0,
      "entity": "height_of_building",
      "ids": []
    },
    {
      "count": 0,
      "entity": "bulk_water_supply",
      "ids": []
    },
    {
      "count": 0,
      "entity": "front_building_line",
      "ids": []
    },
    {
      "count": 0,
      "entity": "property",
      "ids": []
    },
    {
      "count": 0,
      "entity": "suburb",
      "ids": []
    },
    {
      "count": 0,
      "entity": "local_government_area",
      "ids": []
    },
    {
      "count": 0,
      "entity": "lot_size",
      "ids": []
    },
    {
      "count": 0,
      "entity": "gross_floor_area",
      "ids": []
    },
    {
      "count": 0,
      "entity": "bushfire_prone_land",
      "ids": []
    },
    {
      "count": 0,
      "entity": "drinking_water_catchment",
      "ids": []
    }
  ]
}


4. /selection/clear/{entity}


Clear the current selection for the entity.

Example 4

Code Block
languagebash
themeEmacs
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/selection/clear/property'


Output

Code Block
languagejs
{
  "count": 0,
  "entity": "property",
  "ids": []
}


5. /selection/envelope/{entityId}

Return the envelope for the current selection of an entity.

Example 5

Code Block
languagebash
themeEmacs
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/selection/envelope/property?crs=EPSG%3A3857'


Output

Code Block
languagejs
[
  1.6834772405E7,
  -4014396.738,
  1.6834849184E7,
  -4014320.354
]


6. /selection/centroid/{entityId}


Return the centroid for the current selection of an entity.

Example 6

Code Block
languagebash
themeEmacs
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/selection/centroid/property?crs=EPSG%3A3857'


Output

Code Block
languagejs
[16834811.92234551,-4014360.4169504736]


7. /selection/put/{entityId}/{featureId}


Manipulate selection by Feature Id.

Example 7

Code Block
languagebash
themeEmacs
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/selection/put/property/19064_Unit_16_70-78_Cook_Road___Centennial_Park?crs=EPSG%3A3857&operator=REPLACE'


Output

Code Block
languagejs
{
  "centroid": {
    "crs": "EPSG:3857",
    "x": 16834811.92234551,
    "y": -4014360.4169504736
  },
  "count": 1,
  "entity": "property",
  "ids": []
}


8. /selection/put


Allows the manipulation of selections by specifying geometrical shapes.


Parameters:

POST body parameter example:

Code Block
languagejs
{
  "operator": "REPLACE",
  "shapeType": 0,
  "x": 16830987.54667605,
  "y": -4009701.4948807703,
  "entities": "property,lot_size",
  "crs": "EPSG:3857",
  "includeids": true
}

operator - selection operation

type: String constant

accepted values: 

REPLACE - replaces any existing selections, if none exists, creates a new selection

ADD - adds the specified selections to the current selection

REMOVE - removes the specified selections from the current selection

REFINE - Keeps only those items found in the current selection that are contained in the specified selections

EXCHANGE - Implements the XOR operator between the current selection and the specified selection, "one or the other but not both"

shapeType - geometrical shape

type: integer constant

accepted values:

0 - Point

1 - Polygon with 4 vertices

2 - Line connecting 2 points

3 - Point with an optional buffer around it

4 - Linestring - a line connecting 2 or more points

5 - Linear ring - a closed linestring with 4 or more points

<map coordinate parameters> - depending on the shapeType, various map coordinate parameters may be provided

E.g. x, y for Point,

x,y,radius for Point with buffer

entities - comma-separated list of strings - entities whose features are to be selected

crs - string - coordinate reference system that any coordinates are provided in 

includeids - boolean - indicates whether to include feature ids in the response from the server



Return value

Accept headerReturn value exampleDescription
application/json


Code Block
languagejs
collapsetrue
{
  "results": [
    {
      "count": 1,
      "entity": "property",
      "ids": [
        "1933692_3_Paul_Street__A_Balmain_East_DP450005"
      ]
    },
    {
      "count": 1,
      "entity": "lot_size",
      "ids": [
        "36299"
      ]
    }
  ]
}


JSON object containing a 'path' describing the current selection



Example 1

Code Block
languagebash
themeEmacs
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
   "operator": "REPLACE", \ 
   "shapeType": 0, \ 
   "x": 16830987.54667605, \ 
   "y": -4009701.4948807703, \ 
   "entities": "property,lot_size", \ 
   "crs": "EPSG:3857", \ 
   "includeids": true \ 
 }' 'http://localhost:8080/weave/services/v1/selection/put'


Output

Code Block
languagejs
{
  "results": [
    {
      "count": 1,
      "entity": "property",
      "ids": [
        "1933692_3_Paul_Street__A_Balmain_East_DP450005"
      ]
    },
    {
      "count": 1,
      "entity": "lot_size",
      "ids": [
        "36299"
      ]
    }
  ]
}