HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
GIS: Coordinates, Projections and Map Layers
  1. 1Latitude, longitude and the shape of the Earth
  2. 2Map projections and grids
  3. 3Vector layers and raster layers
  1. Earth and Environmental Science
  2. /GIS: Coordinates, Projections and Map Layers
  3. /Vector layers and raster layers

Course 12.2·Lesson 3 of 3

Vector layers and raster layers

A GIS stacks layers of one coordinate system. Vector layers hold points, lines and polygons with a table of attributes, and raster layers hold a grid of cells. A geotransform places the cells, map algebra combines them, and a flood map must follow connections between cells.

about 35 min1 simulation2 practice questions
Lesson 3 of 3Show all lessonsHide
GIS: Coordinates, Projections and Map Layers
  1. 1Latitude, longitude and the shape of the Earth
  2. 2Map projections and grids
  3. 3Vector layers and raster layers

Try the code and the simulations beside the lesson.

A map made of layers

A city planner wants a new hospital. She needs the roads, the flood zones, the land value, the population and the height of the ground. Each of these is a layer: one theme, over one area. A geographic information system (GIS) stores the layers, lines them up, and answers questions across them: where is the land flat, away from floods, within 5 km5\ \text{km}5 km of a road? The layers line up only when they share one coordinate reference system (CRS), a datum and a projection together.

Vector layers

A vector layer holds shapes made from coordinates:

  • a point for a well or a city;
  • a line for a road or a river;
  • a polygon for a lake or a district.

Each shape is a row of an attribute table. The columns are fields: a name, a population, a land use. A query picks rows by their fields, or by their place.

Common operations:

  • Buffer. All points within a distance ddd of a shape. A buffer of a polygon with area AAA and perimeter PPP, if the polygon is convex, has the area A+Pd+πd2A + Pd + \pi d^2A+Pd+πd2.
  • Intersect, clip, union. Keep the part where two layers overlap, cut one layer by the other, or join them.
  • Dissolve. Merge shapes that have the same value of a field.

The area of a polygon with corners (xi,yi)(x_i, y_i)(xi​,yi​), listed in order round the edge, is given by the shoelace formula. Add up the terms SSS round the polygon, and take half of the size of the sum:

S=∑i(xiyi+1−xi+1yi)\displaystyle S = \sum_i \left(x_i y_{i+1} - x_{i+1} y_i\right)S=i∑​(xi​yi+1​−xi+1​yi​)
A=12 ∣S∣\displaystyle A = \tfrac{1}{2}\,|S|A=21​∣S∣

It is valid only if the coordinates are in metres on a plane. In degrees it gives a meaningless number. So project the layer first, with an equal-area or a local UTM system.

Raster layers

A raster layer is a grid of cells with one value in each. The value may be a height, a temperature, a land-cover class or a reflectance. The cells have a size sss, and there are rows and columns.

How do the cells find the ground? Through the geotransform. It gives the coordinates of the upper left corner of the grid (E0,N0)(E_0, N_0)(E0​,N0​) and the cell size. The cell in column jjj and row iii has its centre at

E=E0+(j+12)s\displaystyle E = E_0 + \left(j + \tfrac{1}{2}\right)sE=E0​+(j+21​)s
N=N0−(i+12)s\displaystyle N = N_0 - \left(i + \tfrac{1}{2}\right)sN=N0​−(i+21​)s

