LearnAll blog articles

EUDR

How to convert KML to EUDR-ready GeoJSON

A KML is already in WGS84, so there is nothing to reproject. The work is everything else — placemarks that aren't plots, attributes buried in ExtendedData, six decimals.

A handheld GPS receiver resting on a wooden gatepost at the corner of a smallholding, with the mapped field boundary running away behind it

A KML file is already in WGS84 and already writes its coordinates as longitude first, so the conversion step that eats an afternoon with a shapefile simply isn’t there. One command does it:

ogr2ogr -f GeoJSON plots.geojson plots.kml -lco RFC7946=YES -lco COORDINATE_PRECISION=6

The hard part is what comes after. A KML is a map — it holds whatever someone drew or walked, including tracks, waypoints, routes and notes. An EUDR GeoJSON file is a register of production places, and most of the work is deciding which placemarks are plots, then supplying the two things a KML has no way of carrying: the producer country and the plot area.

This walks through both halves — the conversion, then the six things that stand between a converted KML and a file the EUDR Information System will work with.

The rules below come from Regulation (EU) 2023/1115 (EUDR), the European Commission’s EUDR GeoJSON File Description v1.5 (linked from the EUDR Information System page), the EUDR Operator API Reference v1.0 for API V3, and the GeoJSON standard, IETF RFC 7946. Statements about how KML itself is written describe the file format, not a legal requirement — you can confirm every one of them by opening a KML in a text editor.

What the EUDR asks of a location

Article 2(28) of Regulation (EU) 2023/1115 (EUDR) defines geolocation as “the geographical location of a plot of land described by means of latitude and longitude coordinates corresponding to at least one latitude and one longitude point and using at least six decimal digits; for plots of land of more than four hectares used for the production of the relevant commodities other than cattle, this shall be provided using polygons with sufficient latitude and longitude points to describe the perimeter of each plot of land”.

Two numbers carry most of the weight: six decimal digits and four hectares.

Article 9(1)(d) of the same Regulation adds the cattle carve-out. For relevant products that contain or were made using cattle, the geolocation “shall refer to all the establishments where the cattle were kept”. For all other relevant products of Annex I, it refers to the plots of land.

Swipe to see the whole picture →
A KML document holds placemarks nested in folders. Points and polygons convert into production places; lines, tracks, paths and mixed multi-geometry placemarks do not and are reported rather than guessed. Converted places then face four EUDR gates: at least six decimal digits with API V3 truncating to six, a polygon for any plot over four hectares with cattle establishments excepted, rings that close and never cross themselves and carry no holes, and ProducerCountry as an ISO 3166-1 alpha-2 code. A KML carries no ProducerCountry and no Area of its own.
Every number here is cited below. Clearing these gates is a format result, not acceptance and not a compliance verdict.

Doing the conversion

Three routes, depending on what you have open.

Drop it into a validator that reads KML directly. Clearlane’s free EUDR GeoJSON validator and repair tool takes .kml and .kmz as-is, converts them, runs the cited rule profile, draws the plots on a map and hands back a .repaired.geojson. For KML this collapses the conversion and the checking into one step, which is the honest reason to start here: you find out what’s wrong at the same moment you convert. The file stays in your browser and there’s no account.

With ogr2ogr (part of GDAL, free):

ogr2ogr -f GeoJSON plots.geojson plots.kml \
  -lco RFC7946=YES \
  -lco COORDINATE_PRECISION=6

No -t_srs here. KML is defined in WGS84, so there is no reprojection to do — and if you pass -t_srs EPSG:4326 anyway, nothing bad happens, it’s just a no-op.

With QGIS: open the .kml, right-click the layer → Export → Save Features As, choose GeoJSON, leave the CRS at EPSG:4326 — WGS 84, and under Layer Options set RFC7946 to YES and COORDINATE_PRECISION to 6.

Whichever route you take, look at the result on a map before anything else. A KML from a phone drawn in the wrong field looks perfectly valid in a text editor.

