Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Next »


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.

/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:

-Dcom.cohga.server.stateless=false



Sub-resources

1- /selection/sizes

Provides the current selection size of all available entities

Example

curl -X GET --header 'Accept: application/json' 'http://localhost:8087/weave/services/v1/selection/sizes'


Output

{
  "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

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


Output

{
  "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

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


Output

{
  "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

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


Output

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


5 - /selection/envelope/{entityId}

Return the envelope for the current selection of an entity

Example

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


Output

[
  1.6834772405E7,
  -4014396.738,
  1.6834849184E7,
  -4014320.354
]


6 - /selection/centroid/{entityId}


Return the centroid for the current selection of an entity

Example

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


Output

[16834811.92234551,-4014360.4169504736]


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


Manipulate selection by Feature Id

Example

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

{
  "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:

{
  "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


Return value

Accept headerReturn value exampleDescription
application/json
{
  "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

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:8087/weave/services/v1/selection/put'


Output

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



  • No labels