Welcome back, young map explorer! In Module 1, you learned what spatial data is. You learned about points, lines, and polygons. You learned about coordinates and PostGIS. In Module 2, you learned how to install PostGIS and create spatial databases. You learned how to create spatial tables and add data.
In this module, we are going to learn about spatial relationships and measurements. Spatial relationships tell us how places are connected. For example: "Is this house inside that area?" or "Do these two roads cross each other?" Measurements tell us about size and distance. For example: "How far is the school from the market?" or "How big is this farm?"
Do not worry if some words sound big. We will explain everything in simple language. We will use stories, examples from Nigeria, examples from school, and examples from home. We will use pictures made from keyboard characters (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. Practice on your computer. Are you ready? Let us begin!
After finishing this module, you should be able to:
Emeka was a 13-year-old boy who lived in Port Harcourt, Nigeria. His family had a small farm. One day, their favourite goat went missing. The goat was called Bingo.
Emeka's father was worried. "Bingo could be anywhere," he said. "We will never find him."
Emeka remembered his PostGIS lessons. "We can use spatial queries," he said. "We can find all the places within 2 kilometres of our farm. Bingo cannot have gone far."
Emeka opened his spatial database. He had a table of all the farms and houses in the area. He used ST_DWithin to find all places within 2 kilometres of his farm.
Then he used ST_Contains to check which of those places had a fenced area. Bingo might be trapped inside a fence. He found three farms with fences nearby.
Emeka and his father visited each farm. At the third farm, they found Bingo! The goat had wandered into the farm and could not get out.
Moral of the story: Spatial relationships and measurements help us solve real problems. They help us find things, measure distances, and check relationships between places.
A spatial relationship tells us how two or more places are connected. For example: "Is this house inside that area?" or "Do these two roads cross each other?"
Spatial relationships help us answer important questions. They help us find things, plan routes, and make decisions.
Imagine you have two toys on a table. One toy is inside a box. The other toy is outside the box. The relationship between the toy and the box is a spatial relationship.
A delivery company checks if a customer's address is inside the delivery zone.
A school checks if a student's house is within walking distance of the school.
At home, you check if your house is inside a flood zone.
In Lagos, a taxi company checks if a customer is within a certain area for pickup.
SPATIAL RELATIONSHIP: +-------------------+ | AREA | | +----+ | | | โข | <-- point inside area | +----+ | | | | โข <-- point outside area +-------------------+
A spatial relationship tells us how two or more places are connected. It helps us answer questions about locations.
You learned what a spatial relationship is. You saw examples from home, school, and Nigeria. Now you know that spatial relationships describe connections between places.
ST_Distance is a PostGIS function that measures the distance between two places. It returns a number. The number is the distance in the units of the coordinate system.
Distance is important for planning routes, estimating travel time, and finding nearby places. ST_Distance helps you measure distance accurately.
Imagine you want to know how far your house is from the market. ST_Distance measures the straight-line distance between them.
A delivery company measures the distance from the warehouse to the customer.
A school measures the distance from the school to the nearest bus stop.
At home, you measure the distance from your house to the nearest hospital.
In Abuja, a taxi driver measures the distance from the airport to the city centre.
SELECT ST_Distance(
ST_GeomFromText('POINT(6.5774 3.3212)', 4326),
ST_GeomFromText('POINT(6.5780 3.3220)', 4326)
) AS distance;
ST_DISTANCE:
[ POINT A ] ------------------- [ POINT B ]
| |
V V
[ DISTANCE = 100 METRES ]
ST_Distance measures the distance between two places. It returns a number.
You learned how to measure distance with ST_Distance. You saw examples from home, school, and Nigeria. Now you can measure distances in your spatial database.
ST_Area is a PostGIS function that measures the area of a polygon. It returns a number. The number is the area in the units of the coordinate system.
Area is important for measuring land, planning farms, and estimating costs. ST_Area helps you measure area accurately.
Imagine you want to know the size of your school compound. ST_Area measures the area of the polygon that outlines the compound.
A farmer measures the area of his farm to know how much seed to buy.
A school measures the area of the playground to plan for new equipment.
At home, you measure the area of your garden to know how many plants to buy.
In Kano, a farmer measures the area of his farmland to plan his crops.
SELECT ST_Area(
ST_GeomFromText('POLYGON((0 0, 4 0, 4 4, 0 4, 0 0))', 4326)
) AS area;
ST_AREA:
+-------------------+
| |
| POLYGON |
| |
+-------------------+
|
V
[ AREA = 16 SQUARE METRES ]
ST_Area measures the area of a polygon. It returns a number.
You learned how to measure area with ST_Area. You saw examples from home, school, and Nigeria. Now you can measure areas in your spatial database.
ST_Length is a PostGIS function that measures the length of a line. It returns a number. The number is the length in the units of the coordinate system.
Length is important for measuring roads, rivers, and paths. ST_Length helps you measure length accurately.
Imagine you want to know how long the road from your house to the market is. ST_Length measures the length of the line that represents the road.
A road company measures the length of a road to estimate the cost of repairs.
A school measures the length of the running track for sports day.
At home, you measure the length of your garden fence.
In Lagos, the government measures the length of the Third Mainland Bridge.
SELECT ST_Length(
ST_GeomFromText('LINESTRING(0 0, 3 4)', 4326)
) AS length;
ST_LENGTH:
[ POINT A ] ------------------- [ POINT B ]
| |
V V
[ LENGTH = 5 METRES ]
ST_Length measures the length of a line. It returns a number.
You learned how to measure length with ST_Length. You saw examples from home, school, and Nigeria. Now you can measure lengths in your spatial database.
ST_Contains is a PostGIS function that checks if one shape contains another. It returns TRUE or FALSE. If the first shape contains the second, it returns TRUE.
Containment helps us answer questions like: "Is this house inside that flood zone?" or "Is this point inside that country?"
Imagine you have a box and a ball. The box contains the ball. ST_Contains tells you if the box contains the ball.
A bank checks if a customer's address is inside a branch service area.
A school checks if a student's house is inside the school bus route.
At home, you check if your house is inside a flood zone.
In Nigeria, the government checks if a village is inside a protected forest area.
SELECT ST_Contains(
ST_GeomFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))', 4326),
ST_GeomFromText('POINT(5 5)', 4326)
) AS contains;
-- Returns TRUE
ST_CONTAINS:
+-------------------+
| POLYGON |
| |
| โข <-- point inside
| |
+-------------------+
|
V
[ ST_CONTAINS = TRUE ]
ST_Contains checks if one shape contains another. It returns TRUE or FALSE.
You learned how to check containment with ST_Contains. You saw examples from home, school, and Nigeria. Now you can check if shapes contain other shapes.
ST_Intersects is a PostGIS function that checks if two shapes cross each other. It returns TRUE or FALSE. If the shapes share any space, it returns TRUE.
Intersection helps us answer questions like: "Do these two roads cross?" or "Does this river pass through that farm?"
Imagine you draw two lines on a paper. They cross each other. ST_Intersects tells you if the lines cross.
A road company checks if a new road will cross an existing pipeline.
A school checks if the new building will overlap with the playground.
At home, you check if your fence crosses your neighbour's fence.
In Nigeria, the government checks if a new road will cross a river.
SELECT ST_Intersects(
ST_GeomFromText('LINESTRING(0 0, 10 10)', 4326),
ST_GeomFromText('LINESTRING(0 10, 10 0)', 4326)
) AS intersects;
-- Returns TRUE
ST_INTERSECTS:
[ LINE A ] --------\
\
\
[ LINE B ] -----------\--------
\
\
[ ST_INTERSECTS = TRUE ]
ST_Intersects checks if two shapes cross each other. It returns TRUE or FALSE.
You learned how to check intersection with ST_Intersects. You saw examples from home, school, and Nigeria. Now you can check if shapes intersect.
ST_Within is a PostGIS function that checks if one shape is inside another. It returns TRUE or FALSE. It is the opposite of ST_Contains.
Within helps us answer questions like: "Is this point inside that polygon?" or "Is this house inside that neighbourhood?"
Imagine you have a ball inside a box. The ball is within the box. ST_Within tells you if the ball is within the box.
A delivery company checks if a customer's address is within the delivery zone.
A school checks if a student's house is within the school district.
At home, you check if your house is within a quiet zone.
In Nigeria, the government checks if a village is within a flood-prone area.
SELECT ST_Within(
ST_GeomFromText('POINT(5 5)', 4326),
ST_GeomFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))', 4326)
) AS within;
-- Returns TRUE
ST_WITHIN:
+-------------------+
| POLYGON |
| |
| โข <-- point within
| |
+-------------------+
|
V
[ ST_WITHIN = TRUE ]
ST_Within checks if one shape is inside another. It returns TRUE or FALSE.
You learned how to check within with ST_Within. You saw examples from home, school, and Nigeria. Now you can check if shapes are within other shapes.
A bounding box is the smallest rectangle that can contain a shape. It has four sides: top, bottom, left, and right.
Bounding boxes make spatial queries faster. The database can quickly check if two shapes might intersect by checking their bounding boxes first.
Imagine you draw a rectangle around a shape. The rectangle is the bounding box. It is like a box that holds the shape.
A delivery company uses bounding boxes to quickly find drivers near a customer.
A school uses bounding boxes to quickly find students near the school.
At home, you use bounding boxes to quickly find nearby shops.
In Lagos, a taxi company uses bounding boxes to quickly find nearby drivers.
BOUNDING BOX: +-------------------+ | +-----+ | | | | | | | โข | <-- shape inside bounding box | | | | | +-----+ | +-------------------+
A bounding box is the smallest rectangle that can contain a shape. It makes spatial queries faster.
You learned what a bounding box is. You saw examples from home, school, and Nigeria. Now you know that bounding boxes speed up queries.
Spatial operators are special symbols that work with spatial data. The && operator checks if two bounding boxes overlap. The <-> operator calculates the distance between two shapes.
Spatial operators make queries faster and easier. They are shortcuts for common spatial operations.
Imagine you have two boxes. The && operator tells you if the boxes touch. The <-> operator tells you how far apart the boxes are.
A bank uses && to quickly find branches in the same area.
A school uses && to quickly find students in the same neighbourhood.
At home, you use <-> to find the nearest shop.
In Lagos, a taxi company uses <-> to find the nearest driver.
-- Find all buildings in the same area as a point
SELECT name FROM buildings
WHERE geom && ST_GeomFromText('POINT(6.5774 3.3212)', 4326);
-- Find the nearest building to a point
SELECT name FROM buildings
ORDER BY geom <-> ST_GeomFromText('POINT(6.5774 3.3212)', 4326)
LIMIT 1;
SPATIAL OPERATORS:
[ && ] --> [ CHECK IF BOUNDING BOXES OVERLAP ]
[ <-> ] --> [ CALCULATE DISTANCE ]
|
V
[ FAST SPATIAL QUERIES ]
Spatial operators like && and <-> make queries faster. && checks if bounding boxes overlap. <-> calculates distance.
You learned about spatial operators. You saw examples from home, school, and Nigeria. Now you can use && and <-> in your queries.
ST_DWithin is a PostGIS function that checks if two shapes are within a certain distance. It returns TRUE or FALSE.
ST_DWithin is faster than ST_Distance. It is used to find all places within a certain distance of a point.
Imagine you want to find all shops within 1 kilometre of your house. ST_DWithin finds them quickly.
A delivery company finds all customers within 5 kilometres of a driver.
A school finds all students within 2 kilometres of the school.
At home, you find all hospitals within 3 kilometres of your house.
In Abuja, a taxi company finds all customers within 1 kilometre of a driver.
SELECT name FROM buildings
WHERE ST_DWithin(
geom,
ST_GeomFromText('POINT(6.5774 3.3212)', 4326),
1000
);
ST_DWITHIN:
[ POINT ] ----- 1 KM ----- [ BUILDING ]
|
V
[ ST_DWITHIN = TRUE ]
ST_DWithin checks if two shapes are within a certain distance. It is faster than ST_Distance.
You learned how to use ST_DWithin. You saw examples from home, school, and Nigeria. Now you can find places within a certain distance.
ST_Intersection returns the shape where two shapes overlap. ST_Union returns the combined shape of two shapes.
These functions help you combine and compare shapes. They are useful for planning and analysis.
Imagine you have two circles that overlap. ST_Intersection gives you the overlapping part. ST_Union gives you the total area of both circles.
A city planner uses ST_Union to combine two districts into one.
A school uses ST_Intersection to find where two playgrounds overlap.
At home, you use ST_Union to combine two garden plots.
In Nigeria, the government uses ST_Union to combine two local government areas.
-- Find the intersection of two polygons
SELECT ST_AsText(ST_Intersection(
ST_GeomFromText('POLYGON((0 0, 4 0, 4 4, 0 4, 0 0))', 4326),
ST_GeomFromText('POLYGON((2 2, 6 2, 6 6, 2 6, 2 2))', 4326)
));
-- Find the union of two polygons
SELECT ST_AsText(ST_Union(
ST_GeomFromText('POLYGON((0 0, 4 0, 4 4, 0 4, 0 0))', 4326),
ST_GeomFromText('POLYGON((2 2, 6 2, 6 6, 2 6, 2 2))', 4326)
));
ST_INTERSECTION:
+-------+-------+
| | |
| +---+---+ |
| | | | |
| +---+---+ |
| | |
+-------+-------+
|
V
[ OVERLAPPING AREA ]
ST_UNION:
+-------+-------+
| | |
| + |
| | |
| + |
| | |
+-------+-------+
|
V
[ COMBINED AREA ]
ST_Intersection returns the overlapping part of two shapes. ST_Union returns the combined shape of two shapes.
You learned about ST_Intersection and ST_Union. You saw examples from home, school, and Nigeria. Now you can combine and compare shapes.
ST_Buffer creates a new shape that is a certain distance around an existing shape. It is like drawing a circle around a point.
Buffers help you find all places within a certain distance of a shape. They are useful for planning and analysis.
Imagine you drop a stone in water. Ripples spread out in a circle. ST_Buffer creates a circle around a point.
A bank uses ST_Buffer to find all customers within 5 kilometres of a branch.
A school uses ST_Buffer to find all students within 1 kilometre of the school.
At home, you use ST_Buffer to find all shops within 500 metres of your house.
In Lagos, a taxi company uses ST_Buffer to find all customers within 2 kilometres of a driver.
SELECT ST_AsText(ST_Buffer(
ST_GeomFromText('POINT(6.5774 3.3212)', 4326),
0.01
)) AS buffer;
ST_BUFFER:
+-------+
/ \
| โข | <-- buffer around point
\ /
+-------+
ST_Buffer creates a new shape around an existing shape. It helps you find places within a certain distance.
You learned about ST_Buffer. You saw examples from home, school, and Nigeria. Now you can create buffers around shapes.
An error is a mistake. PostGIS tells you when you make a mistake. You can fix the mistake and try again.
Everyone makes mistakes. Learning to fix errors makes you a better expert.
Imagine you are writing a letter. You spell a word wrong. You erase it and write it correctly. Fixing errors in PostGIS is like that.
A bank worker uses the wrong SRID. PostGIS shows an error. The worker corrects the SRID and tries again.
A student uses the wrong function name. PostGIS shows an error. The student corrects the name and tries again.
At home, you use the wrong coordinate. PostGIS shows an error. You correct the coordinate and tries again.
In a Nigerian market, a trader uses the wrong polygon. PostGIS shows an error. The trader corrects the polygon and tries again.
| Error | What It Means | How to Fix It |
|---|---|---|
| function does not exist | PostGIS is not installed | Run CREATE EXTENSION postgis; |
| geometry has wrong SRID | The SRIDs do not match | Use ST_Transform to change the SRID |
| invalid geometry | The shape is not valid | Use ST_MakeValid to fix the shape |
| syntax error | You typed a command incorrectly | Check your spelling and punctuation |
| relation does not exist | The table does not exist | Create the table first |
ERROR:
[ TYPE: SELECT ST_Distance('POINT(0 0)', 'POINT(1 1)'); ]
|
V
[ ERROR: function st_distance(unknown, unknown) is not unique ]
|
V
[ FIX: USE ST_GeomFromText ]
|
V
[ TRY AGAIN ]
Errors are mistakes. PostGIS tells you when you make a mistake. You can fix the mistake and try again.
You learned about common errors and how to fix them. You saw a table of errors. Now you can fix mistakes in PostGIS.
An advanced spatial query is a query that uses multiple spatial functions together. It answers complex questions about locations.
Advanced queries help you solve real problems. They help you find answers that simple queries cannot.
Imagine you want to find all schools within 2 kilometres of a hospital that are also inside a certain neighbourhood. An advanced query answers that question.
A bank finds all customers within 5 kilometres of a branch who have accounts with more than 1 million naira.
A school finds all students who live within 1 kilometre of the school and have scores above 80.
At home, you find all shops within 500 metres of your house that sell bread.
In Lagos, a taxi company finds all drivers within 1 kilometre of a customer who have a rating above 4.5.
SELECT name FROM buildings
WHERE ST_DWithin(
geom,
ST_GeomFromText('POINT(6.5774 3.3212)', 4326),
2000
)
AND type = 'School'
AND ST_Contains(
ST_GeomFromText('POLYGON((6.5 3.3, 6.6 3.3, 6.6 3.4, 6.5 3.4, 6.5 3.3))', 4326),
geom
);
ADVANCED SPATIAL QUERY:
[ FIND PLACES WITHIN 2 KM ]
|
V
[ FILTER BY TYPE = 'SCHOOL' ]
|
V
[ FILTER BY CONTAINMENT IN AREA ]
|
V
[ RESULTS: SCHOOL A, SCHOOL B ]
Advanced spatial queries use multiple spatial functions together. They answer complex questions about locations.
You learned how to run advanced spatial queries. You saw examples from home, school, and Nigeria. Now you can solve complex problems with spatial data.
Best practices are the best ways to do things. They help you write clean, fast, and accurate spatial queries.
Following best practices makes your queries faster. It prevents problems later.
Imagine you are cleaning your room. You put things in the right place. Best practices for spatial queries are like putting things in the right place.
A bank follows best practices. Its spatial queries are fast and accurate.
A school follows best practices. Its spatial queries are fast and accurate.
At home, you follow best practices. Your spatial queries are fast and accurate.
In a Nigerian market, a trader follows best practices. Spatial queries are fast and accurate.
BEST PRACTICES:
[ USE SRID ] --> [ USE SPATIAL INDEXES ]
| |
V V
[ USE ST_DWITHIN ] --> [ USE BOUNDING BOXES ]
| |
V V
[ VALIDATE GEOMETRIES ] --> [ USE ST_TRANSFORM ]
| |
V V
[ TEST QUERIES ] --> [ KEEP DATA CLEAN ]
| |
V V
[ DOCUMENT QUERIES ] --> [ TEACH OTHERS ]
| |
V V
[ FAST, ACCURATE SPATIAL QUERIES ]
Best practices help you write clean, fast, and accurate spatial queries.
You learned best practices for spatial queries. You saw a list. Now you can write better spatial queries.
| Word | Simple Definition |
|---|---|
| Spatial relationship | How two or more places are connected. |
| ST_Distance | A function that measures the distance between two places. |
| ST_Area | A function that measures the area of a polygon. |
| ST_Length | A function that measures the length of a line. |
| ST_Contains | A function that checks if one shape contains another. |
| ST_Intersects | A function that checks if two shapes cross each other. |
| ST_Within | A function that checks if one shape is inside another. |
| Bounding box | The smallest rectangle that can contain a shape. |
| Spatial operator | A special symbol that works with spatial data. |
| ST_DWithin | A function that checks if two shapes are within a certain distance. |
| ST_Intersection | A function that returns the overlapping part of two shapes. |
| ST_Union | A function that returns the combined shape of two shapes. |
| ST_Buffer | A function that creates a new shape around an existing shape. |
SPATIAL RELATIONSHIPS
|
+---- ST_CONTAINS (shape contains another)
|
+---- ST_INTERSECTS (shapes cross)
|
+---- ST_WITHIN (shape inside another)
|
+---- ST_DWITHIN (shapes within distance)
Step 1: Learn what a spatial relationship is. Step 2: Learn ST_Distance. Step 3: Learn ST_Area. Step 4: Learn ST_Length. Step 5: Learn ST_Contains. Step 6: Learn ST_Intersects. Step 7: Learn ST_Within. Step 8: Learn about bounding boxes. Step 9: Learn spatial operators. Step 10: Learn ST_DWithin. Step 11: Learn ST_Intersection and ST_Union. Step 12: Learn ST_Buffer. Step 13: Fix errors. Step 14: Run advanced queries. Step 15: Learn best practices.
[ ST_DISTANCE ] --> [ MEASURE DISTANCE ] [ ST_AREA ] --> [ MEASURE AREA ] [ ST_LENGTH ] --> [ MEASURE LENGTH ] [ ST_CONTAINS ] --> [ CHECK CONTAINMENT ] [ ST_INTERSECTS ] --> [ CHECK INTERSECTION ] [ ST_WITHIN ] --> [ CHECK WITHIN ] [ ST_DWITHIN ] --> [ CHECK DISTANCE ]
| Function | What It Does | Example Use |
|---|---|---|
| ST_Distance | Measures distance between two places | How far is the school from the market? |
| ST_Area | Measures area of a polygon | How big is the farm? |
| ST_Length | Measures length of a line | How long is the road? |
| ST_Contains | Checks if one shape contains another | Is the house inside the flood zone? |
| ST_Intersects | Checks if two shapes cross | Do the roads cross? |
| ST_Within | Checks if one shape is inside another | Is the point inside the polygon? |
| ST_DWithin | Checks if shapes are within a distance | Find all shops within 1 km. |
| ST_Intersection | Returns overlapping part of two shapes | Where do the two areas overlap? |
| ST_Union | Combines two shapes into one | Combine two districts. |
| ST_Buffer | Creates a new shape around an existing shape | Draw a circle around a point. |
| Feature | ST_Distance | ST_DWithin |
|---|---|---|
| Purpose | Measures the exact distance | Checks if distance is within a limit |
| Return value | A number | TRUE or FALSE |
| Speed | Slower | Faster (uses index) |
| Use case | How far is it? | Is it within 1 km? |
In this module, you learned about spatial relationships and measurements. You learned what a spatial relationship is. You learned how to measure distance with ST_Distance. You learned how to measure area with ST_Area. You learned how to measure length with ST_Length.
You learned how to check containment with ST_Contains. You learned how to check intersection with ST_Intersects. You learned how to check within with ST_Within. You learned about bounding boxes. They make queries faster.
You learned about spatial operators like && and <->. You learned how to use ST_DWithin for distance queries. You learned about ST_Intersection and ST_Union. You learned how to use ST_Buffer.
You learned about common errors and how to fix them. You learned how to run advanced spatial queries. You learned best practices for spatial queries.
Now you are ready to move on to Module 4, where you will learn about spatial indexes and performance. But before you go, make sure you understand the key takeaways below.
Match the function in Column A with what it does in Column B.
| Column A | Column B |
|---|---|
| 1. ST_Distance | A. Checks if one shape contains another |
| 2. ST_Area | B. Measures the distance between two places |
| 3. ST_Length | C. Checks if two shapes cross each other |
| 4. ST_Contains | D. Measures the area of a polygon |
| 5. ST_Intersects | E. Measures the length of a line |
| 6. ST_Within | F. Checks if two shapes are within a distance |
| 7. ST_DWithin | G. Checks if one shape is inside another |
| 8. ST_Buffer | H. Creates a new shape around an existing shape |
Answers: 1-B, 2-D, 3-E, 4-A, 5-C, 6-G, 7-F, 8-H
Title: Find the Nearest School
Instructions: In groups of 3 or 4, create a spatial database with at least 5 schools.
Add their locations as points. Write a query to find the nearest school to a given point.
Write a query to find all schools within 2 kilometres of a given point.
Present your results to the class.
Example:
Table: schools (id, name, geom)
Data: School A, School B, School C, etc.
Query: SELECT name FROM schools ORDER BY geom <-> ST_GeomFromText('POINT(6.5774 3.3212)', 4326) LIMIT 1;
Title: Measure Your Neighbourhood
Instructions: Create a spatial database for your neighbourhood.
Add at least 5 places as points. Add at least 2 roads as lines.
Add at least 1 area as a polygon. Measure the distance between two places.
Measure the area of the polygon. Write down what you did.
Example:
Database: myneighbourhood
Tables: places (points), roads (lines), parks (polygons).
Query: SELECT ST_Distance(ST_GeomFromText('POINT(6.5774 3.3212)', 4326), ST_GeomFromText('POINT(6.5780 3.3220)', 4326));
Title: Build a Spatial Analysis Database
Materials: Computer with PostgreSQL and PostGIS installed.
Steps:
Assignment: For one week, practice spatial relationships and measurements. 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 4, you will learn about spatial indexes and performance. You will learn about:
Before you start Module 4, make sure you understand everything in this module. Practice measuring distances, areas, and lengths. Practice checking containment and intersection. Practice using ST_DWithin and ST_Buffer. When you are ready, turn the page and continue your journey to becoming a Certified PostGIS User!
End of Module 3.