Why a KML usually holds more than your plots

Mapping apps save everything into one document. A KML exported from a field survey routinely contains the plots you want plus the road you drove in on, three photo waypoints, a boundary you sketched and abandoned, and a folder from last season.

Placemarks also nest. Document holds Folder, a Folder holds more Folder elements, and placemarks sit at any depth. A converter that only reads the top level silently drops most of the file — and “silently” is the problem, because you get a valid GeoJSON with four plots in it and no hint that eleven others existed.

Two shapes convert cleanly into a production place: a Point, and a Polygon (several polygons in one placemark become a MultiPolygon). Two do not:

  • LineString and LinearRing placemarks — a walked track or a drawn path. A line is not an accepted production-place geometry, and a track that happens to end where it started is still not a polygon. If the track is the boundary you meant, close it into a polygon in your GIS before converting.
  • Mixed MultiGeometry — a placemark holding a point and a polygon together. It can’t become one production place, because it isn’t one.

Anything that can’t be converted should be reported to you by name, not quietly dropped and not guessed at. Clearlane’s tool lists each unconverted placemark with the reason; if you’re converting by hand, count the <Placemark> elements in the source and count the features in the output, and make the difference add up.

The six things to fix after converting

What the KML gives you What EUDR GeoJSON needs What to do about it
No producer country anywhere in the format Type II files need ProducerCountry on every production place, as a valid ISO 3166-1 alpha-2 code Add it after conversion. It cannot have survived, because it was never there
No plot area unless someone typed one into a field Area in hectares, needed for any point that stands for a real plot Add it, or use a polygon and let the area come from the geometry
Attributes hidden in <ExtendedData> or dumped as HTML in <description> Plain GeoJSON feature properties Map ExtendedData name/value pairs to properties; anything left as an HTML blob has to be pulled apart by hand
A third altitude value on every coordinate Two-dimensional production-place geometry Drop the altitude. Height above sea level says nothing about a plot boundary
Google Earth polygons can carry <innerBoundaryIs> holes One contiguous production area per polygon; interior rings are not accepted Removing a hole changes the declared area, so decide it yourself rather than letting a tool do it
Full GPS precision, often ten or more decimals At least six decimal digits (Art. 2(28)); API V3 truncates to six under business rule GEO-CORD-10 Truncate to six yourself, then re-check the geometry — truncation can merge nearby vertices

The first two rows are the ones that surprise people. A shapefile at least has an attribute table you can rename columns in. KML has no equivalent concept of a producer country or a plot area at all, so those values have to come from your own records — a supplier list, a farm register, a spreadsheet — and be joined onto the features after the conversion. Budget time for it. On a file of two hundred smallholder plots this is the whole job, and the geometry is the easy part.

The precision row deserves a second look, because it’s the only one that can turn a valid file into an invalid one after it passed. Six decimals is the floor set by Article 2(28) and, in practice, also the ceiling: API V3 cuts coordinates to six decimals. If two vertices of a small plot differ only in the seventh decimal, truncation merges them. A ring that loses vertices can end up with adjacent duplicates or zero area — valid before truncation, broken after it.

Rings also have to close: the last position of a polygon ring must repeat the first, which is RFC 7946 §3.1.6 and also what makes it a ring rather than a line. Most exporters do this. Hand-edited KML often doesn’t.

Worth checking all of this before you spend the afternoon on it. Drop the KML into the free validator and you’ll see in a minute which placemarks converted, which didn’t, and which of the six rows above are still open on your file.

Point or polygon for each plot?

Over four hectares, non-cattle: you need a polygon with enough points to describe the perimeter. That’s Article 2(28), quoted above.

The trap is on the other side. A Point feature with no Area property is not read as “size unknown” — the EUDR system treats it as four hectares. So an unsized point makes a claim about the plot rather than leaving a blank, and if the plot is bigger, the file says something untrue about it.

