In the previous blog, I said that geometric data types (dots, the definition of lines, faces, and sets), since geometric data types are extended through the CLR, learning C # knows that there are attributes and methods under an object, and the geometry data types have their properties and methods. The following diagram reflects the class relationships of these geometric objects.
Because I myself to C # more familiar (in fact, other languages are not how to do), here I follow the C # way to say.
The first thing to do is function. Functions are divided into several: constructors, static functions, and functions under instances.
2.1 First say constructor:
There are several constructors for constructing geometry objects and their following child objects: By being familiar with text wkt constructs, by knowing binary WKB constructs and through GML constructs. The following statement constructs a geometry object by wkt.
DECLARE @g geometry;
SET @g = Geometry::stgeomfromtext (' point (1 2) ', 0);