Skip to content

NatureScot Protected Areas API Integration

1. Overview

NatureScot (formerly Scottish Natural Heritage) is Scotland's national nature agency responsible for the conservation and enhancement of Scotland's natural heritage. Their Protected Areas WFS (Web Feature Service) provides authoritative geospatial data on designated wildlife protection zones across Scotland.

Purpose in Drone Operations Application

The NatureScot Protected Areas integration provides automatic detection of environmentally sensitive zones during drone flight planning. When users select flight coordinates, the system queries five categories of protected area designations to ensure compliance with wildlife protection regulations.

Protected Area Types Covered

  • SSSI (Sites of Special Scientific Interest) - Areas of particular interest for nature conservation
  • SAC (Special Areas of Conservation) - Protected under the EU Habitats Directive
  • SPA (Special Protection Areas) - Protected under the EU Birds Directive for bird conservation
  • Ramsar (Ramsar Sites) - Wetlands of International Importance under the Ramsar Convention
  • NNR (National Nature Reserves) - Areas managed by NatureScot for conservation

2. NatureScot WFS API Details

Provider Information

  • Organisation: NatureScot (Scottish Natural Heritage)
  • Service Type: OGC Web Feature Service (WFS) 2.0.0
  • Endpoint: https://ogc.nature.scot/geoserver/protectedareas/wfs
  • Protocol: HTTPS
  • Authentication: None required (public service)
  • Rate Limiting: No documented limits (reasonable use expected)

Data Format

  • Response Format: GeoJSON (via WFS OUTPUTFORMAT=application/json)
  • Coordinate System: EPSG:4326 (WGS84 latitude/longitude)
  • Geometry Type: MultiPolygon (protected area boundaries)
  • Encoding: UTF-8

Update Frequency

  • Protected area boundaries are updated as designations are added, modified, or removed
  • Data is sourced from official Scottish Government records
  • Generally stable with occasional updates (quarterly to annually depending on designation type)

3. Protected Area Designation Types

SSSI - Sites of Special Scientific Interest

Definition: Areas designated for their special interest in flora, fauna, geological or physiographical features under the Wildlife and Countryside Act 1981.

Regulations: Operations requiring consent from NatureScot. Unauthorized disturbance may be an offense.

Significance for Drone Operations: Flight operations may disturb sensitive species or habitats. Advance permission often required.

Example: Arthur's Seat, Edinburgh (UK0030150)

SAC - Special Areas of Conservation

Definition: Protected areas under the EU Habitats Directive (92/43/EEC), now retained under UK law post-Brexit.

Regulations: Strict protection for rare species and habitats of European importance. Activities requiring assessment for potential impact.

Significance for Drone Operations: Disturbance to designated species (e.g., otters, bats, rare plants) prohibited without appropriate consents.

Example: Firth of Tay and Eden Estuary (UK0030311)

SPA - Special Protection Areas

Definition: Protected areas under the EU Birds Directive (2009/147/EC) for rare and vulnerable bird species, now retained under UK law.

Regulations: Protection of bird breeding, feeding, and roosting sites. Seasonal restrictions often apply.

Significance for Drone Operations: Drones can cause significant disturbance to nesting birds. Flight restrictions particularly strict during breeding season (typically March-August).

Example: Firth of Forth (UK9004191)

Ramsar - Ramsar Sites (Wetlands of International Importance)

Definition: Wetlands designated under the Ramsar Convention (1971) for their ecological, botanical, zoological, limnological or hydrological importance.

Regulations: Similar protections to SSSIs, with international conservation obligations.

Significance for Drone Operations: Wetland bird disturbance a primary concern. Seasonal sensitivities apply.

Example: Loch Leven (UK11017)

NNR - National Nature Reserves

Definition: Areas managed by NatureScot or approved bodies specifically for nature conservation, scientific study, or public access.

Regulations: On-site management rules apply. Access may be restricted in sensitive areas.

Significance for Drone Operations: Site-specific regulations. Contact reserve manager for flight permissions.

Example: Cairngorms NNR (largest NNR in UK)

4. WFS Query Pattern

Request Parameters

The application uses the WFS GetFeature request with spatial filtering:

GET https://ogc.nature.scot/geoserver/protectedareas/wfs

