Shapefile · format guide
Shapefile to GeoJSON
A Shapefile is not one file but a set: .shp holds geometry, .dbf holds attributes, .prj holds the projection and .shx is an index. Zip the set and drop it in. MapCrafter reads all the parts, reprojects to WGS84 when a .prj is present, and exports clean GeoJSON.
What a Shapefile file is
Shapefile is a 1990s format that refuses to die, because every government agency and every GIS desktop still writes it. It is also the most awkward format in common use: it is a folder of sibling files that must travel together and share a base name, and it has hard limits baked into its structure.
The .dbf attribute table is the source of most of the friction. Field names are capped at ten characters, so population_millions becomes POPULATION or similar, and there is no boolean type, no null, and a limit of 255 columns. A round trip through Shapefile quietly loses information that was present in the source.
The .prj file is the other thing that matters and the one most often missing. Without it, the coordinates are just numbers with no declared meaning, and a file in a national grid will land in the wrong hemisphere. When a .prj is present MapCrafter reprojects to WGS84 on import; when it is absent, the coordinates are assumed to be degrees and you are warned.
What MapCrafter reads from it
- A zip containing .shp, .dbf and .shx
- The minimum set; all three are required to read geometry and attributes together
- An optional .prj
- Used to reproject to WGS84. Without it, coordinates are assumed to be decimal degrees
- .cpg code pages
- Used to decode attribute text, which otherwise mangles accented characters
- Point, line and polygon geometries
- All three, including their multi- variants, in one file
- Multiple shapefiles in one zip
- Each readable dataset is imported as a separate layer
Mapping a Shapefile file, step by step
- 1
Zip the shapefile set
Select .shp, .dbf, .shx and .prj together and zip them. The names must share a base name.
- 2
Drop the zip in
Every shapefile in the archive is listed with its geometry type and feature count.
- 3
Check the projection
If a .prj was present the data is reprojected to WGS84. If it was missing, you will be told that degrees were assumed.
- 4
Export as GeoJSON
Attribute names come out as they were stored, so keep the ten-character truncation in mind when you match columns.
Things that go wrong with Shapefile
Every one of these is a property of the format rather than a bug in a particular tool, which is why they keep happening.
Only the .shp was sent and nothing loaded.
A lone .shp has geometry but no attributes and no index. Without the .dbf there are no columns to style by, and without the .shx some readers cannot seek. Always send the set, zipped.
Column names came out truncated or renamed.
A hard limit of the format: DBF field names are capped at ten characters. FID, AREA and PERIMETER are reserved and may be silently renamed on write, which is why so many government datasets have columns called POP_EST or similar.
Accented characters are garbled.
The .dbf has no declared encoding. A .cpg file stating the code page fixes it; without one, the reader guesses and sometimes guesses wrong. Adding a one-line .cpg containing UTF-8 is worth doing before you send a file to anyone.
The data is in the wrong place entirely.
Missing or ignored .prj. A Shapefile in a projected coordinate system without its .prj will be read as degrees, which puts it thousands of kilometres away. If you have the projection name, reproject to WGS84 with ogr2ogr first: ogr2ogr -t_srs EPSG:4326 out.shp in.shp
Attribute values lost their decimal places.
DBF numeric fields have a declared width and precision. A value that does not fit is truncated on write, not on read, so the loss happened when the file was created.
Nothing about the geometry is editable.
Shapefile has no support for curves, no true null geometry, and one geometry type per file. If you need any of those, GeoJSON or a geodatabase is the right container.
Shapefile maps in the gallery
2 live maps built from Shapefile data, each showing its source columns and the geometry that was detected.
- ChoroplethPopulation density by stateDensity computed from two columns, population and land area, rather than plotted directly. Deriving a field from the source table is the difference between a map of what you measured and a map of what you meant.
- Service areasUrban areas from a zipped ShapefileA Shapefile arrives as a folder of files that has to be zipped before it can be sent anywhere. MapCrafter reads the zip directly, pairing the .shp geometry with the .dbf attribute table and honouring the .prj projection if one is present.
Shapefile questions
- How do I convert a Shapefile to GeoJSON?
- Zip the .shp, .dbf, .shx and .prj together, drop the zip into the studio, and export as GeoJSON. Attributes are carried across, and the projection is applied if a .prj was present. No desktop software and no command line.
- Why does a Shapefile need to be zipped?
- Because it is not one file. The geometry lives in .shp, the attributes in .dbf, the index in .shx and the projection in .prj, and they are only meaningful together. Zipping is the only reliable way to keep them together when sending them.
- What if I do not have the .prj file?
- The coordinates are read as decimal degrees and you are warned. If they are actually in a projected system the map will be wrong by a large margin, so it is worth recovering the projection before importing. Common ones are Web Mercator (EPSG:3857) and national grids such as EPSG:27700 for Great Britain.
- Can MapCrafter export Shapefile?
- No. GeoJSON is the export format, because Shapefile would truncate your column names to ten characters and drop types it cannot express. GeoJSON to Shapefile is a lossy direction, so it is not offered.
- Does it handle large Shapefiles?
- It handles them as well as the browser can, since the file is read client-side. Anything above about 100 MB is better simplified first with mapshaper, which can also convert to TopoJSON for a much smaller file.
Other formats MapCrafter reads
Start with your own fileLast updated 2026-10-22.