O'Reilly logo

Programming Microsoft® SQL Server™ 2008 by Leonard Lobel, Andrew Brust, and Stephen Forte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required