Query Parameters: | Parameter | Value | Description | |-----------|-------|-------------| | SERVICE | WFS | Web Feature Service | | VERSION | 2.0.0 | WFS version (2.0.0 for GeoJSON support) | | REQUEST | GetFeature | Request type | | TYPENAMES | protectedareas:sssi | Layer name (varies per designation) | | SRSNAME | EPSG:4326 | Coordinate system (WGS84) | | CQL_FILTER | INTERSECTS(geom, POINT(lon lat)) | Spatial query | | OUTPUTFORMAT | application/json | Response format (GeoJSON) |

Spatial Query (CQL_FILTER)

Point-in-polygon intersection test:

INTERSECTS(geom, POINT(longitude latitude))

Example (Arthur's Seat, Edinburgh):

CQL_FILTER=INTERSECTS(geom, POINT(-3.1619 55.9445))

Note: WFS uses (longitude, latitude) order, unlike common (latitude, longitude) convention.

Full Request Example

https://ogc.nature.scot/geoserver/protectedareas/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=protectedareas:sssi&SRSNAME=EPSG:4326&CQL_FILTER=INTERSECTS(geom, POINT(-3.1619 55.9445))&OUTPUTFORMAT=application/json

5. Layer Names and Coverage

Layer Naming Convention

All layers follow the pattern: protectedareas:<type>

Designation Layer Name Approx. Features Geographic Coverage
SSSI protectedareas:sssi 1,400+ Mainland & islands
SAC protectedareas:sac 240+ Mainland & islands
SPA protectedareas:spa 150+ Mainly coastal/upland
Ramsar protectedareas:ramsar 50+ Major wetlands
NNR protectedareas:nnr 70+ Scattered nationwide

Total Coverage: Approximately 18% of Scotland's land area has some form of protection designation. Many areas have overlapping designations (e.g., a single location may be SSSI, SAC, and SPA simultaneously).

Multiple Designation Handling

The application queries all five layers separately because: 1. Different Regulations: Each designation has distinct legal requirements 2. Overlapping Boundaries: A single location can have multiple protections 3. Regulatory Compliance: Users need visibility into all applicable designations

Example (Firth of Forth near Edinburgh): - SPA (bird protection) - Ramsar (wetland) - SSSI (scientific interest) = 3 overlapping designations with different regulatory requirements

6. Response Examples

Successful Query (Features Found)

Request: Point at Arthur's Seat, Edinburgh (55.9445, -3.1619)

Response (simplified):

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "sssi.12345",
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [[[-3.162, 55.943], [-3.161, 55.945], ...]]
      },
      "properties": {
        "NAME": "Arthur's Seat",
        "SITE_CODE": "UK0030150",
        "DESIGNATION": "Site of Special Scientific Interest",
        "STATUS": "Current",
        "AREA_HA": 154.8
      }
    }
  ],
  "totalFeatures": 1
}

Application Processing: - Extracts NAME (site name) - Extracts SITE_CODE (official designation code) - Maps layer type to human-readable name - Generates warning message

Query with No Features (Not Protected)

Request: Point in Edinburgh city centre (55.9533, -3.1883)

Response:

{
  "type": "FeatureCollection",
  "features": [],
  "totalFeatures": 0
}

Application Behaviour: Returns in_protected_area: false, no warnings displayed.

Error Responses

Network Timeout: - No response within 10 seconds - Application logs warning, continues with other layers - Graceful degradation (partial data better than none)

Malformed Request (HTTP 400):

<ows:ExceptionReport>
  <ows:Exception exceptionCode="InvalidParameterValue">
    <ows:ExceptionText>Invalid CQL filter syntax</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

Server Error (HTTP 500): - Logged and handled gracefully - Does not block project creation

7. Integration in Application

Call Timing

Protected areas check occurs during the location selection step of project creation:

  1. User submits location coordinates + project details
  2. Airspace classification check (NATS API)
  3. Urban/rural classification check (Scottish Government API)
  4. Protected areas check (NatureScot API) ← Added here
  5. Session storage of all classification data
  6. Display on viability page

Session Storage Pattern

After successful API call:

