Jump to content
We've recently updated our Privacy Statement, available here. ×
  • Creating custom Shapefiles for Spotfire®


    Spotfire comes with a selection of geocoding hierarchies stored in the Library to create maps automatically. You can also use your own geocoding tables by importing Shapefiles (.shp) and data tables downloaded from the web (see: Where to find geographic data sources for Spotfire?).

    For most common map analysis, the geographical data already exists in the form of administrative areas (Country, States, Counties, Zip codes, Cities etc.) that you can match with your data as Marker or Feature Layer in a Spotfire Map chart. But the more particular and specialized a project is, the less likely it is that the data will already be available.

    This article provides guidance on how to digitize custom geographic areas by creating a Shapefile (or map feature, or polygon) using QGIS to use in Spotfire.

    QGIS is a free, open source professional GIS software available for Windows, macOS and Linux used to create and edit geospatial information. The instructions below are based on QGIS 3.0.

    Getting started with QGIS

    The QGIS User Interface

    1. gui_0.thumb.png.3fa0e03a47c356e4df92f619018edbd7.png
    2. The Menu bar provides access to all features
    3. The Toolbar provides shortcuts access to most common features
    4. The Layers panel contains the list of map features in the project
    5. The Map view displays map layers
    6. The Status bar shows the map position of the mouse pointer across the Map view and the applied Coordinate Reference System (CRS)

    Drawing your own Shapefile

    Add a map background

    Adding a map background will help us draw map features according to the geography. QGIS offers OpenStreetMap (OSM) as built-in map background. Here is how to enable OSM as a new map layer:

    1. Go to Layer > Data Source Manager



    2. You are presented with the following dialog:


    3. Double click "OpenStreetMap" to add it to your Map view

    You now have a map background you can pan and zoom using the controls available from the Toolbar.


    We are ready to create our first custom map feature.

    Create a new Shapefile

    Before you can draw custom map features, you need to create a vector dataset to add it to. In our case, we will create a new feature rather than editing an existing dataset. Therefore, we need to define our own new dataset first.

    1. Create a new Shapefile layer from Layer > Create Layer > New Shapefile Layer...




    2. You are presented with the following dialog:



    3. Name your Shapefile
    4. Set the geometry type. In this example we are going to create new features which describes geographical areas. For such features, you need to create a Polygon geometry type.
    5. Next there is a collection of fields grouped under the Fields list. By default, a new layer has only one attribute, the ID field. However, in order for the data to be useful, you actually need to say something about the feature you create in this new Shapefile layer because this what you will use in Spotfire to match it with your data. For our current example, it will be enough to add on field called "Name".
    6. Click OK to save.

    Your new Shapefile was added to the Layers panel. We can now draw map features into it.

    Draw map features

    By default, QGIS Layers are locked so we need to enable editing our Shapefile.

    1. Pan and zoom the map to the geographical area of interest.
    2. Right click the Shapefile layer you just created from the Layers panel and select Toggle Editing



    3. Enable adding map features from Edit > Add Polygon Feature


    4. Start creating a map feature directly from the Map view by clicking on the map for each point you wish to include in your polygon.



    5. Once your done drawing your first map feature, right click anywhere on the Map view to finish.
    6. The attribute dialog is presented. Input a unique id and a name for your polygon and click OK to save.



    7. Replicate this process to create all additional polygons you need in this same Shapefile.

    For this example we created 3 polygons in the same Shapefile layer to represent the southern, northern and eastern areas.


    We are ready to use this Shapefile in Spotfire. Lets export it to a workable file.

    Export as Shapefile to use in Spotfire

    Now that we created our custom features in QGIS, we need to export the Shapefile layer for use in Spotfire.

    1. Right click the Shapefile layer you just created from the Layers panel and select Save As...


    2. You are presented with the following dialog:



    3. Select ESRI Shapefile as file format
    4. Choose where to store your Shapefile and name it
    5. The next field allows you to specify the Coordinate Reference System (or CRS). A CRS specifies how to describe a point on earth in terms of coordinates, and because there are many different ways to do this, there are many different CRSs. Spotfire default CRS for Layers is EPSG:4326 - WGS 84. Lets select this CRS for your new Shapefile.
    6. Click OK to save. You new Shapefile is ready to use in Spotfire

    You can now launch Spotfire, open your Shapefile and create a Map chart to visualize to visualize your custom Shapefile.


    User Feedback

    Recommended Comments

    There are no comments to display.

  • Create New...