SQL2008 Spatial data Type--Euclidean geometry 1 Foundation

Source: Internet
Author: User
Tags mixed

In SQL2008, the support of geospatial data types is added, which is divided into 2 kinds: Euclidean (plane) geometry geometry and geospatial (elliptical body) Geometry geography. European geometry you've basically learned, is expressed in terms of coordinates, and geographical space is the use of longitude and latitude to express, because plane geometry is relatively simple (I remember as if the middle school when the plane analytic geometry, high middle school three-dimensional analytic geometry), so I learned from the simple, first learn geometry data types.

In plane geometry we have 3 basic elements: dots, lines, and faces. Corresponding to the geometry data types are these 3 types of point, LineString, Polygon, and their respective collections multipoint, multilinestring, Multipolygon and another one of them. Mixed sets of geometrycollection, mixed sets can contain multiple point multiple linestring and multiple polygon. It is easy to see multipoint, multilinestring, Multipolygon is a special case of geometrycollection. The official relationship between them is as follows:

When you need to declare a geometry object, you need to use a function that it provides stgeomfromtext convert a declaration of a string form to an object. For example, to declare a point, the coordinates are 1, and the 2 corresponding SQL statement is:

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('POINT (1 2)', 0);
SELECT @g.ToString();

In addition to accepting the 2 parameters of X y, the point here also accepts Z (elevation elevation) and M (metric measure) values, and does not seem to have this concept in plane geometry? Don't know what to do with it, it is estimated that it will be used in the geographical data type.

In addition to strings, Stgeomfromtext also has a parameter that is Srid. Srid is the abbreviation of space reference identifier, mainly used for geographical data types, in the plane Geometry data type Srid default is 0, on the specific role of Srid in the geographical data types of time to study, only to know that the different Srid 2 instances are not operational, the result of the operation is null.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.