# EU EUDR GeoJSON Validator & TRACES NT Auto-Fixer (API & MCP) (`eurocomply_data/eu-eudr-geojson-validator`) Actor

Validate and auto-fix GeoJSON farm plots for EU Deforestation Regulation (EUDR 2023/1115) & TRACES NT submission: checks 6-decimal WGS84 precision, unclosed rings, self-intersections, Z-coordinates, RFC 7946 winding order, geodesic area (4-hectare rule), and EUDR Annex I HS/CN commodity scope.

- **URL**: https://apify.com/eurocomply_data/eu-eudr-geojson-validator.md
- **Developed by:** [Eduardo Pinto](https://apify.com/eurocomply_data) (community)
- **Categories:** Business, Automation, AI
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 eudr plot / cn code checks

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## EU EUDR GeoJSON Validator & TRACES NT Auto-Fixer (API & MCP)

Validate, repair, and prepare farm/forestry **GeoJSON** plots for **EU Deforestation Regulation (EUDR — Regulation (EU) 2023/1115)** and **EU TRACES NT** Due Diligence Statements (DDS).

Available in **three modes**:

1. **Batch Actor** — validate entire GeoJSON `FeatureCollection` files, get per-plot error reports, and download a cleaned `FIXED_GEOJSON` ready for TRACES NT.
2. **Low-Latency Standby REST API** — integrate directly into ERP, supply-chain, or `n8n` / Make workflows.
3. **Model Context Protocol (MCP) Server (`/mcp`)** — plug straight into AI agents (Claude, Cursor, Antigravity, LangChain).

***

### TRACES NT Checks & Auto-Fixes Included

- **Auto-Close Unclosed Rings** — detects & repairs polygon rings where first != last vertex.
- **Strip 3D Z-Altitude Coordinates** — removes elevation values (`[lon, lat, z]` → `[lon, lat]`) rejected by TRACES NT.
- **Swapped Lat/Lon Detection & Auto-Fix** — catches `[lat, lon]` order errors.
- **Duplicate Consecutive Vertex Removal** — cleans noisy GPS tracks.
- **RFC 7946 Winding Order Fix** — enforces CCW exterior rings and CW interior holes.
- **Self-Intersection Detection** — flags bowtie/crossing polygon edges rejected by TRACES NT.
- **WGS84 Geodesic Area & 4-Hectare Rule (Art. 2(28))** — calculates exact geodesic area in hectares and flags any `Point` plot > 4 ha that legally requires a `Polygon` (while respecting the cattle establishment exemption).
- **6-Decimal Coordinate Precision Check** — verifies EUDR's 6-decimal WGS84 requirement.
- **EUDR Annex I HS/CN Commodity Scope Checker** — screens HS/CN codes across all 7 regulated commodities: **Cattle, Cocoa, Coffee, Oil palm, Rubber, Soya, and Wood**.

***

### Standby REST API & MCP Endpoints

- `POST /mcp` — MCP Server exposing `validate_and_fix_eudr_geojson`, `check_eudr_cn_code`, and `get_eudr_traces_rules`
- `POST /api/validate` — Validate & auto-fix GeoJSON payload
- `GET /api/cn/:code` — Check HS/CN code against EUDR Annex I
- `GET /api/rules` — Fetch EUDR TRACES NT rules

***

### Native MCP Server Setup (Claude Desktop, Cursor & VS Code)

Connect this Actor directly to any MCP-compatible AI agent using Streamable HTTP (or use our [1-Click MCP Config Generator](https://epinto1000-a11y.github.io/eurocomply-mcp-suite/#mcp-generator)):

```json
{
  "mcpServers": {
    "eu-eudr-geojson-validator": {
      "type": "http",
      "url": "https://eurocomply-data--eu-eudr-geojson-validator.apify.actor/mcp",
      "headers": {
        "Authorization": "Bearer apify_api_YOUR_TOKEN"
      }
    }
  }
}
```

- **Official MCP Registry ID:** `io.github.epinto1000-a11y/eu-eudr-geojson-validator`
- **n8n Templates & Examples:** [eurocomply-mcp-suite on GitHub](https://github.com/epinto1000-a11y/eurocomply-mcp-suite)

***

### FAQ

**What are the official EUDR compliance deadlines?**
Large and medium operators must comply by **December 30, 2026**, and micro/small enterprises by **June 30, 2027** (per Regulation (EU) 2023/1115 as amended).

**Does it automatically fix GeoJSON plots rejected by TRACES NT?**
Yes. With `autoFix: true`, it closes unclosed rings, fixes exterior/interior winding order (RFC 7946), strips Z altitudes, rounds precision, and flags plots > 4.0 ha that require polygons instead of points.

**How are cattle plots handled under EUDR?**
Cattle establishments are exempt from the > 4 ha polygon requirement and may submit a single geolocation point per establishment.

***

### EuroComply Data Suite

Explore all 10 production EU compliance, live verification, and B2B automation Actors by [EuroComply Data](https://apify.com/eurocomply_data):

| Actor | Pricing | Modes |
| :--- | :--- | :--- |
| [EU CBAM 2026 Compliance Calculator](https://apify.com/eurocomply_data/eu-cbam-compliance-calculator) | `$0.005 / cbam-check` | Batch + REST + MCP |
| [EU EUDR GeoJSON Validator & Auto-Fixer](https://apify.com/eurocomply_data/eu-eudr-geojson-validator) | `$0.005 / eudr-plot-check` | Batch + REST + MCP |
| [EU TARIC Customs & Landed Cost Calculator](https://apify.com/eurocomply_data/eu-taric-customs-calculator) | `$0.005 / taric-lookup` | Batch + REST + MCP |
| [EU AI Act Risk Classifier](https://apify.com/eurocomply_data/eu-ai-act-risk-classifier) | `$0.005 / ai-act-check` | Batch + REST + MCP |
| [EU SEPA ISO 20022 XML Validator](https://apify.com/eurocomply_data/eu-sepa-iso20022-validator) | `$0.005 / sepa-validate` | Batch + REST + MCP |
| [EU NIS2 & DORA Compliance Calculator](https://apify.com/eurocomply_data/eu-nis2-dora-compliance-calculator) | `$0.005 / nis2-dora-check` | Batch + REST + MCP |
| [EU EUR-Lex Live Legislation Monitor](https://apify.com/eurocomply_data/eu-eurlex-legislation-monitor) | `$0.005 / eurlex-document` | Batch + REST + MCP |
| [EU KYB Live Company Verifier](https://apify.com/eurocomply_data/eu-kyb-company-verifier) | `$0.005 / kyb-check` | Batch + REST + MCP |
| [Universal E-Commerce Price & Stock Monitor](https://apify.com/eurocomply_data/universal-ecommerce-price-stock-monitor) | `$0.005 / product-check` | Batch + REST + MCP |
| [B2B Buying Intent Signal Finder](https://apify.com/eurocomply_data/b2b-buying-intent-signal-finder) | `$0.005 / intent-lead` | Batch + REST + MCP |

# Actor input Schema

## `geojson` (type: `object`):

GeoJSON object (FeatureCollection, Feature, Polygon, MultiPolygon, or Point) representing agricultural/forestry production plots for EU EUDR TRACES NT validation.

## `autoFix` (type: `boolean`):

Automatically close unclosed rings, strip Z-altitude coordinates, remove duplicate consecutive vertices, enforce RFC 7946 winding order, and normalize to 6 decimal places.

## `commodity` (type: `string`):

Optional default EUDR commodity. Note: cattle establishments are exempt from the >4ha polygon requirement.

## `cnCodes` (type: `array`):

Optional list of HS/CN customs codes to check against EUDR Annex I commodity scope (e.g. \['0901 11 00', '1801 00 00', '4407 11 10']).

## Actor input object example

```json
{
  "geojson": {
    "type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "properties": {
          "ProductionPlace": "Farm Plot A - Coffee",
          "ProducerCountry": "BR",
          "commodity": "coffee"
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -46.633308,
                -23.55052,
                760
              ],
              [
                -46.630308,
                -23.55052,
                760
              ],
              [
                -46.630308,
                -23.54752,
                760
              ],
              [
                -46.633308,
                -23.54752,
                760
              ]
            ]
          ]
        }
      },
      {
        "type": "Feature",
        "properties": {
          "ProductionPlace": "Smallholder Plot B",
          "ProducerCountry": "CI",
          "Area": 6.5,
          "commodity": "cocoa"
        },
        "geometry": {
          "type": "Point",
          "coordinates": [
            -5.289343,
            6.827623
          ]
        }
      }
    ]
  },
  "autoFix": true,
  "commodity": "",
  "cnCodes": []
}
```

# Actor output Schema

## `results` (type: `string`):

Validation errors, warnings, fixes applied, geodesic area in hectares, and 4-hectare rule status for each plot.

## `fixedGeoJson` (type: `string`):

Auto-fixed RFC 7946 / TRACES NT-compliant GeoJSON FeatureCollection.

## `summary` (type: `string`):

Aggregated pass/fail counts, total hectares, and optional HS/CN commodity scope checks.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "geojson": {
        "type": "FeatureCollection",
        "features": [
            {
                "type": "Feature",
                "properties": {
                    "ProductionPlace": "Farm Plot A - Coffee",
                    "ProducerCountry": "BR",
                    "commodity": "coffee"
                },
                "geometry": {
                    "type": "Polygon",
                    "coordinates": [
                        [
                            [
                                -46.633308,
                                -23.55052,
                                760
                            ],
                            [
                                -46.630308,
                                -23.55052,
                                760
                            ],
                            [
                                -46.630308,
                                -23.54752,
                                760
                            ],
                            [
                                -46.633308,
                                -23.54752,
                                760
                            ]
                        ]
                    ]
                }
            },
            {
                "type": "Feature",
                "properties": {
                    "ProductionPlace": "Smallholder Plot B",
                    "ProducerCountry": "CI",
                    "Area": 6.5,
                    "commodity": "cocoa"
                },
                "geometry": {
                    "type": "Point",
                    "coordinates": [
                        -5.289343,
                        6.827623
                    ]
                }
            }
        ]
    },
    "commodity": "",
    "cnCodes": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("eurocomply_data/eu-eudr-geojson-validator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "geojson": {
        "type": "FeatureCollection",
        "features": [
            {
                "type": "Feature",
                "properties": {
                    "ProductionPlace": "Farm Plot A - Coffee",
                    "ProducerCountry": "BR",
                    "commodity": "coffee",
                },
                "geometry": {
                    "type": "Polygon",
                    "coordinates": [[
                            [
                                -46.633308,
                                -23.55052,
                                760,
                            ],
                            [
                                -46.630308,
                                -23.55052,
                                760,
                            ],
                            [
                                -46.630308,
                                -23.54752,
                                760,
                            ],
                            [
                                -46.633308,
                                -23.54752,
                                760,
                            ],
                        ]],
                },
            },
            {
                "type": "Feature",
                "properties": {
                    "ProductionPlace": "Smallholder Plot B",
                    "ProducerCountry": "CI",
                    "Area": 6.5,
                    "commodity": "cocoa",
                },
                "geometry": {
                    "type": "Point",
                    "coordinates": [
                        -5.289343,
                        6.827623,
                    ],
                },
            },
        ],
    },
    "commodity": "",
    "cnCodes": [],
}

# Run the Actor and wait for it to finish
run = client.actor("eurocomply_data/eu-eudr-geojson-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "geojson": {
    "type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "properties": {
          "ProductionPlace": "Farm Plot A - Coffee",
          "ProducerCountry": "BR",
          "commodity": "coffee"
        },
        "geometry": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -46.633308,
                -23.55052,
                760
              ],
              [
                -46.630308,
                -23.55052,
                760
              ],
              [
                -46.630308,
                -23.54752,
                760
              ],
              [
                -46.633308,
                -23.54752,
                760
              ]
            ]
          ]
        }
      },
      {
        "type": "Feature",
        "properties": {
          "ProductionPlace": "Smallholder Plot B",
          "ProducerCountry": "CI",
          "Area": 6.5,
          "commodity": "cocoa"
        },
        "geometry": {
          "type": "Point",
          "coordinates": [
            -5.289343,
            6.827623
          ]
        }
      }
    ]
  },
  "commodity": "",
  "cnCodes": []
}' |
apify call eurocomply_data/eu-eudr-geojson-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eurocomply_data/eu-eudr-geojson-validator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/KqZHgkVAcfbv6NlmV/builds/68Bl8wfu1CzJJN2xQ/openapi.json