session['protected_area_status'] = True  # Boolean flag
session['protected_areas_count'] = 2     # Number of designations
session['protected_areas_designations'] = [
    {
        'type': 'sssi',
        'type_name': 'Site of Special Scientific Interest',
        'name': "Arthur's Seat",
        'code': 'UK0030150'
    },
    {
        'type': 'sac',
        'type_name': 'Special Area of Conservation',
        'name': 'Firth of Forth',
        'code': 'UK0030311'
    }
]
session['protected_areas_warning'] = "This location is within 2 protected area(s)..."

Database Persistence

Stored in Project model after viability confirmation:

project.protected_area_status = True  # Boolean for quick filtering
project.protected_areas_data = {      # JSON for full details
    'count': 2,
    'designations': [...],
    'checked_at': '2026-01-01T12:34:56Z'
}

8. Error Handling

Individual Layer Failure Strategy

Philosophy: Partial data is better than no data.

If SSSI layer query fails but SAC, SPA, Ramsar, NNR succeed: - Log the SSSI failure - Continue with remaining layers - Return results from successful layers - Mark overall query as success: true (partial success)

Example:

try:
    results = cls._query_single_layer(lat, lon, 'protectedareas:sssi', 'sssi')
    all_designations.extend(results)
except Exception as layer_error:
    logger.warning(f"Failed to query sssi layer: {layer_error}")
    continue  # Keep going with other layers

Complete API Failure

If all layers fail (network down, DNS failure, etc.): - Return success: false - Set in_protected_area: false (unknown, assume not protected) - Log error for monitoring - Project creation is NOT blocked (graceful degradation)

Timeout Handling

  • Timeout set to 10 seconds per layer (consistent with other APIs)
  • After timeout: logged, layer skipped, continue with remaining layers
  • User experience: slightly slower project creation but still functional

Fallback Strategy

On any error:

session['protected_area_status'] = False
session['protected_areas_count'] = 0
# Project creation proceeds normally

Rationale: Protected area checks are informational/advisory, not blocking. Users should be able to create projects even if the check fails.

9. Testing Coordinates

Protected Area Examples

Location Lat Lon Expected Designations
Arthur's Seat, Edinburgh 55.9445 -3.1619 SSSI
Firth of Forth 56.0 -2.8 SPA, Ramsar, likely SSSI
Cairngorms 57.1 -3.6 NNR, SAC, SPA, SSSI (multiple)
Loch Lomond 56.1 -4.6 NNR, Ramsar, SSSI

Non-Protected Examples

Location Lat Lon Expected Result
Edinburgh City Centre 55.9533 -3.1883 No designations
Glasgow City Centre 55.8642 -4.2518 No designations
Aberdeen City Centre 57.1497 -2.0943 No designations

Edge Cases

Coastal Boundary (56.0, -2.5): May return SPA/Ramsar (marine protected areas)

Island Locations (Orkney, Shetland): Remote areas may have SAC/SPA designations

10. API Reference

WFS GetCapabilities

Full service capabilities document:

https://ogc.nature.scot/geoserver/protectedareas/wfs?request=GetCapabilities&service=WFS

Returns XML describing: - Available layers - Supported operations - Coordinate systems - Output formats - Service metadata

NatureScot Spatial Data Hub

Main Portal: https://opendata.nature.scot/

Protected Areas Dataset: - Metadata: https://spatialdata.gov.scot/geonetwork/srv/api/records/b94bb6f3-cb8b-4dfa-ab12-d595e63e53b6 - Direct WFS access: https://ogc.nature.scot/geoserver/protectedareas/wfs

Additional Resources

NatureScot Licensing: - Open Government Licence (OGL v3.0) - Free to use, share, and adapt with attribution

Regulatory Guidance: - NatureScot Licensing: https://www.nature.scot/professional-advice/safeguarding-protected-areas-and-species/licensing - SSSI Consent Requirements: https://www.nature.scot/professional-advice/protected-areas-and-species/protected-areas/ssssi/sssi-consent

Contact: - General Enquiries: enquiries@nature.scot - Data Issues: spatial.data@nature.scot

  • NATS Airspace API (docs/api/nats-airspace-api.md) - Airspace classification
  • Scottish Government API (docs/api/scottish-gov-api.md) - Urban/rural classification (if documented)
  • Weather API (Met Office) - Weather forecasting

Document Version: 1.0 Last Updated: 2026-01-01 Author: Claude Code Application: Drone Operations Management System