Angular service
LayersService source
Description
Access to layer services of spatial-service
Methods
-
createArea (name, description, shapeId, featureIdx) -> Promise(Area)
-
Create an area from an in progress shapefile upload
Parameters
Name Type Description name string area name
description string a description
shapeId string shape id for the uploaded file
featureIdx string comma delimited list of feature ids to merge for the created area
Returns
Type Description Promise(Area) created area
-
createFromWkt (WKT, name, description) -> Promise(Map)
-
Create layer using WKT
Example
{ TODO: example }Parameters
Name Type Description WKT string name string display name
description string a description
Returns
Type Description Promise(Map) created area information
-
gazField -> String
-
Get the spatial-service gazetteer field id
Returns
Type Description String field id
-
getAreaDownloadUrl (pid, type, filename) -> String
-
Get URL to download an object shapefile, kml or WKT
Parameters
Name Type Description pid string object id
type string download type, one of 'shp', 'kml' or 'wkt'
filename string the name of the file to download. Note that type == 'shp' produces a .zip
Returns
Type Description String URL
-
getField (field, offset, pageSize, searchTerm) -> Promise(List)
-
Search a pageable list of field objects
Example
Output: { "enabled": true, "objects": [{ "pid": "3742600", "wmsurl": "https://spatial.ala.org.au/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=ALA:Objects&format=image/png&viewparams=s:3742600", "area_km": 986564.4158071108, "fid": "cl22", "bbox": "POLYGON((128.999924 -38.062248,128.999924 -25.9959109999999,141.001709 -25.9959109999999,141.001709 -38.062248,128.999924 -38.062248))", "centroid": "POINT(135.82719986113 -30.1046824043507)", "fieldname": "Australian States and Territories", "featureType": "MULTIPOLYGON", "description": "South Australia, State", "name": "South Australia", "id": "South Australia" }], "spid": "22", "indb": true, "last_update": 1317906000000, "namesearch": true, "sdesc": "name_1,type_1", "sid": "name_1", "intersect": true, "layerbranch": true, "analysis": true, "addtomap": true, "number_of_objects": 11, "sname": "name_1", "defaultlayer": true, "desc": "Australian States and Territories", "name": "Australian States and Territories", "id": "cl22", "type": "c" }Parameters
Name Type Description field String field
offset integer start index
pageSize integer page size
searchTerm String search term
Returns
Type Description Promise(List) list of field objects
-
getLayer (layer) -> Map
-
Get layer information
Parameters
Name Type Description layer string Layer name or field id.
Returns
Type Description Map Layer information. see #getLayers
-
getLayers -> Promise(List)
-
List all fields. See #searchLayers for output example
Returns
Type Description Promise(List) list of fields
-
getLayersUrlLoad (layer) -> Map
-
Get layer information without conflict
Parameters
Name Type Description layer string Layer name or field id.
Returns
Type Description Map Layer information. see #getLayers
-
getObject (pid) -> Promise(Map)
-
Get object information
Example
{ TODO: example }Parameters
Name Type Description pid string object id
Returns
Type Description Promise(Map) object information
-
getObjects (object) -> Promise(List)
-
Get objects for a layer (field)
Example
{ TODO: example }Parameters
Name Type Description object string id
Returns
Type Description Promise(List) object information
-
getShpImageUrl (shapeId, pid) -> String
-
Get URL to image for an incomplete shapefile upload selection
Parameters
Name Type Description shapeId string shape id
pid string selected area id
Returns
Type Description String URL to selection image
-
getWkt (pid) -> Promise(String)
-
Get object WKT
Parameters
Name Type Description pid string object id
Returns
Type Description Promise(String) WKT
-
intersectLayers (layers, longitude, latitude) -> Promise(List)
-
Intersect layers with a single point
Example
Input: - layers ["cl22", "cl23"] - lng 131 - lat -22 Output: [{ "field": "cl22", "layername": "Australian States and Territories", "value": "" }, { "field": "cl23", "layername": "LGA Boundaries (deprecated)", "value": "" }]Parameters
Name Type Description layers List list of layers
longitude Number latitude Number Returns
Type Description Promise(List) intersection results
-
searchLayers (searchTerm) -> Promise(List)
-
Search spatial-service layers
Example
Input: "capad" Output: [{ "enabled": true, "spid": "2080", "indb": true, "last_update": 1426683600000, "namesearch": true, "sid": "name", "intersect": false, "layerbranch": false, "analysis": true, "addtomap": true, "layer": { "displayname": "CAPAD 2012 Marine", "enabled": true, "pid": "", "displaypath": "https://spatial.ala.org.au/geoserver/gwc/service/wms?service=WMS&version=1.1.0&request=GetMap&layers=ALA:capad_2012_marine&format=image/png&style=cl2080_style", "uid": "2080", "metadatapath": "http://www.environment.gov.au/fed/catalog/search/resource/details.page?uuid=%7B9F45DF80-CB86-440C-98DD-0B206B86D712%7D", "classification1": "Area Management", "classification2": "Biodiversity", "notes": "", "source_link": "http://www.environment.gov.au/fed/catalog/search/resource/downloadData.page?uuid=%7B9F45DF80-CB86-440C-98DD-0B206B86D712%7D", "licence_link": "http://www.environment.gov.au/fed/catalog/search/resource/details.page?uuid=%7B9F45DF80-CB86-440C-98DD-0B206B86D712%7D", "licence_notes": "", "maxlatitude": -8.88189, "minlatitude": -58.44947, "minlongitude": 70.9, "maxlongitude": 170.36667, "shape": true, "path_orig": "shape/capad_2012_marine", "environmentalvalueunits": "", "domain": "marine", "dt_added": 1426683600000, "environmentalvaluemin": "", "lookuptablepath": "", "citation_date": "2012-12-31", "datalang": "eng", "licence_level": "3", "mddatest": "2014-12-05", "mdhrlv": "", "respparty_role": "custodian", "keywords": "IUCN, reserve, park, conservation, wilderness", "path_1km": "", "environmentalvaluemax": "", "description": "CAPAD (Collaborative Australian Protected Area Database) contains information on all protected areas in Australia, including their IUCN management categories.", "source": "http://www.environment.gov.au/land/nrs/science/capad/2012", "scale": "", "name": "capad_2012_marine", "id": 2080, "type": "Contextual", "path": "/data/ala/data/layers/ready/shape" }, "sname": "name", "defaultlayer": true, "desc": "capad 2012 marine", "name": "CAPAD 2012 Marine", "id": "cl2080", "type": "c" }]Parameters
Name Type Description searchTerm String search term
Returns
Type Description Promise(List) list of layers
-
uploadAreaFile (file, type, name, description) -> Promise(Map)
-
Upload an area file. zip (shapefile) or kml TODO: support zipped kml
Parameters
Name Type Description file File type string one of 'shp' or 'kml'
name string area name
description string a description
Returns
Type Description Promise(Map) in progress uploaded area info
-
url -> String
-
Get spatial-service URL
Returns
Type Description String spatial-service URL