Within Features

POST
https://api.woosmap.com/datasets/{dataset_id}/features/within

Search for features within geometry.

Rate limit: 20/1s

Within

Ratelimit: 20/1s

Authorization

key
apiKey query

Public key of the project usually starts with woos-

private_key
apiKey query

Private key with or without write permission.

X-Api-Key
apiKey header

Private key with or without write permission.

Path Parameters

dataset_id
string required

Query Parameters

format
string Defaults to geojson
Available options: geojson, wkb
per_page
integer Defaults to 10

The maximum number of elements to return in a result page.

page
integer Defaults to 1

The result page to fetch.

Request Body

application/json
geometry
string | PolygonGeometry required

A geometry can be passed as:

buffer
number

When set applies a buffer operation to input geometry see Buffer Analysis.

where
string

Applies a Woosmap filter on feature attributes.

Example
An with polygon geojson geometry, a 10 meters buffer and a where clause
JSON
        
{
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-10,
-10
],
[
10,
-10
],
[
10,
10
],
[
-10,
10
],
[
-10,
-10
]
]
]
},
"buffer": 10,
"where": "cost:<500"
}

Response

200 application/json

Successful Response

features
object[] required

The list of FeatureSummaryResponse that matched the search

Show 3 propertiesHide 3 properties
features. id
string (uuid) required

The feature ID.

features. geometry
string | PolygonGeometry | PointGeometry

The geometry WKB base64-encoded

features. attributes
object

The feature attributes

pagination
object required

The pagination information

Show 3 propertiesHide 3 properties
pagination. prev
integer

The previous page number if any.

pagination. next
integer

The next page number if any.

pagination. page
integer required

The current page number.

Errors

401

Unable to locate credentials.

application/json
detail
string required
402

Out of free quota.

application/json
detail
string required
403

Credentials found, but not matching.

application/json
detail
string required
404

Dataset was not found

application/json
details
string required
422

Validation Error

application/json
detail
object[]
Show 3 propertiesHide 3 properties
detail. loc
any[] required
detail. msg
string required
detail. type
string required
429

Rate limit reached

application/json
details
string required
        curl -L 'https://api.woosmap.com/datasets/8c4c51f1-f6f3-43bc-b65d-7415e8ef22c0/features/within/?private_key=YOUR_PRIVATE_API_KEY' \
-H 'content-type: application/json' \
-d '{
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          2.3522,
          48.8566
        ],
        [
          2.3622,
          48.8566
        ],
        [
          2.3622,
          48.8666
        ],
        [
          2.3522,
          48.8666
        ],
        [
          2.3522,
          48.8566
        ]
      ]
    ]
  }
}'

    
        const myHeaders = new Headers();
myHeaders.append("content-type", "application/json");

const raw = JSON.stringify({
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          2.3522,
          48.8566
        ],
        [
          2.3622,
          48.8566
        ],
        [
          2.3622,
          48.8666
        ],
        [
          2.3522,
          48.8666
        ],
        [
          2.3522,
          48.8566
        ]
      ]
    ]
  }
});

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://api.woosmap.com/datasets/8c4c51f1-f6f3-43bc-b65d-7415e8ef22c0/features/within/?private_key=YOUR_PRIVATE_API_KEY", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));

    
        import requests
import json

url = "https://api.woosmap.com/datasets/8c4c51f1-f6f3-43bc-b65d-7415e8ef22c0/features/within/?private_key=YOUR_PRIVATE_API_KEY"

payload = json.dumps({
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    2.3522,
                    48.8566
                ],
                [
                    2.3622,
                    48.8566
                ],
                [
                    2.3622,
                    48.8666
                ],
                [
                    2.3522,
                    48.8666
                ],
                [
                    2.3522,
                    48.8566
                ]
            ]
        ]
    }
})
headers = {
    'content-type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)


    
Was this helpful?