Some Prerequisite Knowledge About Spatial Data

Spatial Data Types:

Two kinds of spatial data types:

  1. geometry: flat 2D surface with two dimensions. Supposed X = 3 and Y = 4, then our point representation will be like POINT (3 4).
  2. geography: uses the same methods but the data type reflects the fact the we live on a curved 2D surface.

However, the two kinds of spatial data types is the need for the aforementioned Spatial Reference IDs (SRID).


Both geometry and geography data types have two parts, the coordinates of the object and the SRID number

To check the list of SRID in SQL server, we can execute query statement as belows:


The SRID number is set by EPSG standard. It dictates that the SRID of any geometry data is 0 and for Geography the default of SRID is 4326.

An example:

Here is a link of my Github of stored procedure, which aims to get the nearest suburb for each public transport stop:

In this stored procedure, it can be seen that

SET @geo1=geography::Point(@stationlat,@stationlong,4326);

Which is an application of transformation of the two spatial data types.

If you are interested in or have any problems with SQL, feel free to contact me.

Or you can connect with me through my LinkedIn.

Author: Jacqui

Data Science|Business Intelligence

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s