top of page

GeoJSON or Shapefile? Understanding the Pros and Cons of Each GIS Format

Selecting an appropriate file format for geographic data will have a drastic effect on how you share the data, the efficiency of analyzing the data, the amount of storage you need to maintain the data, and how easily you can work with data from separate sources. The two most commonly used GIS formats are ESRI Shapefile and GeoJSON.


ESRI Shapefile has been the GIS format used by most organizations for many years. However, GeoJSON has become the preferred GIS format for web mapping and contemporary geo-spatial applications. Knowing the advantages and disadvantages of both formats will allow GIS professionals, developers, and organizations to make an educated choice when selecting the best GIS file format for their projects.


GeoJSON or Shapefile
GeoJSON or Shapefile


What Is a Shapefile?


The Shapefile format is one of the oldest vector-based GIS formats developed by ESRI during the mid-'90s decade, which is still widely used today by many companies. The word "Shapefile" is somewhat of a misnomer in that there is no single file named this, but rather a combination of files that work together to store both spatial information and attribute data as well.


Common files contained within a Shapefile dataset are:


  • .shp - Stores geometry information

  • .shx - Stores shape index information, which allows the application to quickly access geometries in the shapefile

  • .dbf - Stores attribute data about the geometries in the shapefile

  • .prj - Stores the coordinate system information in which the geometries are defined

  • Other optional files for metadata purposes or for index building


Shapefiles are capable of storing vector-type data and can have the following types of geometries:


  • Point

  • Line

  • Polygon


The widespread and industry usage of Shapefiles has made them compatible with almost every major GIS application.


What Is GeoJSON?


GeoJSON is an open standard file format that uses JavaScript Object Notation (JSON) as its base and can be used to display geo-referenced data in a variety of styles as well as basic attribute information. All of the data associated with a GeoJSON file is contained in one single text file, making it simple to read, manipulate, transport, and incorporate into web-based applications.


Some examples of the types of features that may be represented by GeoJSON include:


  • Point

  • LineString

  • Polygon

  • MultiPoint

  • MultiLineString

  • MultiPolygon

  • Feature Collections


Example GeoJSON structure:

{
  "type": "Feature",
  "properties": {
    "name": "Central Park"
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [...]
  }
}

GeoJSON has become a popular choice for web mapping frameworks such as Leaflet, OpenLayers, and Mapbox.


GeoJSON vs. Shapefile: Key Differences

Feature

GeoJSON

Shapefile

Format Type

Text-based JSON

Binary

File Structure

Single file

Multiple files

Human Readable

Yes

No

Web Compatibility

Excellent

Limited

GIS Software Support

High

Very High

Storage Efficiency

Lower

Higher

Attribute Limitations

Minimal

Several restrictions

Coordinate System Support

Primarily WGS84

Multiple projections

Data Size

Larger files

Smaller files

Ease of Sharing

Easy

More complex


Advantages of GeoJSON


  1. Readable and Simple

GeoJSON is a plain text format that makes it easy for people to view, modify, and verify information with basic text editors. These advantages make it simpler to troubleshoot problems and transfer information between groups.

  1. Perfect for Web Mapping Applications

GeoJSON operates well with the latest mapping technologies found on the web. Examples of popular platforms that support GeoJSON include:

  • Leaflet

  • Mapbox GL JS

  • OpenLayers

  • Cesium

For developers creating interactive maps, GeoJSON is typically the first choice as a data format.


  1. Single File Storage


GeoJSON stores both geometrical information and attribute data together in one file, whereas Shapefiles require two separate files. Advantages of this type of storage include:


  • Easier file organization

  • Easier file uploads

  • Less risk of losing files due to missing components

  • Fast cooperation with other people working on the project


  1. Versatile Attribute Storage


GeoJSON allows for rich attribute structures and does not impose significant constraints on how these attributes are stored compared with older formats such as Shapefiles or KML files. Some examples of these types of attributes include:


  • Very long field names

  • Nested properties

  • More complex metadata than previous formats can provide


  1. Open Standard


GeoJSON follows internet standards, specifically internet open standards, which means that companies using the GeoJSON format do not have a fixed vendor technology or model, making GeoJSON an attractive choice for open source GIS communities.


Disadvantages of GeoJSON


  1. Large File Sizes


GeoJSON contains data in a textual format, thus causing its file sizes to significantly exceed what they would be if in a binary format.


When dealing with large datasets, storing and transmitting that dataset can become inefficient. 


  1. Slower processing speeds on large datasets


When using large GeoJSON datasets, it may require greater use of memory or processing power from a user's computer, depending on which application they are running it in, such as a web browser.


Some examples of cases where performance could be degraded due to loading:


  • millions of features

  • very complex polygons

  • high-resolution geographic datasets


  1. Limited Coordinate System Flexibility


The GeoJSON specification (made in 2012) only allows for the use of WGS84 (EPSG:4326) coordinates, which are widely used but do not work well when many organizations need to work with multiple coordinate systems and need to perform additional processing for that reason.


Advantages of Shapefiles


  1. Compatibility


The Shapefile is the most commonly used GIS file format worldwide.


The following GIS platforms support Shapefiles:


  • ArcGIS Pro

  • QGIS

  • Global Mapper

  • AutoCAD Map 3D

  • FME


This high level of compatibility enables organizations to easily share their data with other organizations.


  1. Efficient File Formats


Due to the use of binary encoded data, Shapefiles are much smaller in size compared to GeoJSON files.


This results in:


  • Faster loading speeds

  • Less storage space

  • Increased performance in desktop GIS environments


  1. Good Performance in Desktop GIS Environments


For very large vector datasets, Shapefiles usually perform better than other file types for traditional GIS applications (especially for):


  • Spatial Analysis

  • Cartographic Workflows

  • Editing Data in a GIS


  1. Multiple Projection Systems


Shapefiles can be used with many different coordinate reference systems by using an associated projection file.


This gives Shapefiles the ability to be used in many engineering, surveying, and government applications.


Shapefile Disadvantages


  1. Multiple Files Dependency


Shapefiles are not a single file. Missing any of the components required for a shapefile will result in:


  • Data corruption

  • Problems importing the file(s)

  • A dataset longer than that of other systems (this is also the case with Shapefiles).


This complicates both the ability to share files and the ability to control different versions of the same shapefile.


  1. Limitations of Attribute Fields


Shapefiles have placed many restrictions on the number and type of files allowed in the attribute fields.


  • Field names can only be up to 10 characters in length.

  • There is limited support for Unicode.

  • There are limited choices for types of attributes.


These restrictions can make it difficult to utilize Shapefiles in today's data management environments.


  1. Legacy Format


There are still many people using Shapefiles, but it was developed many years ago; therefore, it doesn't have as many features as a modern geospatial system does.


  1. Weak Web Integration


Shapefiles do not have a natural ability to handle the web, and sometimes the shapefiles need to be converted into formats like GeoJSON or vector tiles to work on the web.


GeoJSON and Shapefile are two of the major types of GIS products used within the geospatial community today. In many cases, Shapefile is still the dominant data type used within traditional GIS processes, but as web mapping becomes more commonplace, GeoJSON is becoming the preferred file type for many modern web mapping applications and cloud-based geospatial applications.


By understanding how Geospatial Professionals can use the strengths and weaknesses of both GeoJSON & Shapefile together, and the results of combining these formats, we can help GIS Professionals select the best solution for any given application associated with data storage, analysis, visualization, and/or sharing.


Having a good understanding of both formats will be valuable as geospatial technologies continue to develop into efficient and future-proofed GIS solutions.


For more information or any questions regarding GeoJSON and Shapefile, please don't hesitate to contact us at


USA (HQ): (720) 702–4849

India: 98260-76466 - Pradeep Shrivastava

Canada: (519) 590 9999

Mexico: 55 5941 3755

UK & Spain: +44 12358 56710


Comments


bottom of page