# Turn a shapefile into a web map

Attach a zipped shapefile, ask for a styled interactive map with popups and filters, then publish it at a public link.

Video: Turn a shapefile into a web map (1 min 21 s): /images/docs/videos/shapefile-to-a-web-map.mp4

## Best for

GIS users who have a shapefile (exported from QGIS or ArcGIS, for example) and want it online as an interactive map that other people can open in a browser.

You end up with the shapefile as a dataset in your workspace, a styled map made from it with popups, a legend and a table, and a public link.

**The example in this guide** is a council's own planning file: Dún Laoghaire–Rathdown County Council's land use zoning for its County Development Plan 2022–2028, the shapefile as the council publishes it on Smart Dublin (CC BY 4.0). It holds 2,807 zones, each with one of 18 zoning objectives (Objective A, residential, covers the most zones), the objective's wording and its area in hectares, in Irish Transverse Mercator. With your own file, keep the shape of the asks and use your own field names. Results vary from run to run, so treat the figures here as one example.

## What you need

- **The shapefile as one .zip.** Put the .shp, .shx and .dbf in it, all with the same file name, plus the .prj (the coordinate system) and the .cpg if you have one (the text encoding). You can also pick the loose parts together in the file picker, and they are bundled into one zip for you.
- **A seat that can make things**: Free, Creator or Creator Max. A Viewer seat cannot attach files or publish.

## Before you start

- **Very large files.** See [Sizes and limits](/docs/workspace/sizes-and-limits). A file over a limit is never cut short, so filter or split it in your GIS first.
- **Coordinate system.** With a .prj, the declared coordinate system is used and the data is converted to longitude and latitude (WGS84). Without one, Mapstack checks what it can:
  - Coordinates that look like longitude and latitude are taken as WGS84, and the result says this was assumed.
  - Coordinates with no stated system are tested against a fixed list: EPSG:27700 (British National Grid), EPSG:9311 and EPSG:2163 (US National Atlas Equal Area), EPSG:3857 (Web Mercator), EPSG:4283 (GDA94) and EPSG:7844 (GDA2020). If one puts the data inside its area of use, it is applied. If more than one fits, Mapstack asks you. If none fits, the upload fails.
  - Coordinates that look like UTM metres with no zone to check fail. A zone is never guessed.
- **Geometry.** Points, lines and polygons are all supported. If the zip holds several shapefiles, Mapstack asks which to map.
- **Public means public.** A public map opens for anyone who has the link, with no sign-in, and is offered to search engines.

## The prompt

> Make a map from this shapefile of land use zoning. Colour the zones by ZoningObje, and show the objective wording from ObjectiveD and the Hectares in the popup.

## What to expect

1. **Attach the zip and send your prompt**

   Click **Attach file** (the paperclip in the message box), or drag the zip onto the message box. It shows as a chip and goes with your next message. If you know the coordinate system and the zip has no .prj, say it in the prompt, for example "it is in British National Grid".

   The council's zip goes in as it comes: LandUseZoning.shp, .shx and .dbf, with the .prj and the .cpg beside them.

2. **Mapstack reads the file and settles the coordinate system**

   Reading an attached file is part of your request, so Mapstack starts without asking again. It identifies the file by its content, lists the layers in the zip, and converts the data to WGS84. In the example the .prj declares Irish Transverse Mercator (IRENET95), so there is nothing to ask: the zones are converted from it.

   It stops and asks only when the choice is yours. If the zip holds more than one set of map data, it asks which should be mapped. If no coordinate system is declared and more than one fits, it asks which is right. If the data mixes shape types and none makes up 95% or more, it asks which should be kept. Every question also offers **None of these**.

3. **The shapefile becomes a dataset**

   You get a dataset with its record count, its shape type, its coordinate system, and how that was settled (declared, assumed, checked against where the data lies, or chosen by you).

   Mapstack also lists every fix it made, with a count. Examples: broken shapes repaired, field names renamed where they could not be used as written, garbled text recovered by reading it in another encoding, and features with no shape left out. Files kept for years carry a few of these: 9 of the 2,807 shapes in the council's file are not valid as drawn.

   The field names are the file's own. A shapefile holds at most ten characters in a field name, which is why the objective is ZoningObje and its wording ObjectiveD.

   > **Tip:** Your readers need not see ZoningObje. Say the words they should see instead: "show ZoningObje as Zoning objective in the legend and the popup". The file's own names stay in the dataset.

