Someone sends you a zipped Shapefile and your web map wants GeoJSON. A GPS device exports GPX and the spreadsheet person wants CSV. A surveyor's file is in Nord Sahara 1959 and everything else you have is in WGS 84. Converting between GIS formats is a daily chore for anyone who touches maps.
The usual answers both have a cost. You can install a desktop GIS or the GDAL command-line tools, which is heavy if you convert a file once a month. Or you can use an online converter, which means uploading the file to a server you know nothing about. For parcel boundaries, customer locations or field survey data, that is often not acceptable.
gis-converter takes a third path. It is a web page that runs GDAL itself, compiled to WebAssembly, inside your browser. It reads Shapefile (zipped or as loose parts), KML/KMZ, GeoJSON, CSV, GPX and GeoPackage, reprojects, previews the data on a map and gives you the converted file. There is no server-side code at all: the built site is static files, and your data never leaves your machine.
What it does
Reads what you drop on it. Drop a file, or several shapefile parts, on the drop zone. The panel shows the driver that was detected, the layers with their feature counts and the detected coordinate reference system (CRS). The map previews the data in WGS84.
The file extension decides the driver. Loose shapefile parts are grouped by name, and the tool tells you when something is wrong: an error if the .dbf is missing, a warning if the .shx or .prj is. For CSV, the headers are inspected for lon/lng/x plus lat/y columns, or for a WKT/geometry column, and passed to GDAL as open options. The detection handles ,, ; and tab delimiters and a BOM.
Reprojects. Pick a target CRS from the presets: WGS 84, Web Mercator, WGS 84 UTM zones 29 to 32 North, and Nord Sahara 1959 (UTM 29 to 32 North, Nord and Sud Algérie). Any EPSG: code, PROJ string or WKT also works.
Fixes files with no CRS. A shapefile without its .prj does not say which coordinate system it uses. Set the source CRS override and the preview updates immediately. Under the hood, the override becomes -s_srs when there is a target CRS and -a_srs when there is none.
Writes each format properly. The converter builds the ogr2ogr arguments per format:
- GeoJSON follows RFC 7946 when the target is WGS84, and is written as classic GeoJSON with a
crsmember otherwise. - KML and GPX are always reprojected to WGS84.
- CSV writes the geometry as WKT, or as X/Y columns on request.
- Shapefile is written as UTF-8 and zipped with its
.shp,.shx,.dbf,.prjand.cpgparts.
Handles layers. Empty layers are skipped, which matters for GPX because it always exposes five. Single-layer formats (GeoJSON, CSV) take the first non-empty layer. Multi-layer GeoPackage or KML inputs convert all their non-empty layers when the output format supports several.
Previews on a map. The preview is a second ogr2ogr run to WGS84 GeoJSON, capped at 20,000 features, drawn with MapLibre.
How to use it
There is nothing to install: the README links a live demo, a static site on GitHub Pages, at https://abdeldjalilchougui.github.io/gis-converter/. Your files stay in the browser there too.
To run it locally or host your own copy:
git clone https://github.com/AbdeldjalilChougui/gis-converter.git cd gis-converter pnpm install pnpm dev # copies the GDAL runtime into public/gdal, then http://localhost:5173/gis-converter/ pnpm test # vitest (pure helpers) pnpm build # static site in dist/ (~40 MB, mostly the GDAL WASM + data) The production build uses the Vite base /gis-converter/ (see vite.config.ts). Change it if you serve the site from another path.
Then the workflow is four steps:
- Drop a file on the drop zone and read what was detected.
- Pick an output format and, if you need one, a target CRS.
- If the file has no CRS, set the source CRS override.
- Click Convert & download.
The code is organised so the logic can be tested without a browser. src/lib/formats.ts holds pure helpers: input detection, the output format registry, the ogr2ogr argument builder, CRS parsing, CSV column detection and layer picking. src/gdal.ts wraps gdal3.js: it opens files (using /vsizip/ for .zip and .kmz), reads the CRS through ogrinfo -json, runs ogr2ogr and reads the output bytes. GDAL runs in a Web Worker, so the page stays responsive during a conversion.
Things to know
- The first load is about 40 MB. That is the GDAL WebAssembly build and its data. It is cached afterwards.
- Large files are limited by browser memory.
- One input at a time. Only the first file is used, unless the files are parts of one shapefile.
- GeoJSON and CSV get only the first layer of a multi-layer input.
- Vector only. No raster formats, and no attribute filtering or field mapping yet.
- KML naming. The KML
NameFieldisname. Other attributes go toExtendedData. - CSV without a CRS is assumed to be in WGS84.
- The preview basemap is tile.openstreetmap.org, meant for light use.
What was tested. pnpm test runs 19 automated tests on the pure helpers: input planning (single files, zips, KMZ, loose shapefile parts with missing pieces, unsupported types), CRS parsing (EPSG spellings, PROJ, WKT, ESRI codes, garbage input), CSV column detection, the ogr2ogr arguments for every format, output names, a zip round trip and layer picking for GPX.
The GDAL integration itself was checked by hand in headless Chrome against the production build: CSV to Shapefile (EPSG:32631), KML, GeoPackage (EPSG:30731), CSV, GPX and GeoJSON; a zipped Shapefile in EPSG:30731 to GeoJSON, CSV and Shapefile; and GPX to GeoJSON, CSV and Shapefile. The README states clearly that these browser checks are not automated in CI.
Why I built it
Because the problem has two bad defaults. Installing a full GIS stack to convert one file is too much, and uploading a file to an unknown server is too trusting. GDAL already knows how to read and write all these formats correctly, and it now runs in the browser through gdal3.js. What was missing was a simple page around it: one that detects the input, explains what it found, offers the coordinate systems people here actually meet, including the Nord Sahara 1959 ones, and handles the annoying cases such as a shapefile that arrives without its .prj.
Keeping it a static site matters too. Anyone can host a copy on any file server, inside a company network if needed, and it will work without a backend to maintain.
Get the code
The source, the sample files and the tests are on GitHub: https://github.com/AbdeldjalilChougui/gis-converter. The project is MIT licensed. gdal3.js is LGPL-2.1 and GDAL is MIT/X, both served unmodified, and the basemap is © OpenStreetMap contributors.
Originally published at abdeldjalilchougui.biz.