Introduction
Points
Linestrings
Polygons
27. Polygons
Summary

Instruction

The hotel shapes and colored areas you saw in the last exercise are the last type of geometry we'll get to know today: polygons. Polygons are used for bigger objects whose shape matters more to us than anything else, such as parks, lakes, districts etc. Technically speaking, polygons are defined using closed linestrings. What differentiates them from closed linestrings is that polygons have an area greater than 0. Below, we present an example polygon.

Polygons

Polygons can be made up of single or multiple linestrings, but the latter case will be discussed in another part of the course.

Exercise

Show the name and coordinates columns of the sf_sights table for the attractions 'San Francisco Botanical Garden' and 'Golden Gate Park'.

Take a look at the MAP tab. Do you notice anything interesting about the result?

Stuck? Here's a hint!

Use the WHERE name IN (...) expression.

Don't forget to put each name in quotation marks!

Console

Code editor

Result

TableConsoleMap