Line to Polygon — Convert GeoJSON, Shapefile, KML and more

Convert closed LineString features into filled polygon geometry. Use these free browser-based tools to fill GPS tracks, cadastral boundaries, and closed contours into polygons — in any common vector format, without installing software.

What is line to polygon conversion?

Line to polygon conversion fills a closed line (one where the first and last coordinate are identical) into a Polygon geometry. The line is treated as the exterior ring of the polygon, and any additional closed lines that fall inside it are treated as interior rings (holes).

For the conversion to succeed, each line must be closed — its start and end coordinates must match — and must have at least four coordinate pairs (three unique vertices plus the closing repetition). Open lines that do not close cannot be converted and are skipped.

The conversion runs entirely in your browser using Turf.js. No data is ever sent to a server.

Common use cases

GPS track to territory

Convert a GPS track recorded along a boundary into a polygon to measure area, run spatial queries, or use in further analysis.

Cadastral boundary filling

Fill legal parcel boundary lines exported from a survey system into polygon features for overlay analysis and area calculation.

Contour to polygon

Convert closed elevation contour lines into polygon features for terrain analysis or visualisation of enclosed areas.

Digitised boundary conversion

Convert hand-digitised boundary lines from a CAD or legacy GIS system into standard polygon geometry for use in modern GIS workflows.

How to use

  1. 1

    Upload your line file (GeoJSON, Shapefile ZIP, KML, GeoPackage, or GML).

  2. 2

    The file is parsed in your browser using GDAL WebAssembly and converted to GeoJSON.

  3. 3

    Each closed LineString is filled by Turf.js into a Polygon feature. Open lines are skipped.

  4. 4

    The result is converted back to your chosen format and downloaded.

Frequently asked questions

Why are some lines not converted?

Lines must be closed — the first and last coordinate must be identical — and must have at least four coordinate pairs. Open lines cannot form a valid polygon ring and are skipped.

What happens to open lines in the input?

Open lines are silently skipped. Only closed lines produce polygon output.

Can I convert MultiLineString features?

Yes. Each component of a MultiLineString is evaluated individually — closed components produce polygon rings, and open ones are skipped.

Does this work on lines that nearly close but do not exactly?

The line must exactly close — the start and end coordinates must be numerically identical. If your GPS track has a very small gap at the closure point, you may need to edit the data first.

Visualization Tools

Grid Tools

Bounding Box Tools

Measurement Tools

Buffer Tools

Dissolve Tools

Centroid Tools

Simplification Tools

Data Inspection

Feature Selection Tools

Filter by Attribute Tools

Convex Hull Tools

Polygon to Line Tools

More Line to Polygon Tools

Explode to Points Tools

Flatten Multi-Geometry Tools

Combine Features Tools

Spatial Operations

Raster Operations

Rasterization Tools

Reprojection Tools

Coordinate Conversion Tools