Polygon to Line — Convert GeoJSON, Shapefile, KML and more
Convert polygon features to their boundary LineString representations. Use these free browser-based tools to extract the rings of any polygon dataset as line geometry — useful for cartographic styling, network snapping, and format conversion workflows.
What is polygon to line conversion?
Polygon to line conversion extracts the exterior and interior rings of polygon features and represents them as LineString or MultiLineString geometry. The resulting lines trace the exact boundaries of the original polygons but have no fill — they are pure linear features.
This operation is the geometric inverse of line-to-polygon conversion. Each polygon produces one or more lines: the outer ring becomes one LineString, and any interior rings (holes) become additional LineStrings.
The conversion runs entirely in your browser using Turf.js. No data is ever sent to a server.
Common use cases
Cartographic boundary extraction
Extract administrative boundaries, parcel edges, or coastlines as lines for cartographic styling — lines can be styled independently of polygon fills.
Network snapping
Convert building footprints or parcel boundaries to lines so that road centrelines or utility networks can be snapped to polygon edges.
Linear referencing
Convert a polygon boundary to a line before computing lengths, running along-line queries, or splitting the boundary at specific distances.
Format interoperability
Some workflows require linear geometry rather than polygons — convert polygon data to lines for use in systems that expect LineString input.
How to use
- 1
Upload your polygon file (GeoJSON, Shapefile ZIP, KML, GeoPackage, or GML).
- 2
The file is parsed in your browser using GDAL WebAssembly and converted to GeoJSON.
- 3
Turf.js extracts the boundary rings of each polygon as LineString features.
- 4
The result is converted back to your chosen format and downloaded.
Frequently asked questions
What happens to polygon holes (interior rings)?
Each interior ring is extracted as a separate LineString feature. A polygon with two holes will produce three lines: one outer ring and two inner rings.
Does this work on MultiPolygon features?
Yes. Each constituent polygon in a MultiPolygon is processed separately, producing lines for all its rings.
Will the output lines be closed?
Yes — polygon boundary rings are always closed, so the output lines will have the same first and last coordinate.
What if my file contains a mix of polygons and non-polygons?
Only polygon and multi-polygon features are processed. Point and line features are ignored.