1. Buffer

Buffer

URL: /maps/{map_id}/layers/{layer_id}/buffer

Method: POST

Protocol: HTTPS

Parameters:

  • map_id – id of map that contains layer (optional)
  • layer_id – target layer id

Returns one of:

  • 201 (Created) – Location header: location of the newly created layer (1/maps/{map id}/layers/{layer id})
  • 400 (Bad Request) – Missing Params + error message
  • 404 (Not Found) – Resource Not Found
  • 500 (Internal Server Error) + error message

Params in body:

  • name – name of the new layer
  • size – buffer size
  • units – units for the size param (meter, kilometer, mile, degree); optional (defaults to meter)
  • merge_geom – group all geometry together; optional (defaults to true)
  • border_width – width of the new layer’s features polygon border; accepts values 1-4; optional (defaults to 1)
  • border_color – an RGB color string for the new layer’s features polygon border color; optional (defaults to 0,0,0)
  • fill_color – an RGB color string for the new layer’s features polygon fill color; optional (defaults to 255,255,255)

JSON example of body:

{
    "name":"buffer_layer_name",
    "size":"100",
    "merge_geom":true,
    "units":"meter",
    "fill_color":"198,45,240",
    "border_color":"0,32,96",
    "border_width":1
}

Example:

$ curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"name":"buffer_layer_name","size":"100","merge_geom":true,"units":"meter","fill_color":"198,45,240","border_color":"0,32,96","border_width":1}' \
  https://api.giscloud.com/1/layers/123/buffer