SQL Server Spatial data type

Source: Internet
Author: User

--3Create tables with spatial data create TABLE X (vintNotNULLIdentity1,1) Primary key, Geog geography notNULL, Geogwkt asGeog. Stastext ())--4. Add spatial data insert into X (GEOG) VALUES (Geography::P Arse ('POLYGON ((-93.123 36.943,                                   -93.126 36.953,                                   -94.129 36.986,                                   -93.123 36.943)                                 )'                       )         ),   --polygon, start and end coordinates must be the same, note that polygon must contain 2 brackets, otherwise error (Geography::P Arse ('Point ( -93.123 36.943)')),    --Point Coordinates (geography::P Arse ('LINESTRING ( -93.123 36.943,-93.126 36.953)'))  --two lines between coordinates--5- calculation of geographic dataSelectV, geogwkt, Geog. Stdistance ('Point ( -93.123 36.985)'),          --distance geog. Stintersects ('Point ( -93.123 36.943)'),        --whether there is an intersection geog. Stlength (),--length Geog. Starea (),--Polygon Area Geog. Stastext ()--wkt Formatted coordinates fromx/*V geogwkt (no column name) (no column name) (no column name) (no column names) 1 POLYGON ((-93.123 36.943,-93.126 36.953, 94.129 36.986 , -93.123 36.943)) 3561.29978820883 1 180244.411606998 48996227.1008911 POLYGON (-93.123 36.943,-93.126 3 6.953, -94.129 36.986, -93.123 36.943) 2 point ( -93.123 36.943) 4661.03285004629 1 0 0 Point (-93.123 36 .943) 3 LINESTRING ( -93.123 36.943, -93.126 36.953) 3561.29978820883 1 1141.48450709835 0 LINESTRING (-93 .123 36.943, -93.126 36.953)*/Select* fromX

SQL Server Spatial data type

Related Article

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.