This bites harder with KML than with almost any other source format, because a phone GPS app’s natural output is a point. Someone standing in the middle of a twelve-hectare farm and tapping “save location” produces a placemark that converts perfectly and describes the wrong thing.

Where the Area property is present it has to be a positive number of hectares, and the current API V3 reference sets a minimum of 0.0001 hectares. Between 0.0001 and 0.1 hectares, the current V3 reference and the older EUDR Validation Rules v1.3 disagree about the floor, so values in that band are worth a human look rather than a shrug.

The cattle exception is real and narrow. Article 9(1)(d) points cattle geolocation at the establishments where the animals were kept, so an establishment can be a single point whatever its size. It applies to cattle. It is not a general way out of walking a boundary.

Type I or Type II — which am I making?

The Commission’s file description defines two variants, and two checks differ between them:

Type I Type II
Geometry types accepted Point, Polygon, MultiPolygon, GeometryCollection Point, MultiPoint, Polygon, MultiPolygon
ProducerCountry Validated when supplied Required on every production place

Neither list contains LineString, which is why a track has nowhere to go. If a converted file passes for you and fails for your supplier, a variant mismatch is the first thing to rule out.

What about KMZ?

A KMZ is a zipped KML. Inside it there’s a doc.kml — that’s the part that matters — usually alongside icons, overlay images and photos that have nothing to do with the geometry. Unzip it and convert the .kml, or hand the .kmz to a tool that does that for you.

Two practical notes. A KMZ can be small on disk and very large unzipped, so a file that looks harmless can turn into hundreds of megabytes; Clearlane’s tool refuses an entry that inflates past a fixed cap and only ever unpacks the .kml, never the images. And the photos are usually why your KMZ is big — stripping them changes nothing about the plots.

How many plots fit in one declaration?

Relevant if you’re converting a KML of smallholder plots, which is where KML files usually come from.

The Commission’s May 2026 Operator API V3 reference documents these limits for an assembled declaration: 100 commodities per declaration, 1,000 producers per commodity, 10,000 producers per declaration, 500 scientific-name and common-name pairs per commodity, and 2,000 grouping references. The assembled declaration’s geolocation data is capped at 25,000,000 bytes — a plain decimal count, not the 1,048,576-byte “MB” some file managers display, so a file your computer calls 24.5 MB is already over.

That’s a limit on the declaration, not on your KML. But detailed polygons at full GPS precision are exactly what inflates it — one more reason to write six decimals rather than twelve.

What a converted file still doesn’t prove

A file that clears every check above has passed format and data-quality checks. It has not been accepted by the EUDR Information System, and it is not a legal or compliance verdict.

It doesn’t prove the commodities are deforestation-free. It doesn’t prove they were produced in accordance with the relevant legislation of the country of production. It doesn’t complete your risk assessment or any mitigation that assessment calls for. Under Article 3 of Regulation (EU) 2023/1115 (EUDR), relevant commodities and products may not be placed or made available on the market or exported unless they are deforestation-free, have been produced in accordance with the relevant legislation of the country of production, and are covered by a due diligence statement or a simplified declaration as required by that Regulation. Getting the geometry right is the first step of one of those three.

Satellite and remote-sensing evidence sits in the same category. It can support a risk assessment and flag a change worth investigating. On its own it doesn’t prove goods are deforestation-free, legally produced, or correctly linked to your supply chain.

The operator stays responsible for the full due diligence assessment and for the statement submitted to the authority.

Convert, then triage, then fill in what KML can’t carry

The conversion is one command and it’s genuinely easy — no reprojection, no axis swap, no attribute table to untangle. Where a KML costs you time is deciding which placemarks are production places, and sourcing the producer country and plot area that the format never held in the first place.

Drop your file into the free EUDR GeoJSON validator and repair tool to see where you stand in a minute. Each blocking check also has its own page in the EUDR error catalogue, with the source it comes from and the fix.

Clearlane prepares and validates the data. It does not file to the EUDR Information System or any registry on your behalf.

This article is educational guidance, not legal advice or a compliance verdict.