
Build a geospatial web app with Java Spring Boot MVC and Leaflet to visualize Cape Town suburb water consumption using point maps, bar charts, live spatial data, and color-coded classes.
Install PostgreSQL 13 on Windows, configure Stack Builder to add the pgAgent, ODBC driver, and PostGIS spatial extension, and create a sample spatial database to verify PostGIS works.
Modify the pom.xml to add dependencies such as Hibernate Spatial, PostGIS, Apache Commons, Jackson data type js, and the families library to enable spatial queries, templates, and JSON data handling.
Create the model class for the water consumption table in a Java MVC app, mapping the database with id, suburb, average monthly kilolitre, and a geospatial point.
Create a water consumption repository interface by extending JPA repository, importing the model, and defining a native query to return the top 10 suburbs by average monthly kilolitre values.
Create a JacksonConfig utility class to configure the JTAC module, enabling geospatial data types for the point data type in the map model.
Implement the water consumption service by creating the service implementation class, autowiring the repository, and implementing find all and find top 10 consumers via JPA queries.
Visualize suburb water consumption on a map with circle markers sized by kilolitres and popups showing name and value, using data from a rest API organized into a point layer.
Create a legend for a bar chart showing the top 10 suburbs by water consumption in kilolitres, using a canvas and a map control positioned at the top right.
Welcome to the Building Web GIS Apps with Java Spring Boot MVC and Leaflet course. We'll be building a Full-stack MVC style Web Application using the Java Spring Tool suite. The purpose of this course and many more to follow, is to learn to create geospatial analytics and convert it into a functional application.
In our use case we will be working with residential water consumption data and we will be applying data processing techniques to extract transform and load the data into our spatial database. Once we have processed and cleaned the data, we will use it as a data source for building our Java Spring Boot Web Map Application.
We will be powering our application with a PostgreSQL and PostGIS database. In the Front-End we'll use Thymeleaf, JavaScript, Leaflet and Ajax. On the server side we'll be using Java Spring Boot MVC and combined with use of libraries like Hibernate-Spatial, commons-csv and JPA for our data transformation and conversion operations. The operating system that we will be working on is Windows 10 and Server 2016.
Some skills that you can expect to derive after completing the course are the following:
You will learn how to build a Spatial Database using Postgresql and PostGIS.
You will learn how to create charts with Chart.js.
You will learn to build Web Maps with Leaflet.js.
You will learn how to build REST API Endpoints.
You will learn some JavaScript programming.
You will learn how to build Web Applications using the Java Spring Boot MVC framework.