4. **Mapstack proposes the map, then makes it**

   For an open request, Mapstack first sends a short proposal: what it understands you want, the benefit, and the data it would use. Reply yes, or correct it. A request that already says exactly what to make can go ahead without one.

   Name a style if you want one. With no style named, every feature gets one symbol. Colour by category gives each value of a text or integer-code field its own colour (the ten most common, then "Other"): in the example, the ten objectives with the most zones, from Objective A's 1,437 to Objective A1's 22, each get a colour, and the other eight objectives, 73 zones between them, share "Other". Colour by number (a choropleth) classes a numeric field into five natural-breaks classes on a light-to-dark ramp, and can divide by a second field. Size by number draws proportional symbols. Point data can also be a heat map or clusters. Polygons can be extruded in 3D by a height field.

   The finished map arrives as a card in the chat. Open it to see the layer, its legend and a table of the records.

5. **Add popups, labels and filters**

   Ask in plain words. A popup opens when a reader clicks a feature, and you can say which fields it shows. Labels take a field or a short template. A filter can be fixed on the layer, so readers see only matching records, or it can be a control readers use themselves: a category, a number range or a date.

   An exact instruction is done without a proposal first. Anything you do not mention stays as it was.

   ![Example: the zoning map with one zone selected, a major town centre zone at Dundrum. Its pop-up shows the objective's wording from ObjectiveD and its area, 6.77 hectares.](/images/docs/shapefile-to-a-web-map/dlr-zoning-objectives.jpeg)

6. **Publish it**

   Publishing is done with a button on the open map. Mapstack cannot do it for you in the chat.

   Click **Publish** and choose **Public**. Select **Make public**. The dialog then offers **Copy link** and **Open public page**. The public address starts with /m/. The map stays **Private (default)** until you do this, which means only people with a seat in your workspace can view it.

   Making a map public also puts it forward for the Community Library, where it is reviewed before it is listed. Switch it back to **Private (default)** and it is removed from there.

## Make it your own

> Add a filter so readers can pick one or more zoning objectives

> Only show zones where Hectares is greater than 1

> Colour the zones by GZTCategor, the generalised zoning type, instead

> Add the Link field to the popup as a link to the plan chapter

> Call ZoningObje "Zoning objective" in the legend and the popup

## Common questions

**Which files do I need to attach?**

The .shp, .shx and .dbf with the same file name, plus the .prj and the .cpg if you have them, in one .zip or selected together in the file picker. Sidecar files without the .shp, or one part on its own, are refused, and Mapstack names any part that is missing.

**What if my shapefile has no .prj?**

Mapstack tests the coordinates against a fixed list of common systems and uses the one that fits, asking you if more than one does. If none fits, it does not place the data by guesswork: re-export with the .prj, or tell Mapstack the system, for example "it is in British National Grid".

**Why are my field names cut short?**

A shapefile holds at most ten characters in a field name, so long names are cut when your GIS writes the file. Mapstack keeps the names as they are in the file. Ask for the wording readers should see: 'Call ObjectiveD "Objective" in the popup'.

**Why is some text garbled?**

The text encoding was not recorded. Mapstack recovers text where it can, reading it as Windows-1252, ISO-8859-1 or UTF-8, and reports it as a fix. Include the .cpg in the zip: it records the encoding.

**Who can publish the map?**

Anyone with a Free, Creator or Creator Max seat: select **Publish** on the open map, then **Public** and **Make public**. A Viewer seat has no **Publish** button.

## Related

- [Upload a file](https://mapstack.io/docs/your-data/upload-a-file.md)
- [Make a map](https://mapstack.io/docs/make/maps.md)
- [Make something public](https://mapstack.io/docs/share/make-it-public.md)
- [Edit your data and undo changes](https://mapstack.io/docs/your-data/edit-your-data.md)
