Geoserver is without a doubt one of the best ways to share spatial data following OGC standards. Geoserver allows us to expose the data in WMS format, making the life of developers and users pretty easy by showing a ton of vector data in a raster (png, jpeg, etc. ) format.

This blog introduces one more area of GeoServer capability, i.e. styling the data on the fly. To begin with, the vector data has no face, it is just a file having coordinate information and metadata of that location. It has no sense of styling itself. Hence it is the responsibility of the client side to render this data. Mapping libraries such as OpenLayers, leafletjs, Mapbox, etc. can also take care of styling, but this means that we need to add vector data on the client (browser) which reduces the performance of an overall application. Geoserver solves this problem by providing an on-the-fly styling component thus reducing the efforts for a client to load and then style the data, and also opens the whole spectrum of permutations and combinations of styling. Some of the most widely used styling combinations can be:
1. Attribute-based styling (Seeing different geometry in different style based on property in the column)
An example of this can be a State boundary map of the country, showing states in a different color based on the population it has. e.g. >10M can be red, between 2M and 10M can be yellow and < 2M can be green.
This gives us instant judgment of states without even going through the data of each state
2. Zoom based styling ( Seeing different geometry based on current zoom level)
An example of this can be basemap, when we look at any basemap from country-level zoom, we can only see country boundaries, as we start zooming in more and more, details start popping up, etc. This styling allows us to speed up the performance of an application by not loading all the data at the same time
3.

Data is one of the most important parts of geospatial or I would say almost every industry. Each Industry is now taking data management seriously, thus it becomes an important part of our career as IT people to understand it. This guide is a one-stop article walking you from the ground (What is Data) to the sky ( Understanding and using geospatial queries).

Image for post
Image for post

⭐ Basics of Database

What is Data?
Data can be any information that you store to access it in the future. It can be numeric, text, media, location, date, etc. This can be written on paper, can be saved on a computer hard-drive, or even stored in the cloud.
What is Database?
The collection of multiple data entries together creates a database. Databases are usually created so that users can access a large chunk of data and perform certain operations on it altogether.
The database can be anything —
Your grandma’s notebook with all her delicious recipes, your parents' account books stating all transactions, your Facebook page listing all your friends, etc. All these examples show that all the data in a database are more or less of the same type.
The need for a Database?
Creating a Database makes it easy for different users to access data sets, above examples showed that we can store a similar type of information for each data entry in a database, which is just partially true, with the rise of No-SQL databases, this definition is now changing (More about it can be read below in the article ).
As websites are becoming more user interactive and larger in size, data of the users, customers, orders, etc. are important assets to the companies, thus need to have a scalable and reliable database and engineer who can understand it is the need of an hour.
Database Management System ( DBMS )
So far, we know that data and databases are important, but how do we work with databases in computer systems? that’s where DBMS comes into the picture. DBMS are the software programs that provide us a way to interact with databases on a computer to perform various operations such as Creating data, editing data, inserting data, etc. DBMS lets us do this by providing us APIs that can be used to do so. Rarely, any software won’t use DBMS to play with the data stored on disk.
DBMS software apart from data operations, also handles backups, securities checks, database health checks, etc. hence it is advisable to always use a DBMS whenever working with databases.
Spatial Data and Database
Since we are focusing more on the spatial side rather than the generic ones, I would discuss such data type here. Spatial Data types are a little different than other data types. We need to save co-ordinates in a specific format ( generally given in the documentation of the database website ) so that the databases can read it and make sense out of it. While Generally the data can be queried like Get all results where age > 15, for the spatial query we usually look for something like Get all results within 10 KM radius of a specific point.

This post is part 2 of the article series ‘Database in 2021’, in Part 1, we saw basics such as What is Data? , What is Database? Types of Database? CRUD Operations in RDBMS ( PostgreSQL ). I hope you are familiar with all these before you start reading below.

Image for post
Image for post
Photo by Bradford Nicolas on Unsplash

What makes a Relational Database actually Relational?

Good Question! As the name suggests, there must be a way we can establish relations between multiple or the same tables or columns, so that we can save more data without making it complex to read.
example — For a franchise company such as MacDonalds or Dominos, they must be having some central data that is common to all stores, Regional Data that is common to some stores, and store data which is basically valid only for that store. In order to store all such data in databases and making sense out of it, a lot of connections between such tables, columns will be made.
In this blog post, we’ll try to make sense of all the cool features RDBMS provides to tackle such types of use cases.
🔑 KEYS in RDBMS —
Keys are nothing but attributes in the table. Keys denote a special crucial characteristic to a column. Different types of keys in RDBMS are
1. Super Key
2. Composite Key
3. Foreign Key
4. Candidate Key
5. Primary Key
6. Alternate Key
7. Surrogate Key
In order to keep the blog short and simple, we’ll only discuss the most widely used keys.
🔑 Primary Key — Primary Key is assigned to the column, which acts as a head column, the primary key will contain a unique ID (0,1,2,3,…) to make it easy for the user to access the row data. Every table will have one and only one Primary key column. When we use software like pgAdmin, it helps us to take care of creating primary key easily. …

