Geospatial REST API

Publishing data for consumption on the web is a major component of modern GIS. To transfer data from remote servers to remote clients, most geospatial publishing software stacks use Representational State Transfer (REST) web services. In response to web requests for specific data resources, REST services return JavaScript Object Notation (JSON)-encoded data to the requesting client machine. The web services are combined in an application programming interface, or API, which will contain the endpoints that represent each data resource available for querying.

By combining a Python web framework with object-relational mapping (ORM) and a PostGIS backend, we can create a custom REST API that will respond to web requests with JSON. For this exercise, we will use the Flask web framework and the SQLAlchemy module with GeoAlchemy2 providing spatial ORM capabilities.

In this chapter, we will learn about the following:

  • REST API components
  • JSON response formatting
  • How to process GET, POST, PUT, and DELETE request methods
  • Performing geospatial operations using the API
  • How to deploy a Flask website using IIS
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset