Hello, young map explorer! Welcome to your very first module in the Certified PostGIS User course. In this module, you will learn what spatial data is, why location matters, and how PostGIS helps us work with maps and locations on a computer. You do not need to know anything about maps or computers before reading this. We will start from the very beginning. Think of this module as your first step into a world where places, distances, and shapes can be stored, searched, and understood.
Have you ever used Google Maps to find your way to a friend's house? Or looked at a map of Nigeria to see where Lagos and Abuja are? Or drawn a plan of your classroom? If yes, then you have already worked with spatial data. Spatial data is information about where things are. It is information about location and shape. But a computer needs a special way to store this information. That is where PostGIS comes in.
This module is written especially for beginners. We will use very simple words. When we must use a big word, we will explain it in a way that a 13-year-old can understand. We will use stories, examples from Nigeria, examples from school, and examples from home. We will also use pictures made from keyboard characters (called ASCII art) to help you see what we mean. By the end of this module, you will know:
This module is long because it is a complete chapter, not just short notes. Take your time. Read one lesson at a time. Do the exercises. Ask questions. Talk to your parents or teachers about what you learn. Are you ready? Let us begin!
After finishing this module, you should be able to:
Amina was a 13-year-old girl who lived in Kano, Nigeria. Her grandmother sent her to the market to buy tomatoes. But Amina had a problem. She did not know where the market was. She had never been there before.
Her grandmother gave her directions. "Go straight. Turn left at the big tree. Turn right at the mosque. The market is behind the school."
Amina followed the directions. But she got lost. There were many big trees. There were many mosques. She did not know which school her grandmother meant.
Amina sat down and started to cry. A kind woman saw her. "What is wrong?" the woman asked.
Amina explained. The woman smiled. "I have a map on my phone," she said. "It shows exactly where the market is."
The woman showed Amina the map. The market was a small dot. Amina's location was another small dot. The phone showed the shortest path between them. Amina found the market easily.
Amina was amazed. "How does the phone know where everything is?" she asked.
The woman explained, "The phone uses spatial data. Spatial data stores the location of every place. With spatial data, you can find any place, measure any distance, and plan any route."
Moral of the story: Spatial data tells us where things are. It helps us find places, measure distances, and plan routes. Anyone can learn to use spatial data.
Data is information. It is facts. It is numbers. It is words. It is anything you can write down or store.
Data is everywhere. Your name is data. Your age is data. Your school is data. Your favourite food is data. Without data, we cannot remember things. We cannot plan. We cannot make decisions.
Imagine you have a box of pencils. Each pencil is a piece of data. If you want to count the pencils, you need to look at each one. Data is like those pencils. It is the small pieces of information that we collect and use.
When you write your name on a test paper, your name is data.
In school, your teacher writes your scores in a mark book. Those scores are data.
At home, your parents may write a shopping list. The items on the list are data.
In a Nigerian market, a trader writes down the prices of goods. Those prices are data.
DATA:
[ NAME: AMINA ]
[ AGE: 13 ]
[ SCHOOL: KANO GRAMMAR ]
[ FAVOURITE FOOD: TUWO SHINKAFA ]
|
V
[ INFORMATION ABOUT AMINA ]
Data is information. It is facts, numbers, and words. We use data every day at home, in school, and in the market.
You learned what data is. You saw examples from home, school, and Nigeria. Now you know that data is all around you.
Spatial data is data about location. It tells us where something is. It can be a point (like a house), a line (like a road), or a shape (like a farm).
Spatial data helps us find places. It helps us measure distances. It helps us plan routes. Without spatial data, we would get lost.
Imagine you want to tell a friend where your house is. You could say, "It is the blue house on the street." But that is not precise. With spatial data, you give exact coordinates. Your friend can find your house exactly.
A delivery company uses spatial data to find the shortest route to your house.
A school uses spatial data to show where all the classrooms are on a map.
At home, you use spatial data when you draw a plan of your room.
In Lagos, a taxi driver uses spatial data to find the fastest route to the airport.
SPATIAL DATA:
[ HOUSE ] --> [ POINT: (6.5244, 3.3792) ]
[ ROAD ] --> [ LINE: (6.5244, 3.3792) TO (6.5300, 3.3800) ]
[ FARM ] --> [ POLYGON: FOUR CORNERS ]
|
V
[ LOCATION INFORMATION ]
Spatial data is data about location. It tells us where something is. It can be a point, a line, or a shape.
You learned what spatial data is. You saw examples from home, school, and Nigeria. Now you know that spatial data describes locations.
Location is where something is. It is the place where something can be found.
Location matters in almost everything we do. We need to know where to go. We need to know where things are. We need to know how far things are from each other.
Imagine you want to buy bread. You need to know where the bakery is. Location tells you where the bakery is. Without location, you cannot find the bread.
A hospital needs to know where patients live. This helps them send ambulances quickly.
A school needs to know where students live. This helps them plan school buses.
At home, you need to know where the market is. This helps you buy food.
In Abuja, the government needs to know where roads are. This helps them plan new roads and repair old ones.
WHY LOCATION MATTERS:
[ HOSPITAL ] --> [ NEEDS TO KNOW WHERE PATIENTS ARE ]
|
V
[ SEND AMBULANCE QUICKLY ]
|
V
[ SAVE LIVES ]
Location is where something is. Location matters because we need to find places and plan routes.
You learned why location is important. You saw examples from home, school, and Nigeria. Now you know that location helps us make decisions.
PostGIS is a tool that adds spatial data features to PostgreSQL. PostgreSQL is a database. PostGIS makes it a spatial database.
Normal databases store names and numbers. They do not understand locations. PostGIS adds the ability to store and search locations. It lets you ask questions like: "Which houses are within 1 kilometre of the school?"
Imagine you have a toolbox. The toolbox has a hammer and a screwdriver. But you need a special tool to measure distances on a map. PostGIS is that special tool. It fits into your PostgreSQL toolbox.
A delivery company uses PostGIS to find the nearest driver to a customer.
A school uses PostGIS to find all students who live within 2 kilometres of the school.
At home, you use PostGIS to find the nearest hospital to your house.
In Lagos, a taxi company uses PostGIS to find the nearest driver to a customer.
POSTGIS:
[ POSTGRESQL ] + [ POSTGIS ] = [ SPATIAL DATABASE ]
| |
V V
[ STORE DATA ] [ STORE LOCATIONS ]
| |
V V
[ ASK QUESTIONS ABOUT LOCATIONS ]
PostGIS adds spatial features to PostgreSQL. It lets you store and search locations.
You learned what PostGIS is. You saw examples from home, school, and Nigeria. Now you know that PostGIS makes PostgreSQL a spatial database.
PostGIS is special because it is open source. Open source means it is free. Anyone can use it. Anyone can study it. Anyone can improve it. It is also very reliable and very powerful.
Many companies cannot afford expensive spatial databases. PostGIS gives them a powerful spatial database for free. This helps small businesses and schools in Nigeria and around the world.
Imagine you want to draw a map. You need a pencil. Some pencils are very expensive. Some pencils are cheap. PostGIS is like a very good pencil that is free. Everyone can draw maps with it.
A small business in Lagos can use PostGIS for free. They do not need to pay for expensive software.
A school can use PostGIS for free. They can map all the classrooms.
A family can use PostGIS for free. They can map their neighbourhood.
In a Nigerian hospital, PostGIS can be used to map patient locations. The hospital does not need to pay for expensive software.
| Feature | What It Means |
|---|---|
| Open source | Free to use and study |
| Reliable | Works well for a long time |
| Powerful | Can handle large amounts of spatial data |
| Secure | Keeps spatial data safe from thieves |
| Fast | Finds locations in seconds |
| Many users | Many people can use it at once |
WHY POSTGIS IS SPECIAL:
[ OPEN SOURCE ] --> [ FREE TO USE ]
|
V
[ RELIABLE ] --> [ WORKS WELL ]
|
V
[ POWERFUL ] --> [ HANDLES BIG MAPS ]
|
V
[ SECURE ] --> [ KEEPS LOCATIONS SAFE ]
PostGIS is special because it is open source, reliable, powerful, and secure.
You learned why PostGIS is special. You saw a table of features. Now you know that PostGIS is a great choice for storing locations.
A point is a single location. It has no size. It is just a spot on a map. We use points to show things like houses, schools, and hospitals.
Points are the simplest type of spatial data. They help us mark important places on a map.
Imagine you put a dot on a paper. That dot is a point. A point shows exactly where something is.
A hospital is a point on a map. It has a specific location.
Your school is a point on a map. It has a specific location.
Your house is a point on a map. It has a specific location.
In Lagos, the airport is a point on a map. It has a specific location.
POINT:
|
V
+-----------+
| |
| โข | <-- point (school)
| |
+-----------+
A point is a single location. It has no size. We use points to mark important places.
You learned what a point is. You saw examples from home, school, and Nigeria. Now you know that points mark locations.
A line is a series of points connected together. It has length but no width. We use lines to show things like roads, rivers, and paths.
Lines help us show routes and connections. They help us measure distances between places.
Imagine you draw a line from your house to your school. That line shows the path you take. A line is a path between places.
A road is a line on a map. It connects two places.
The path from your classroom to the library is a line on a map.
The path from your house to the market is a line on a map.
In Nigeria, the River Niger is a line on a map. It flows from north to south.
LINE: +-----------+ | | | โข------โข | <-- line (road) | | +-----------+
A line is a series of points connected together. We use lines to show roads, rivers, and paths.
You learned what a line is. You saw examples from home, school, and Nigeria. Now you know that lines show paths.
A polygon is a closed shape. It has an area. It is made of lines. We use polygons to show things like farms, buildings, and countries.
Polygons help us show areas. They help us measure the size of places.
Imagine you draw a square. That square is a polygon. A polygon shows an area. It shows the size of a place.
A farm is a polygon on a map. It has a size and a shape.
Your school compound is a polygon on a map. It has a size and a shape.
Your house is a polygon on a map. It has a size and a shape.
In Nigeria, Lagos State is a polygon on a map. It has a size and a shape.
POLYGON: +-----------+ | +-----+ | | | | | <-- polygon (farm) | +-----+ | +-----------+
A polygon is a closed shape. It has an area. We use polygons to show farms, buildings, and countries.
You learned what a polygon is. You saw examples from home, school, and Nigeria. Now you know that polygons show areas.
A coordinate is a pair of numbers that describes a location. It tells you where a point is on a map.
Coordinates give exact locations. They remove confusion. With coordinates, you can find any place on Earth.
Imagine you are playing a game of Battleship. You say "B5" to hit a ship. "B5" is a coordinate. It tells you exactly where to look.
A delivery company uses coordinates to find your house exactly.
A school uses coordinates to mark the location of the school gate.
At home, you use coordinates to mark the location of your house.
In Lagos, the coordinates of the airport are (6.5774, 3.3212).
COORDINATE:
[ X: 6.5774 ] <-- latitude
[ Y: 3.3212 ] <-- longitude
|
V
[ LOCATION: LAGOS AIRPORT ]
A coordinate is a pair of numbers that describes a location. It tells you where a point is on a map.
You learned what a coordinate is. You saw examples from home, school, and Nigeria. Now you know that coordinates give exact locations.
Latitude is the distance north or south of the equator. Longitude is the distance east or west of the prime meridian. Together, they form coordinates.
Latitude and longitude help us find any place on Earth. They are the most common way to describe locations.
Imagine the Earth is a big ball. Latitude lines go around the ball like belts. Longitude lines go from top to bottom like slices of an orange.
A pilot uses latitude and longitude to fly from Lagos to London.
A geography teacher uses latitude and longitude to teach about Nigeria.
At home, you use latitude and longitude on your phone's map app.
In Nigeria, Abuja is at latitude 9.0765 and longitude 7.3986.
LATITUDE AND LONGITUDE:
[ EARTH ]
|
V
[ LATITUDE: NORTH-SOUTH ]
[ LONGITUDE: EAST-WEST ]
|
V
[ COORDINATE: (LAT, LONG) ]
Latitude is north-south. Longitude is east-west. Together, they form coordinates.
You learned about latitude and longitude. You saw examples from home, school, and Nigeria. Now you know how to describe any location on Earth.
A spatial database is a database that can store and search spatial data. It understands points, lines, and polygons. It can answer questions about locations.
Normal databases cannot understand locations. Spatial databases can. They help us solve location problems.
Imagine you have a box of toys. A normal box holds toys. A spatial box holds toys and knows where each toy is. A spatial database is like that spatial box.
A delivery company uses a spatial database to find the nearest driver.
A school uses a spatial database to find students who live nearby.
At home, you use a spatial database to find the nearest hospital.
In Lagos, a taxi company uses a spatial database to find the nearest driver.
SPATIAL DATABASE:
[ NORMAL DATABASE ]
|
V
[ ADD SPATIAL FEATURES ]
|
V
[ SPATIAL DATABASE ]
|
V
[ STORE AND SEARCH LOCATIONS ]
A spatial database stores and searches spatial data. It understands points, lines, and polygons.
You learned what a spatial database is. You saw examples from home, school, and Nigeria. Now you know that spatial databases solve location problems.
SRID stands for Spatial Reference Identifier. It is a number that tells us which coordinate system we are using.
Different maps use different coordinate systems. SRID tells the database which system to use. Without SRID, coordinates would be confusing.
Imagine you are measuring a table. You can use centimetres or inches. You must say which one you are using. SRID is like saying "centimetres" or "inches" for maps.
A mapping company uses SRID 4326 for GPS coordinates.
A school uses SRID 4326 to mark the location of the school.
At home, you use SRID 4326 on your phone's map app.
In Nigeria, surveyors use SRID 4326 for GPS coordinates.
| SRID | Name | Use |
|---|---|---|
| 4326 | WGS 84 | GPS coordinates (latitude, longitude) |
| 3857 | Web Mercator | Web maps (Google Maps, OpenStreetMap) |
| 26392 | Minna / Nigeria | Nigerian local coordinates |
SRID:
[ COORDINATE: (6.5774, 3.3212) ]
|
V
[ WHICH SYSTEM? ]
|
V
[ SRID: 4326 (WGS 84) ]
|
V
[ LOCATION IS CLEAR ]
SRID is a number that tells us which coordinate system we are using. It removes confusion.
You learned what SRID is. You saw a table of common SRIDs. Now you know how to use SRID in your spatial data.
Spatial data is everywhere. It is used in maps, navigation, and planning. It helps people find places and make decisions.
Knowing where spatial data is used helps you understand its value. It helps you see how you can use spatial data in your own life.
Imagine you walk into a new city. You use a map on your phone to find your hotel. The map uses spatial data. Spatial data is everywhere.
A delivery company uses spatial data to find the fastest route.
A school uses spatial data to plan school bus routes.
At home, you use spatial data to find the nearest supermarket.
In Lagos, traffic planners use spatial data to reduce traffic jams.
| Place | What the Spatial Data Shows |
|---|---|
| Bank | Locations of branches and ATMs |
| School | Locations of classrooms and playgrounds |
| Hospital | Locations of hospitals and clinics |
| Market | Locations of shops and stalls |
| Library | Locations of bookshelves and reading rooms |
| Government | Locations of roads, rivers, and boundaries |
SPATIAL DATA IS EVERYWHERE:
[ BANK ] [ SCHOOL ] [ HOSPITAL ] [ MARKET ]
| | | |
V V V V
[ STORE AND FIND LOCATIONS QUICKLY ]
Spatial data is everywhere. It is in banks, schools, hospitals, and markets.
You learned about real-life spatial data. You saw a table of examples. Now you know that spatial data helps people every day.
A spatial thinker is someone who thinks about locations. They ask questions like: "Where is this?" and "How far is that?"
If you think like a spatial expert, you can solve problems. You can help your school, your family, and your community.
Imagine you are playing a game of chess. A good chess player thinks about where the pieces are. A spatial thinker thinks about where things are in the real world.
Before you build a new school, ask: "Where should we put it? Where do students live?"
Before you plan a school trip, ask: "How far is the museum? What is the best route?"
Before you buy a house, ask: "Is it near the market? Is it near the school?"
Before you open a new shop, ask: "Where are the customers? Where are the competitors?"
THINK LIKE A SPATIAL EXPERT:
[ ASK: "WHERE IS IT?" ]
|
V
[ ASK: "HOW FAR IS IT?" ]
|
V
[ ASK: "WHAT IS NEARBY?" ]
|
V
[ MAKE A MAP ]
|
V
[ SOLVE THE PROBLEM ]
A spatial thinker thinks about locations. You can become a spatial thinker by asking good questions.
You learned how to become a spatial thinker. You saw examples from home, school, and Nigeria. Now you can start thinking like a spatial expert.
PostGIS is a powerful spatial database extension. It is free to use. It is used by many companies. You can install it on your computer.
Learning PostGIS can help you get a good job. Many companies need people who know PostGIS.
Imagine you want to learn to draw maps. PostGIS is like a special pen. You can draw any map you want. You can measure any distance.
A company in Lagos uses PostGIS to map delivery routes.
A school uses PostGIS to map the school compound.
At home, you use PostGIS to map your neighbourhood.
In Abuja, the government uses PostGIS to map roads and buildings.
YOUR FIRST LOOK AT POSTGIS:
[ INSTALL POSTGIS ]
|
V
[ CREATE A SPATIAL TABLE ]
|
V
[ ADD POINTS, LINES, POLYGONS ]
|
V
[ RUN A SPATIAL QUERY ]
|
V
[ SEE RESULTS! ๐ ]
PostGIS is a powerful spatial database extension. You can install it and learn to use it.
You learned about PostGIS. You saw examples from home, school, and Nigeria. Now you are ready to start using PostGIS.
| Word | Simple Definition |
|---|---|
| Data | Information. Facts, numbers, and words. |
| Spatial data | Data about location. It tells us where something is. |
| Location | Where something is. |
| PostGIS | A tool that adds spatial features to PostgreSQL. |
| Point | A single location. It has no size. |
| Line | A series of points connected together. It has length. |
| Polygon | A closed shape. It has an area. |
| Coordinate | A pair of numbers that describes a location. |
| Latitude | The distance north or south of the equator. |
| Longitude | The distance east or west of the prime meridian. |
| Spatial database | A database that can store and search spatial data. |
| SRID | Spatial Reference Identifier. A number that tells us which coordinate system we are using. |
| Spatial thinker | Someone who thinks about locations. |
SPATIAL DATA
|
V
[ STORED IN A SPATIAL DATABASE ]
|
V
[ ORGANISED IN TABLES ]
|
V
[ QUERIED WITH SQL ]
|
V
[ DISPLAYED ON A MAP ]
1960s: First computer maps created. 1970s: GIS (Geographic Information Systems) invented. 1980s: Spatial databases become common. 1990s: GPS becomes available to everyone. 2000s: PostGIS is released. 2010s: Maps on phones become popular. 2020s: Spatial data is used everywhere. 2025: You are learning PostGIS!
SPATIAL DATA
|
+---- POINT (single location)
|
+---- LINE (path between places)
|
+---- POLYGON (area or shape)
| Feature | Point | Line | Polygon |
|---|---|---|---|
| What it shows | A single location | A path | An area |
| Size | No size | Has length | Has area |
| Example | School, hospital | Road, river | Farm, country |
| Coordinates needed | One pair | Two or more pairs | Three or more pairs |
| Feature | PostgreSQL | PostGIS |
|---|---|---|
| Stores names and numbers | Yes | Yes |
| Stores locations | No | Yes |
| Understands points | No | Yes |
| Understands lines | No | Yes |
| Understands polygons | No | Yes |
| Measures distances | No | Yes |
| Finds nearest places | No | Yes |
In this module, you learned the basics of spatial data and PostGIS. You learned that data is information. You learned that spatial data is data about location. You learned that location matters. You learned that PostGIS adds spatial features to PostgreSQL.
You learned about points. A point is a single location. You learned about lines. A line is a series of points connected together. You learned about polygons. A polygon is a closed shape. You learned about coordinates. A coordinate is a pair of numbers that describes a location.
You learned about latitude and longitude. Latitude is north-south. Longitude is east-west. You learned about spatial databases. They store and search spatial data. You learned about SRID. It tells us which coordinate system we are using. You learned about real-life spatial data. It is everywhere. You learned how to become a spatial thinker. You ask questions about locations.
You learned about PostGIS. It is a powerful, free spatial database extension. Now you are ready to move on to Module 2, where you will learn how to install PostGIS and create your first spatial database. But before you go, make sure you understand the key takeaways below.
Match the word in Column A with the correct definition in Column B.
| Column A | Column B |
|---|---|
| 1. Data | A. A single location |
| 2. Spatial data | B. Information. Facts, numbers, and words |
| 3. Point | C. A tool that adds spatial features to PostgreSQL |
| 4. Line | D. Data about location |
| 5. Polygon | E. A pair of numbers that describes a location |
| 6. Coordinate | F. A series of points connected together |
| 7. PostGIS | G. A closed shape with an area |
Answers: 1-B, 2-D, 3-A, 4-F, 5-G, 6-E, 7-C
Title: Map Your School
Instructions: In groups of 3 or 4, draw a map of your school.
Mark the classrooms as points. Draw the paths as lines.
Draw the school compound as a polygon. Present your map to the class.
Example:
Points: classroom, library, playground.
Lines: path from classroom to library.
Polygon: school compound.
Title: My First Spatial Plan
Instructions: Draw a simple map of your neighbourhood.
Mark at least 5 places as points. Draw at least 2 paths as lines.
Draw at least 1 area as a polygon. Write a short explanation.
Example:
Points: my house, the market, the mosque, the school, the hospital.
Lines: road from my house to the market.
Polygon: the park near my house.
Title: Build a Paper Spatial Database
Materials: Paper, pen, ruler.
Steps:
Assignment: For one week, look for spatial data in your daily life. Keep a diary. Each day, write down:
At the end of the week, write a short report. Share it with your teacher or parent.
In Module 2, you will learn how to install PostGIS on your computer. You will learn how to create your first spatial database. You will learn how to create spatial tables and add spatial data. You will learn how to run simple spatial queries.
Before you start Module 2, make sure you understand everything in this module. Practice drawing maps at home and school. Think about how spatial data is used in your community. When you are ready, turn the page and continue your journey to becoming a Certified PostGIS User!
End of Module 1.