Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 19: Using Spatial Data > Implementing the Geometry Type

Implementing the Geometry Type

Now that you have seen the kinds of data that you can store into the geometry type and how to define the storage, you are ready to implement the type and load values accordingly. This process is a little bit different from what you are used to with standard types, but it does follow a standard formula, so it is easy to get comfortable with quickly.

In this section, we will begin by learning how to load data into a geometry type based on the specific subtypes in question. Then we will look at how to manipulate that data using the methods associated with the .NET types.

Loading Geometry Data

Because spatial data utilizes .NET managed types as opposed to simple SQL Server datatypes, loading values into a spatially typed table or variable is not as simple as assigning the value directly. Instead, you will need to use methods associated with the spatial types to define this storage. The arguments that you provide to these methods are text-based and use a format defined by the OGC called Well-Known Text (WKT). Here is an example of using WKT to assign a point value at position (0,0) to a geometry variable.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint