GIS APIs are collections of library modules that resemble various functionalities of GIS software through programming. GIS APIs evolved from desktop GIS. GIS APIs, as a distributed solution, are interoperable, scalable, light-weight, user-friendly, and versatile to a wide range of GIS users. This entry provides an overview of common GIS APIs, their functionalities as well as other related APIs. The general procedure to develop customized GIS applications is briefly discussed and demonstrated in a case study.
- GIS APIs
- Other APIs for Data Retrieval and Analysis
- Case Study
- Closing Remarks
GIS APIs: GIS Application Programming Interfaces are collections of library modules that resemble various functionalities of GIS software through programming
GIService: Geographic Information Service
As GIS evolved from desktop packages to distributed solution(s), API has become a popular option for developing customized GIS applications (Chow, 2008). Over a web platform, GIS APIs provide a communication protocol to handle client requests and return the processed response back from a server that provides GIS functionalities and/or datasets as a service (i.e., GIService) (Yue, Ramachandran, & Baumann, 2015). The advantage of communicating GIS requests and responses through an API is to enable interoperability across platforms, systems, and devices. It also empowers a light-client architecture so that a client (e.g., a web browser) can process, analyze, and visualize distributed geographic information with no prior GIS installation or even plug-in(s). GIS APIs are also scalable in that developers can import specific GIS APIs, with or without parallelization, needed for a certain GIS application (Rey, Anselin, Pahle, Kang, & Stephens, 2013). This is consistent with the development of service-oriented architecture in software design, where services are provided as application components to minimize the dependency between different components when designing a large software product (Bouguettaya, Sheng, & Daniel, 2014).
Given the origin of GIS APIs, it is not surprising that desktop GIS developers, such as Esri, QGIS, and GRASS GIS, built their GIS APIs to incorporate many functionalities of their desktop counterparts. However, GIS APIs from other developers, such as Google, remain limited in terms of tools and GIS functionalities. Moreover, some GIS APIs are designed to be developed into a web application (i.e., “online” web mapping) or a customized desktop solution. For example, the ArcPy package developed based on Python is often used for customizing desktop GIS tools. Because GIS APIs evolved from desktop GIS, it is perhaps useful to discuss existing GIS APIs in terms of their functionalities for the “capture, storage, transformation, retrieval, analysis, and display of spatial data” (Clarke, 2003). A common function of GIS APIs is the retrieval and display of spatial data with a dynamic map navigation interface. To many users, being able to view, explore, and overlay map layers is sufficient for basic applications. Another common function of GIS APIs is geocoding (i.e., address matching)- the act of assigning a x- and y-coordinate based on a postal address or a place name. The geocoding function (and sometimes reverse-geocoding) is useful because a significant portion of “Big Data” contains some spatial references, such as spatial coordinates, place names, or geographic metadata (Leszczynski & Crampton, 2016). A few APIs specialize in parsing and geocoding large and heterogeneous data (e.g., Texas A&M Geocoding API, Geoname API, GeoPy).
In the digital era, there has been an overwhelming inundation of geographic data made available through the advancement of remote sensing technologies, crowdsourcing, social media, GPS-enabled smart sensors, Internet of Things (IoT), etc. This creates a large demand for transforming the captured geospatial data into interoperable formats for dissemination and integration. Many data APIs enrich GIS APIs by providing supplementary gateways to query geographic data, including government records (e.g., Census Bureau APIs), social media (e.g., Twitter APIs), private sources (e.g., Google Data APIs), open sources (e.g., Overpass API), etc. The availability of GIS data from multiple sources also presents an opportunity to analyze their geographic distribution, spatial relationship, temporal trend, and semantic pattern. Some APIs (e.g. scikit-learn, TensorFlow API) specialize in analytical functions, like spatial, statistical, mathematical, or machine-learning functions.
3. GIS APIs
Similar to desktop GIS software packages, some GIS APIs are developed by commercial vendors whereas some originated from Free and Open Source Software (FOSS) projects (Table 1). Although commercial GIS APIs may require paid subscriptions, these products often have free versions with reduced functionalities or usage limits. It is important to note that many GIS or data APIs are available in different programming languages. For instance, Twitter allows API access from various popular languages, such as Python, R, or Java. Altogether, these GIS APIs provide the building blocks to develop distributed GIS applications. Besides the GIS APIs listed in Table 1 and a select few that are briefly discussed in the following sections, other GIS APIs include Shapely, Geopandas, Carto, Turf, here, cisco location APIs, Estimote, etc.
|QGIS APIs||FOSS||C++, Python||Desktop/terminal & web development||QGIS|
|GRASS GIS APIs||FOSS||C, Python||Desktop/terminal & web development||GRASS GIS APIs|
|Geonames API||FOSS||Java||Geocoding & web development||Geonames API|
|TAMU Geoservices Geocoder||FOSS||REST||Geocoding & web development||Texas A&M Geoservices Geocoding APIs|
|PySAL||FOSS||Python||Spatial analysis||Python Spatial Analysis Library|
|GISolve Open Service API||FOSS||REST||Web development & data integration|
|GeoPandas||FOSS||Python||Data integration & processing||GeoPandas|
3.1 Esri ArcGIS APIs
Esri provides several Python-based APIs for customization. For example, ArcPy is a Python package that provides an effective way to access the data types, spatial analysis functions, and geoprocessing tools in ArcMap through various Python functions, classes, and modules. These ArcPy Python functions correspond to the tools in ArcToolbox, hence, manipulating vector, raster, and tabular data in ArcPy is straight-forward for an experienced ArcMap user with basic Python knowledge. Another Python-based library is “ArcGIS API for Python”, which provides a high-level encapsulation of ArcGIS functionalities (e.g., managing, creating, and analyzing GIS data) for developing web GIS applications. It is implemented using the online and web GIS platform provided by ArcGIS Online and ArcGIS Enterprise, and is also compatible with the new platform ArcGIS Pro. Compared to desktop-based ArcPy, “ArcGIS API for Python” provides a simple solution for integrating ArcGIS into web application development.
3.2 QGIS APIs
QGIS, a continuously growing FOSS GIS project, also offers a Python API to implement its versatile GIS engine for building customized applications. Similar to Esri ArcPy, QGIS APIs offer a versatile package of many GIS functionalities and can process various GIS data models (e.g., vector, raster, database) and formats (e.g., Shapefile, JSON, GeoTiff, etc.). Although QGIS APIs are not designed to develop web applications, there are plug-ins (e.g., qgis2web) that can help QGIS interface with other web GIS APIs like OpenLayers and Leaflet.
3.3 Google Maps APIs
3.4 Microsoft Bing Maps APIs
3.5 OpenLayers API
3.6 Leaflet API
There are other APIs that provide either geographic data or analytical services (e.g., machine learning) that can supplement GIS APIs in the development of advanced GIS applications (Table 2). While some APIs (e.g. OpenStreetMap APIs, Census Bureau APIs), can deliver GIS data, it is noted that some APIs (e.g. Twitter APIs, WhitePages API) can only retrieve data with geographic reference (e.g. latitude/longitude or postal address) that are not necessarily in GIS data format. It requires additional effort to parse and process, such as geocoding, displaying latitude/longitude, joining data with existing GIS data like census units) in order to visualize them in GIS for further analysis. Even though some APIs, such as Scikit learn or TensorFlow, are scientific toolkits, they are included in this discussion to illustrate a broader framework of API integration.
|Name||Primary Function(s) related to GIS APIs||Programming Language(s)||Documentation|
|Twitter APIs||Data||REST||Twitter APIs|
|Flickr API||Data||REST||Flickr APIs|
|OpenStreetMap API||Data||REST||OpenStreetMap API|
|Census Bureau APIs||Data||REST||Census Bureau APIs|
|WhitePages API||Data||REST||WhitePages Pro API|
|Scikit-learn API||Analytics||Python||Scikit-learn API|
4.1 Twitter APIs
The standard Twitter APIs include basic functions such as streaming and searching, whereas more advanced functionalities, such as conducting complex queries and metadata enrichments (e.g., to retrieve improved profile information), are provided in the Premium APIs and Enterprise APIs. Most non-commercial applications of Twitter use the free standard APIs to collect data. The featured functionalities of the free APIs include: collecting real-time streaming data, searching tweets within 7 days, filtering and sampling tweets, retrieving basic user profile information, etc. It is important to note the limitation of free standard APIs before implementing them. First, there is a limit on the number of requests made per 15 minutes. Second, the standard APIs can only obtain around 1% of all tweets, which raises questions of data completeness.
4.2 OpenStreetMap API
OpenStreetMap (OSM) adopts the same collaborative model as Wikipedia, creating a free and editable map project that is available to users all over the world. The map data from OSM is crowdsourced from users and considered the most valuable output of this project. OSM provides a REST API to retrieve, edit, and save the raw geodata to/from the back-end database. Users are able to specify the target area to download using a bounding box or more complicated queries. The downloaded data can be saved as an .osm file, which is an XML-based file format that can be converted to Esri shapefiles using open source GIS tools such as QGIS.
4.3 U.S. Census Bureau APIs
As a U.S. federal agency, the Census Bureau disseminates publicly available demographic datasets through their APIs, including TIGERweb, decennial Censuses, the American Community Survey, economic surveys, etc. Many of these APIs provide access to a specific dataset via RESTful web services and return a JSON object for parsing.
4.4 Scikit-learn APIs
Built upon mathematical Python libraries like NumPy, SciPy, and matplotlib, Scikit-learn is a Python package that provides statistical and data mining tools, including generalized linear models, Naïve Bayes classifications, decision trees, ensemble methods, Support Vector Machines, neural networks, etc. While Scikit-learn is designed for general scientific investigation, these algorithms are useful for conducting cluster analysis, feature extraction, geovisualization, pattern recognition, and prediction common in GIScience research.
4.5 TensorFlow API
TensorFlow is a deep learning Python package developed by Google for advanced Neural Network (NN) modeling. This open-source library is built upon Keras, a high-level API specification that uses layers to organize the input data, configure neuron weights, and setup the activation function to build a convolution NN model. In addition to multi-language support, this API is also flexible in offering a low-level API for experienced developers and also a Lite version for mobile devices. This deep learning API expands the array of analytical tools to be integrated with GIS APIs.
5. Case Study
5.2 Loading Google Maps APIs
5.3 Applying API classes, functions, and tools
In this example, our goal is to create a marker for each of the seven wonders, and when clicking on a marker, an info-window with the description of the wonder will display. There are three main classes used in this case study: map, marker, and infowindow. The specific attributes and methods of these classes can be found in the API documentation (Google, 2018).
First, we created a basic map object as a container of the markers (Figure 2), then we populated an array with the description of the image address for each wonder. Next, using a for loop, we created the marker and infowindow for each wonder (Figure 3). Note that we also registered a “click” event for each marker so that when clicking on the marker, an infowindow with description will display. Figure 4 shows the final product.
Figure 2. Example code – creating a map object.
Figure 3. Example code – creating info windows in a for loop.
Figure 4. An example of a web mapping application created using Google Maps API.
APIs provide a flexible way for software development and component integration. In particular, GIS APIs provide a visualization and analytical platform to explore the underlying pattern and formulate questions about the relationship between form and process. In light of the distribution of spatial-data based products, spatial data infrastructure, and cloud computing, GIS APIs are an important component that shapes the continual development of future GIS for multi-disciplinary scientific investigation.
Chow, T. E. (2008). The potential of maps APIs for Internet GIS Applications. Transactions in GIS, 12(2), 179-191. DOI: 10.1111/j.1467-9671.2008.01094.x
Clarke, K. C. (2003). Getting Started with GIS (4th ed.). Upper Saddle River, New Jersey, USA: Prentice Hall.
ESRI. (2018). ArcGIS Developer Program Pricing. Retrieved Dec 7, 2018, from ArcGIS for Developer: https://developers.arcgis.com/pricing/credits/
Google. (2018). Pricing for Maps, Routes and Places. Retrieved Dec 7, 2018, from Google Cloud: https://cloud.google.com/maps-platform/pricing/sheet/
Leszczynski, A., & Crampton, J. (2016). Introduction: Spatial Big Data and everyday life. Big Data & Society, July–December, 1-6. DOI: 10.1177/2053951716661366
Rey, S. R., Anselin, L., Pahle, R., Kang, X., & Stephens, P. (2013). Parallel optimal choropleth map classification in PySAL. International Journal of Geographic Information Science, 27(5), 1023-1039. DOI: 10.1080/13658816.2012.752094
Yue, P., Ramachandran, R., & Baumann, P. (2015). Intelligent GIServices. Earth Science Informatics, 8(3), 461-462. DOI: 10.1007/s12145-015-0237-z
- Describe the roles of APIs in distributed GIS applications
- Understand the landscape of GIS and related APIs
- Setup the appropriate GIS API(s) to develop GIS applications
- What are the advantages of developing distributed GIS applications using APIs?
- Demonstrate familiarity to appropriate GIS APIs for specific GIS application(s), What are the APIs appropriate to
- Visualize and overlay Census data?
- Retrieve and analyze the spatiotemporal pattern of Flickr photos?
- Interested readers can learn more details about the GIS APIs listed above in ProgrammableWeb: https://www.programmableweb.com
- Gabriel Svennerberg, Beginning Google Maps API 3, Apress; 2nd ed. 2010 edition. ISBN-13: 978-1430228028.
- Rene Rubalcava, ArcGIS Web Development, Manning Publications; 1 edition, ISBN-13: 978-1617291616.