Katmai Spatial - What's a geometry

Following on my previous post on discovering the spatial types I mention that one of the aspects to understand is the different types of geometries.

Point

Fairly this is obvious its a single spot that has an X and a Y co-ordinate.

Multi Point

A group of points that are not connected. (if they were connected it would be a line or a polygon)

Line String

Guess what this is a line, but not neccesarily straight. Your line can change direction but it is continuous. A bit like a route, i.e. start at A go to B then go to C. Each point (A, B,C) is defined as a point and stored in the geometry.

The line can cross itself so i.e. to form a "&" sign or a "4". Whilst you might think that because this causes a closed area you have a closed geometry you don't. (I'll talk about closed geometries later)

LINE (0 0,1 1,5 1,10 0, 0 10)

Multi Line String

A group of lines. They do not have to be continuous.

Polygon

This is a shape that consists of one or more lines that start and end at the same point. A polygon must have at least 3 points (simplext polygon is a triangle).

POLYGON((0 0,0 10,10 10,10 0,0 0)) creates a square polygon 10x10 with its bottom left corner at 0,0

A  Polygon can have holes, this is done by specifying an additional set of points when you define the polygon. This set of points have to make up a polygon that is removed from the first polygon

POLYGON((0 0,0 10,10 10,10 0,0 0),(3 3,3 7,7 7,7 3,3 3))  amends the first polygon by removing a 4x4 square from the middle.

Multi Polygon

This guy is your friend, a polygon needs to be valid (I'll explain later). Thankfully there is a nice method on the geometry type that turns an invalid Polygon into a valid one. This generally creates a Multi Polygon, which is a collection of polygons (no suprise there).

Geometry Collection

You'll never guess what this is. Yep its a collectin of the above geometry types.

The key thing to consider is the dimension of your geometry as this is important when working with some of the methods like STOverlap and STContains. I'll discuss methods in another post.

-
Published Sunday, December 9, 2007 10:50 PM by simonsabin