GISela Shapefile to GeoJSON
Turn a zipped shapefile (.shp, .dbf, .prj) into GeoJSON in WGS 84 or another coordinate system.
How it works
Reads a zipped ESRI shapefile with GISela’s own parser — points, lines, polygons with holes, multipoints, Z/M records flattened to 2-D — with its attribute table (dBASE, code page from .cpg or the header) and the coordinate system from the .prj file, and writes GeoJSON. Several shapefiles in one ZIP give several files.
- The ZIP is unpacked in memory (stored and DEFLATE entries). Files with the same base name form one shapefile.
- .shp records are read after the ESRI technical description: Point, MultiPoint, PolyLine and Polygon with their Z and M variants (Z and M are dropped). Polygon rings are sorted into outer rings (clockwise) and holes (counter-clockwise) and nested by point-in-polygon tests.
- .dbf: dBASE III field types C, N/F, L and D; text decoded with the .cpg code page, else the header’s language driver id, else UTF-8 when it decodes cleanly, else Windows-1252.
- .prj: EPSG AUTHORITY codes first, then well-known ESRI names (UTM, ETRS89, Gauss–Krüger, LV95, British National Grid, Web Mercator), then Transverse Mercator parameters.
MultiPatch (3-D surfaces) and coordinate systems outside GISela’s list are not supported; such files are reported, not guessed.
Sources
Part of GISela
-
GISela Browser GIS
A GIS in your browser: layers, attribute tables, styling, analysis and print layouts.
How to convert a shapefile to GeoJSON
Turn a zipped ESRI shapefile into GeoJSON — with the coordinate system read from the .prj, attributes from the .dbf in the right character set, and a summary of what was in the file.
What it is for
The shapefile is still the most common way to exchange GIS data, but it is really four or five files: .shp (geometry), .shx (index), .dbf (attributes), .prj (coordinate system) and sometimes .cpg (character set). Web maps, scripts and most new software want GeoJSON instead. Upload the shapefile as a ZIP and this tool returns one GeoJSON file per shapefile, converted to WGS 84 or kept in its own system.
The reader is GISela's own: it handles points, multipoints, lines and polygons (also with Z or M values, which are dropped), polygons with holes, several shapefiles in one ZIP, and dBASE files in UTF-8 or the old Windows and DOS code pages.
Worked example
The first example is a ZIP with the six districts of an invented town, saved in Swiss LV95. The tool reports:
districts: Coordinate system recognised from the .prj name: EPSG:2056.
The summary lists 6 records, 6 features, geometry Polygon, encoding utf-8 and the fields name (text), population, households (numbers) and zone (text). The first district, Altstadt, starts at 7.989100004° E, 47.130999996° N in the GeoJSON; population 4820, zone mixed.
The second example keeps LV95: the same corner is written as 2,641,764.35, 1,220,147.987, and the GeoJSON gets the older crs member so that GIS programs can read the system.
How to read the result
- Write GeoJSON in — the output system. RFC 7946 GeoJSON is WGS 84; anything else uses the
crsmember. - Per shapefile — source system (from the
.prj, or the code you typed), encoding, geometry types, number of records and features, and the fields with their types. - What was read — notes such as how the coordinate system was recognised.
- Warnings — records without geometry, shapes that could not be read, or a missing
.dbf. - Download — one
.geojsonper shapefile.
Tips and common mistakes
- Upload a ZIP, not just the
.shp: without the.dbfthere are no attributes, without the.prjthe coordinate system is unknown. - No .prj? Type the EPSG code under Coordinate system of the shapefile. Without one, coordinates are read as WGS 84 — fine for degrees, wrong for metres (the tool warns when the numbers cannot be degrees).
- Odd characters such as
äinstead ofämean the wrong character set. A.cpgfile or the dBASE language byte usually tells; without either, the text is read as UTF-8 when it decodes cleanly and as Windows-1252 otherwise. - Dates in the
.dbfbecomeYYYY-MM-DDtext; logical fields become true/false. - Field names in shapefiles are at most ten characters; that is a shapefile limit, not something the tool can repair.
FAQ
Which .prj files are recognised?
Files with an EPSG code (AUTHORITY), the usual ESRI and OGC names of the supported systems, and any Transverse Mercator definition whose parameters match a UTM zone. Plain longitude/latitude files are read as WGS 84.
Are Z values kept?
No. Heights and measures are dropped; the tool notes that it did.
Can I convert GeoJSON back to a shapefile?
Yes, in the GISela app: open the GeoJSON, then Layer → Export… → Shapefile. The ZIP includes .shp, .shx, .dbf, .prj and .cpg.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://giselashapefiletogeojson.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://giselashapefiletogeojson.usefulweb.app/mcp· tool namegisela_shapefile_to_geojson
Example request
curl -s -X POST https://giselashapefiletogeojson.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'