Rows are counted down from the top, and the north coordinate falls as the row number grows. ![A raster drawn as a grid of squares, 6 columns wide and 5 rows deep, with the squares shaded in a chessboard pattern. A red dot at the top left corner is labelled origin, E0 and N0. Columns 0, 1 and 2 are named above the grid and rows 0, 1 and 2 are named at its left. One cell, in column 2 and row 1, is shaded orange, and a dot marks its centre. A blue arrow runs east along the top edge from the origin to the middle of column 2, and is labelled j plus one half cells east. A green arrow runs south from the end of the blue arrow to the centre of the cell, and is labelled i plus one half cells south.](https://tuygolavdykfydmasiqc.supabase.co/storage/v1/object/public/discussion-images/57b80fd5-0d05-40b0-bb7c-fdadd190c00d/figures/ch12-remote-sensing-gis-and-earth-data-with-python/ees12-k2-raster.png) If the raster is rotated, the geotransform has two more terms, which together make an affine transformation. A cell of a raster of s=30 ms = 30\ \text{m}s=30 m has an area of 900 m2900\ \text{m}^2900 m2. A small cell size gives more detail, a bigger file, and less light per pixel for a sensor. A raster has a NoData value for cells without a measurement. Common file types are GeoTIFF for rasters, GeoJSON and shapefile for vectors.

Map algebra

Operations on rasters come in kinds, by the part of the grid that each output cell uses.

  • Local. Each cell alone: an index such as NDVI, or a reclassification.
  • Focal. A window of neighbours: smoothing, and the slope.
  • Zonal. All cells in a zone: the mean height of each district.
  • Global. The whole grid: distance to the nearest road.

The slope at a cell comes from the heights of its neighbours. With central differences, for cells sss apart, the east-west and north-south rises per metre are zxz_xzx​ and zyz_yzy​:

zx=zE−zW2s\displaystyle z_x = \dfrac{z_E - z_W}{2s}zx​=2szE​−zW​​
zy=zN−zS2s\displaystyle z_y = \dfrac{z_N - z_S}{2s}zy​=2szN​−zS​​
tan⁡θ=zx2+zy2\displaystyle \tan\theta = \sqrt{z_x^2 + z_y^2}tanθ=zx2​+zy2​​

The gradient in percent is 100tan⁡θ100\tan\theta100tanθ. A 3 by 3 window with weights 1,2,11, 2, 11,2,1 on the neighbouring cells is Horn's method, which is less sensitive to a single bad cell.

A weighted overlay builds a suitability score from layers that are scored on one scale: S=∑wkskS = \sum w_k s_kS=∑wk​sk​ with weights that add up to 111.

A sea-level map has a trap. A cell that lies below the new sea level floods only if the water can reach it, through cells that are also below the level. A pit behind a hill stays dry. So we start at the sea and spread to the neighbours that share an edge.

Placing a scanned map

An old map comes as a picture, with positions in pixels (j,i)(j, i)(j,i). To place it, we pick ground control points, places whose map coordinates we know. An affine transformation E=a+bj+ciE = a + bj + ciE=a+bj+ci, N=d+ej+fiN = d + ej + fiN=d+ej+fi has six numbers. Three points that do not lie on one line give six equations, which fix the numbers. A fourth point left out of the fit shows the residual error.

Worked example: where is a cell?

A scene has the corner (E0,N0)=(300 000 m,3 000 000 m)(E_0, N_0) = (300\,000\ \text{m}, 3\,000\,000\ \text{m})(E0​,N0​)=(300000 m,3000000 m) and cells of 30 m30\ \text{m}30 m. Find the centre of the cell in column 858585 and row 120120120.

  1. Easting. E=E0+(j+0.5)sE = E_0 + (j + 0.5)sE=E0​+(j+0.5)s, with E0=300 000 mE_0 = 300\,000\ \text{m}E0​=300000 m. This gives E=302 565 mE = 302\,565\ \text{m}E=302565 m.
  2. Northing. N=N0−(i+0.5)sN = N_0 - (i + 0.5)sN=N0​−(i+0.5)s, with N0=3 000 000 mN_0 = 3\,000\,000\ \text{m}N0​=3000000 m. This gives N=2 996 385 mN = 2\,996\,385\ \text{m}N=2996385 m.
  3. Check. The cell is a little over 2.5 km2.5\ \text{km}2.5 km east and 3.6 km3.6\ \text{km}3.6 km south of the corner, as 85.5×30=2565 m85.5 \times 30 = 2565\ \text{m}85.5×30=2565 m and 120.5×30=3615 m120.5 \times 30 = 3615\ \text{m}120.5×30=3615 m.

Make the cell size 90 m90\ \text{m}90 m. How does the area of the whole raster change? What stays the same?

Practise with new numbers

Try it in Python

The program finds the area of a field from its corners with the shoelace formula, and then floods a small coast. It counts the low cells and the cells that the sea reaches.

Predict first. Are all the low cells flooded? Then run it. Check with Show the answer.

1. Raise level to 2.5. Does the number of cells that the sea reaches grow by one cell, or by more?

2. Change the field's corners to a rectangle of 100 m100\ \text{m}100 m by 50 m50\ \text{m}50 m. Does the area come out as 5000 m25000\ \text{m}^25000 m2?

Common mistakes

  • Overlaying layers with different coordinate systems. Reproject one to the other first.
  • Computing an area in degrees. Use metres, in an equal-area or UTM system.
  • Mixing up rows and the north direction. Row 000 is at the top, and the northing falls as the row grows.
  • Flooding every low cell. A cell floods only if water can reach it through low cells.

Remember these

  • Vector: points, lines, polygons and an attribute table. Raster: cells, with a size and an origin.
  • E=E0+(j+12)sE = E_0 + (j + \tfrac{1}{2})sE=E0​+(j+21​)s and N=N0−(i+12)sN = N_0 - (i + \tfrac{1}{2})sN=N0​−(i+21​)s.
  • Shoelace area; buffer of a convex polygon A+Pd+πd2A + Pd + \pi d^2A+Pd+πd2.
  • Slope: tan⁡θ=zx2+zy2\tan\theta = \sqrt{z_x^2 + z_y^2}tanθ=zx2​+zy2​​. Local, focal, zonal and global operations.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. A raster has cells of 20 m20\ \text{m}20 m. How many cells make one hectare?
  1. Why must two layers share a coordinate reference system before they are overlaid?
  1. A slope of 45∘45^\circ45∘ is what gradient in percent?
  1. Which kind of operation is the mean height of each district?

References

  • P. A. Longley, M. F. Goodchild, D. J. Maguire and D. W. Rhind, Geographic Information Science and Systems (4th edition, Wiley, 2015), the chapters on Representing Geography, Geographic Data Modeling, and Spatial Analysis.
  • B. K. P. Horn, Hill shading and the reflectance map, Proceedings of the IEEE 69 (1981), pages 14 to 47, for the slope with a 3 by 3 window.
  • NCERT, Practical Work in Geography Part II (Class 12), the chapter on Spatial Information Technology.

Enroll free in GIS: Coordinates, Projections and Map Layers

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (4)

A field is a convex polygon whose corners, in metres east and north in a UTM zone, are (500, 200)…Hard · High School (11–12) · by StemPy Lab
A scanned map has pixels counted by column j and row i from its top left corner…Advanced · High School (11–12) · by StemPy Lab
A coast is stored as a raster of 6 rows and 6 columns of cells, each 30 m by 30 m…Hard · High School (11–12) · by StemPy Lab
That was the last lessonBack to the course: take the test
← GIS: Coordinates, Projections and Map Layers
← Map projections and gridsNext →

Discussion (0)

Log in to join the discussion.

Loading…

1 Python program
5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

A height raster has cells 30 m apart. Around one cell the heights in metres are, from the…Hard · High School (11–12) · by StemPy Lab

Python Labs (1)

A raster calculation: slope and floodingPython Lab · by StemPy Lab

Question Sets (1)

Maps and Coordinates: Think It Through10 questions · by StemPy Lab

Notes (1)

GIS: Coordinates, Projections and Map Layers: Quick RevisionNote · by StemPy Lab