Working with geometry
Our first example shows how to define and store shapes representing town districts and avenues using the geometry data type and then demonstrates how to query this data to return a list of the avenues that run through each district. This little one-horse town has only three districts and two main avenues and is small enough to be expressed on a planar (flat) surface using the geometry data type. As we progress through the example, you’ll learn how to use a number of common geospatial methods with this data type.
Figure 9-3 shows the shapes that map out the town and the xy-coordinates for the points of each shape. The three districts are polygons (closed shapes), and the two avenues are line strings. We will store these shapes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access