# EUDR Geolocation Validator & Fixer (`nemata/eudr-geolocation-validator`) Actor

Check and fix plot geolocation files for the EUDR Information System (TRACES): polygons, holes, crossings, 6 decimals, swapped lat/lon, country, 4 ha rule, Area, 25 MB. GeoJSON, KML/KMZ and CSV in, clean GeoJSON out.

- **URL**: https://apify.com/nemata/eudr-geolocation-validator.md
- **Developed by:** [nemata](https://apify.com/nemata) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 plot checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-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

## EUDR Geolocation Validator & Fixer — GeoJSON, KML, CSV for the EU Deforestation Regulation

Get your plot geolocation files **accepted by the EUDR Information System (TRACES) first time**. Upload GeoJSON, KML/KMZ (Google Earth) or a CSV of coordinates. The Actor checks every plot against the official *EUDR GeoJSON File Description*, fixes what can be fixed automatically, and returns a clean GeoJSON ready to attach to your Due Diligence Statement.

The EUDR applies from **30 December 2026** to large and medium operators, and from **30 June 2027** to micro and small operators. Every statement needs the geolocation of the plots where the commodity was produced (cattle, cocoa, coffee, oil palm, rubber, soya, wood).

### What it checks (the official list of common errors)

- **Geometry:** only Point, MultiPoint, Polygon and MultiPolygon, with correct casing. LineStrings are rejected.
- **Polygons:** closed rings, at least 4 positions, no holes, no crossing edges (figure-eight) or inward folds, no "straight line" polygons.
- **Precision:** six decimal digits, and duplicate vertices created when the system truncates to 6 decimals.
- **Coordinates:** WGS 84, longitude before latitude, within ±180 / ±90. **Swapped lat/lon is detected** by checking the declared country.
- **Country:** valid ISO 3166-1 alpha-2 `ProducerCountry`, and whether the plot actually falls inside that country.
- **Properties:** exact names and casing (`ProductionPlace`, `Area`, `ProducerName`, `ProducerCountry`), and `Area` as a number. `"Area": "3"` would count as 0 ha.
- **The 4-hectare rule:** points declared over 4 ha must be polygons (except cattle). Points without Area default to 4 ha.
- **Area:** geodesic area of each polygon in hectares, with a warning when the declared Area is off by more than 20%.
- **File size:** the 25 MB limit per statement. The fixed output is split automatically if needed.

### Automatic fixes (`autoFix`, on by default)

Property casing, text Areas turned into numbers, geometry type casing, closing open polygons, truncating to 6 decimals and removing the resulting duplicates, swapping lat/lon when the country proves it, adding a default producer name and country, and dropping properties the EU system ignores. Problems that need a human decision, such as holes, crossing edges or points over 4 ha, are reported but not changed.

### Input

```json
{
  "fileUrls": [{ "url": "https://example.com/plots/cooperative-2026.kml" }],
  "producerName": "Cooperative Example",
  "producerCountry": "CI",
  "autoFix": true,
  "checkCountry": true
}
```

You can also paste GeoJSON or CSV in `geojsonText`. CSV columns: `lat`, `lon` (or `latitude`, `longitude`), and optionally `name`, `area_ha`, `country`, `producer`.

### Output

- **Dataset:** one row per plot, with `ok`, issues (code, message, whether it was fixed), computed area in hectares and the detected country.
- **Key-value store:** `eudr_geolocation.geojson`, the clean file with the plots that passed, and `SUMMARY` with the totals and a `readyForUpload` flag.

```json
{
  "index": 17,
  "name": "Parcela 18",
  "geometryType": "Polygon",
  "computedAreaHa": 6.214,
  "locatedInCountry": "CI",
  "ok": false,
  "issues": [
    { "severity": "error", "code": "open_polygon", "message": "Polygon is not closed (first and last coordinates differ).", "fixed": true },
    { "severity": "error", "code": "self_intersection", "message": "Polygon edges cross or overlap (figure-eight or inward fold).", "fixed": false }
  ]
}
```

### Good to know

- This Actor checks the **format** required by the EUDR Information System. It does not assess deforestation risk or replace your due diligence.
- Country borders come from Natural Earth at 1:50m scale, so plots within a few kilometres of a border may be flagged; check those manually.
- Files are processed only during the run.

### Use with AI agents

- **MCP:** AI assistants and agents can call this Actor as a tool through the Apify MCP server.
- **No Apify account needed for agents:** agents can pay per run through Apify with x402 (stablecoins) or Skyfire, and then call the Actor with the temporary token they receive.
- Clear JSON input and structured JSON output that an agent can use directly.

### Pricing

**$0.01 per plot** ($10 per 1,000). The price is the same for every Apify plan you are on, and you can set a maximum cost per run in the run options.

Pay per event: you are charged **per plot checked**.

# Actor input Schema

## `fileUrls` (type: `array`):

URLs of GeoJSON, KML/KMZ or CSV files with your plots.

## `geojsonText` (type: `string`):

Or paste the content of a GeoJSON or CSV file.

## `producerName` (type: `string`):

Added as ProducerName to plots that do not have one.

## `producerCountry` (type: `string`):

Added as ProducerCountry to plots that do not have one, e.g. CI, BR, ID. Also used to detect swapped coordinates.

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

Fix casing, text areas, open polygons, 6-decimal duplicates and swapped coordinates.

## `checkCountry` (type: `boolean`):

Check that each plot falls inside its ProducerCountry.

## `cattle` (type: `boolean`):

Cattle may be geolocated with a point regardless of size, so the 4 ha rule is not applied.

## Actor input object example

```json
{
  "geojsonText": "{\"type\": \"FeatureCollection\", \"features\": [{\"type\": \"Feature\", \"properties\": {\"productionplace\": \"Plot 1\", \"Area\": \"2.5\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [-5.547219, 7.539989]}}, {\"type\": \"Feature\", \"properties\": {\"ProductionPlace\": \"Plot 2\"}, \"geometry\": {\"type\": \"Polygon\", \"coordinates\": [[[-5.551, 7.541], [-5.548, 7.541], [-5.548, 7.538], [-5.551, 7.538]]]}}, {\"type\": \"Feature\", \"properties\": {\"ProductionPlace\": \"Plot 3\", \"Area\": 9}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [7.531204, -5.560113]}}]}",
  "producerCountry": "CI",
  "autoFix": true,
  "checkCountry": true,
  "cattle": false
}
```

# Actor output Schema

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

No description

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

No description

## `geojson` (type: `string`):

No description

# 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 = {
    "geojsonText": "{\"type\": \"FeatureCollection\", \"features\": [{\"type\": \"Feature\", \"properties\": {\"productionplace\": \"Plot 1\", \"Area\": \"2.5\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [-5.547219, 7.539989]}}, {\"type\": \"Feature\", \"properties\": {\"ProductionPlace\": \"Plot 2\"}, \"geometry\": {\"type\": \"Polygon\", \"coordinates\": [[[-5.551, 7.541], [-5.548, 7.541], [-5.548, 7.538], [-5.551, 7.538]]]}}, {\"type\": \"Feature\", \"properties\": {\"ProductionPlace\": \"Plot 3\", \"Area\": 9}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [7.531204, -5.560113]}}]}",
    "producerCountry": "CI"
};

