How to Export Excel Data to GeoJSON File

Add-in GIS.XL allows you to export map data from the Map panel in vector format – GeoJSON file. This format is useful, especially if you want to display your spatial data online. GeoJSON format is supported by a variety of technologies, such as Leaflet.js. Therefore, this feature was added to GIS.XL 2.0.

For example, we use the map layer of polygons that are shown in the following figure. In this case, we display the geological structure of the selected area in the WGS-84 projection. The color of individual polygons is defined by the IDSRF column from the attribute table. In the following part, we’ll show you how to export this map layer in GeoJSON format. GIS.XL 2.0 allows you to export polygons, lines and points to the GeoJSON file. The current version does not support multipart features, such as multipoint, multipolygon or multilines. Supported features are only point, line and polygon. In the case of polygons, supported are also polygons with holes.

To export data, click on Special – Export to GeoJSON.

Clicking on this item will display the dialog as in the following figure. In this dialog, you can setup the GeoJSON export. You can choose from two export modes – Selected Layer of All Visible Layers. If you set the Selected Layer mode, only one selected map layer will be exported. In our case, we choose one layer of polygons.

If you choose the second mode – All Visible Layers, the program exports all map layers from the Map panel (points, lines and polygons) that are visible (property Visible = TRUE). These layers will be exported in the same order as they are displayed in the Map Panel.

Using the Export with Attribute Data check-box, you can set whether you want export also the data from the shapefile attribute table. The second check-box – Export with Visual Properties define whether the visual properties (supported by GeoJSON format) will be exported, such as polygons fill color, transparency, or the border line thickness. If you have set all necessary parameters, you can click the Apply button to define the name and location of the GeoJSON file.

The program export selected spatial data to GeoJSON file and the export speed depends on the size of shapefile and size of attribute table. The user is informed about the export finish via a message-box.

The resulting file can be opened in any text editor.

Exported file can be used in other third-party technologies. An example is visualization using a simple online service for visualizing GeoJSON data –

Keep in mind that if you want to visualize your data in the online environment, you need to have the Map panel projected on the WGS-84 projection (default). If you are using a different projection, GeoJSON data may not be displayed correctly.