Creating a Geospatial Web Application for National Geographic

Celerity chose Ade Labs to help build a geospatial web application for National Geographic. The application would involve creating a web service with park location information so that the information could be plotted on a map. Ade Labs was in charge of building the Web Service/API.

Software Used

The initial technologies that the client wanted to use were the following Hapijs, PostgreSQL. I also chose to use Postgis, Knexjs, Bookshelfjs to incorporate geospatial capabilities and an ORM into the backend/web service.

Geospatial Web/Service API

The first step one was to load initial park data from National Geographic into the postgres database. Postgis was then used to get the longitude and latitude of park. Next, Postgis was used to convert geometric measures of the parks to longitude and latitude values.

Location information (ie. city, state, zip code) was missing from the parks data. Mapbox was used to reverse geocode the longitude and latitude of the parks data to get location information. After the location information was received they parks data was updated with that information in the postgres database.

Once the data is in the database, the web service methods can be created so that the data can be displayed on the map. Inside the methods, sql statements are created to get the parks data to be displayed on the map.

Some of the web service functionality built was:

Parks Search Method

The Park Search Method based off Mapbox’s web service API and a sql statement to get all the park information by a search query parameter. The park information is returned in geojson format.

Nearest Parks Method

The Nearest Parks Method to return a number of parks near a location given a point and other possible parameters. This functionality is based of a sql statement given the point and other possible parameters. The park information is returned in GeoJSON format.

If you are interested in discussing more on how to create a geospatial application, feel free to contact me here or email me at adetola@adelabs.com.