Geometry Simplifier: Reduce GeoJSON and Shapefile Size
Reduce file size by removing unnecessary vertices from polygons and lines. Choose a method and amount, compare before and after on the map, and see vertex counts and area change.
1 File
2 Method
3 Amount
Your file is processed on your device in a background worker (Web Worker); its contents are not sent to any server. The preview map's basemap tiles are downloaded from Esri and OpenStreetMap servers, which only see the map area on screen.
Related Tools
What geometry simplification is for
Polygons such as province, district or parcel boundaries are often produced from large-scale surveys, with a vertex every few metres along a coastline. That detail is invisible when the whole dataset fits on a screen, yet it inflates the file. On a web map a large GeoJSON must first be downloaded, then parsed in the browser, and every vertex drawn; as the vertex count grows, the page opens later, panning and zooming slow down, and mobile devices may hit their memory limits. Simplification keeps the vertices that carry the shape and removes the rest, so the file suits the scale at which it will be shown.
How to use it
- Load a GeoJSON, shapefile or KML file. For a shapefile, choose the .zip archive or select the .shp, .dbf and .prj files together.
- Choose a method and set the amount with the slider. In percentage mode you set the share of vertices to keep; in tolerance mode you set a threshold in metres.
- On the map, the dashed grey line is the original and the red line the simplified result. Vertex count, estimated file size and area change update with every setting.
- Choose the coordinate precision and download the result as GeoJSON, TopoJSON or a shapefile.
Douglas-Peucker or Visvalingam
Douglas-Peucker joins the two ends of a line and keeps the vertex farthest from that segment if its distance exceeds the tolerance, then repeats on both halves. Because the tolerance is a plain distance limit in metres, the result is predictable. It keeps sharp corners, but at high reduction shapes can look spiky and jagged. Visvalingam-Whyatt rates each vertex by the area of the triangle it forms with its neighbours and removes the one that costs the least area, step by step. On natural boundaries such as coastlines and rivers it gives smoother, more natural-looking results, which is why it is often preferred for small-scale thematic maps. For engineering data with straight edges, such as roads, networks and parcels, Douglas-Peucker is usually the better fit.
Preserving topology
Two neighbouring provinces share a border. If each polygon is simplified separately, that border is redrawn twice with different vertices, and thin gaps or overlaps appear between them. With topology preservation on, the tool first splits shared borders into arcs, simplifies each arc once and uses the same arc in both neighbours. The nodes where borders meet stay fixed. Stand-alone rings such as small islands keep their most important vertices so that they remain at least a triangle.
Coordinate precision
In geographic coordinates each decimal place describes a position roughly ten times finer: 5 decimals is about 1 metre, 6 decimals about 11 centimetres. Many files carry up to 15 decimals, far beyond any survey accuracy, which only makes the file larger. Reducing precision shrinks the file noticeably, independently of simplification. In metric systems, 2 decimals correspond to centimetres.
Effect on analytical accuracy
Simplification is meant for display. Line lengths and perimeters always get shorter, because bends are straightened. Area can change in either direction; bays and headlands partly cancel out, but in small or deeply indented polygons the change can be significant. The tool therefore reports the total change in area and length, as well as the feature whose area changed most. Official area figures and analyses such as intersection, buffering and point-in-polygon matching should use the original data, with the simplified copy used only for display. Simplification can also make edges of some polygons cross; the tool counts these cases and warns you.
Data and method
Reading, topology building, simplification and output are done in a background worker (Web Worker) so the page stays responsive with large files. An importance value is computed once for every vertex, and the slider only applies a threshold to those values. For geographic data, distances are measured in metres on a Mercator plane scaled to each point's latitude. Areas use the spherical polygon formula and lengths the great-circle distance. Topology is built with topojson-server 3.0.1 and topojson-client 3.1.0 (ISC licence); the simplification algorithms, validity check and shapefile writer are this page's own code. Shapefiles are read with shpjs 6.1.0 (MIT), zip files with JSZip 3.10.1 (MIT), KML with @tmcw/togeojson 5.8.0 (BSD-2-Clause), and projected data is previewed with proj4js 2.9.0 (MIT). Basemaps belong to Esri and OpenStreetMap contributors. Z values are removed and the output is two-dimensional. Open-source libraries used and their licences: Data Sources.
For web map applications that serve simplified layers by zoom level, or for automating data preparation in a larger project, you can reach the team through the contact page or visit Rodosto Teknoloji.
Frequently Asked Questions
Why do gaps appear between neighbouring polygons after simplification?
If each polygon is simplified on its own, the border two neighbours share is redrawn twice with different vertices, leaving slivers and overlaps. The topology option simplifies each shared border once and uses the same line in both polygons, so borders stay coincident.
What is the difference between percentage and tolerance?
Percentage mode sets the share of vertices kept across the whole dataset and is the direct way to target a file size. Tolerance mode uses a threshold in metres; for Douglas-Peucker it is the largest distance a removed vertex may lie from the simplified line, and for Visvalingam it is the square root of the effective triangle area.
Can I calculate areas with simplified data?
It is not recommended. Simplification changes area and, above all, perimeter length. The tool reports the total and per-feature area change, but official area figures and analyses such as intersection and buffering should use the original data. Simplified data is meant for display.
Is my file uploaded to a server?
No. Reading, simplifying and writing the output happen in your browser in a background worker, and the file contents are not sent to any server. Only the basemap tiles of the preview map are downloaded from Esri and OpenStreetMap servers.