// Run the Actor and wait for it to finish
const run = await client.actor("nemata/eudr-geolocation-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 = {
    "geojsonText": "{\"type\": \"FeatureCollection\", \"features\": [{\"type\": \"Feature\", \"properties\": {\"productionplace\": \"Plot 1\", \"Area\": \"2.5\"}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [-5.547219, 7.539989]}}, {\"type\": \"Feature\", \"properties\": {\"ProductionPlace\": \"Plot 2\"}, \"geometry\": {\"type\": \"Polygon\", \"coordinates\": [[[-5.551, 7.541], [-5.548, 7.541], [-5.548, 7.538], [-5.551, 7.538]]]}}, {\"type\": \"Feature\", \"properties\": {\"ProductionPlace\": \"Plot 3\", \"Area\": 9}, \"geometry\": {\"type\": \"Point\", \"coordinates\": [7.531204, -5.560113]}}]}",
    "producerCountry": "CI",
}

# Run the Actor and wait for it to finish
run = client.actor("nemata/eudr-geolocation-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 '{
  "geojsonText": "{\\"type\\": \\"FeatureCollection\\", \\"features\\": [{\\"type\\": \\"Feature\\", \\"properties\\": {\\"productionplace\\": \\"Plot 1\\", \\"Area\\": \\"2.5\\"}, \\"geometry\\": {\\"type\\": \\"Point\\", \\"coordinates\\": [-5.547219, 7.539989]}}, {\\"type\\": \\"Feature\\", \\"properties\\": {\\"ProductionPlace\\": \\"Plot 2\\"}, \\"geometry\\": {\\"type\\": \\"Polygon\\", \\"coordinates\\": [[[-5.551, 7.541], [-5.548, 7.541], [-5.548, 7.538], [-5.551, 7.538]]]}}, {\\"type\\": \\"Feature\\", \\"properties\\": {\\"ProductionPlace\\": \\"Plot 3\\", \\"Area\\": 9}, \\"geometry\\": {\\"type\\": \\"Point\\", \\"coordinates\\": [7.531204, -5.560113]}}]}",
  "producerCountry": "CI"
}' |
apify call nemata/eudr-geolocation-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nemata/eudr-geolocation-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/LX4ng1HcetNJqo9fi/builds/06RouzRkyHqKDSGIH/openapi.json