Image for post
Image for post
Photo by CHUTTERSNAP on Unsplash

GeoServer is a JAVA based application developed to ease the styling and sharing of geospatial data using Opensource technology. It follows the standards of the Open Geospatial Consortium (OGC) and thus has wide application in a variety of industries. GeoServer’s website states more clearly regarding its usability and documentation.

Let’s install GDAL plugin for Geoserver 2.18.0

Make sure that you are aware of the geoserver version you are using. You can check it as follow

Image for post
Image for post

Geoserver is a JAVA based application developed to ease the styling and sharing of geospatial data using Opensource technology. It follows the standards of the Open Geospatial Consortium (OGC) and thus has wide application in a variety of industries. Geoserver’s website states more clearly regarding its usability and documentation.

Let us begin by understanding the requirements and steps in order to install and run geoserver successfully

Installing Geoserver in a GUI-based system such as Windows, Mac or even Ubuntu GUI is a piece of cake 🍰. …

As the name suggests, GeoJSON is a combination of two words, Geographical and JSON, but if we try to understand it in more depth, the simple definition can be A JSON object accomodating information about the specific geometry (e.g. Point, Line, Polygon, etc.) along with optional metadata (e.g. id, etc.)
In a world full of APIs, developers rely on information communicated mostly through JSON or XML most of the time. Thus to talk smoothly with existing logics and standards, GeoJSON was introduced.

What is a GeoJSON file?

Image for post
Image for post

GeoJSON file is written in the same way JSON is written. the extension for GeoJSON file is (well no surprise here! …

Image for post
Image for post
Photo by delfi de la Rua on Unsplash

What is GeoDjango ? 🌏

Geodjango is an extension to the existing django framework where developer can leverage world class framework features available in django with the goodness of Geospatial Data 🌎 .Geodjango supports all databases such as PostgreSQL (PostGIS), MySQL , SQLite (SpatiaLite), Oracle, etc.

This enables us to use geometry data in the way it is intended, allowing user to do geospatial analysis (buffer, finding nearest points, etc.) .
Although best use case scenario for geodjango would be creating APIs and consuming from frontend frameworks like Angular , React, Vue.js , etc. that’s the topic for another post.

Prerequisite for this blog 📚

Before getting into actual CRUD operations with geodjango and openlayers, I accept you have little bit understanding of :
1. Django and Geodjango (Creating Models,Views, Templates, etc.)
2. PostgreSQL/ PostGIS (Creating and operating spatial database)
3. Openlayers 4 (Creating Map, Draw, Modify feature)
4. Excitement 😁 (Otherwise we are wasting time honey!) …

Image for post
Image for post

I’m a huge fan of Django Framework because it is by far one of the easiest , secured and fun 😉 way to create really complicated project. I work in GIS Industry where I deal with geospatial enable data all the time. Which lot of the time includes cleaning data, performing some basic analysis and then consume in the web app and since we live in an era where python provides solutions for almost everything, it is an obvious decision to vote for django above the php frameworks like laravel, zend ,etc.

What is Django ?

Django is a python based MTV(model, template, view) framework designed to create a simple, elegant, secure, fast…

Image for post
Image for post

I use mac for most of my development purpose, and it’s already lil scary trying to install executables and libraries which are already available in .exe for windows but no .dmg for mac 😭

Geoserver is one of the tools that I use all the time, until version. 2.12 geoserver shipped with .dmg to install it! Easy pisy !! 😁

But after 2.12 it switched to platform independent binary which is lil bit tricky to install. But don’t worry!!😉 In this blog you’ll find all pieces needed to run geoserver’s latest stable release successfully.

Let’s get started!!

Step 1 : Downloading JAVA JRE 8

Geoserver works on JAVA environment (more specifically JRE 8 *not latest one) , you can grab your copy here . The procedure to install it is straight forward. …

Image for post
Image for post

I was recently trying to install geoserver 2.17.0 on a windows machine, until now I was using version 2.15, which had a Windows Installer provided directly , so it was pretty straight forward, but when I switched to 2.17. BAM!! No more easy was of downloading Installer and following series of ‘Next’ buttons. As any sane developer, I turned towards Official docs on how to install Binary. But It was pretty confusing at this part

About

Krishna G. Lodha

Independent GIS developer | podcaster | krishnaglodha.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store