Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

why is The following LineString instances are not valid. Expand / Collapse
Author
Message
Posted Friday, November 1, 2013 10:28 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, March 12, 2014 6:50 PM
Points: 39, Visits: 141
with reference to http://technet.microsoft.com/en-us/library/bb895372.aspx



DECLARE @g1 geometry = 'LINESTRING(1 4, 3 4, 2 4, 2 0)';
DECLARE @g2 geometry = 'LINESTRING(1 1, 1 1)';
SELECT @g1.STIsValid(), @g2.STIsValid();
0 0


why is the above invalid? based on these facts


Valid Instances
For a LineString instance to be valid it must meet the following criteria.
The LineString instance must be accepted.
If a LineString instance is not empty then it must contain at least two distinct points.
The LineString instance cannot overlap itself over an interval of two or more consecutive points.


how can the above query be invalid? can some one kindly explain to me what is the meaning of

The LineString instance cannot overlap itself over an interval of two or more consecutive points.

thanks
Post #1510697
Posted Friday, November 1, 2013 11:09 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 3:37 PM
Points: 3,374, Visits: 7,300
@g1 is overlapping itself as it's going from 2 4 to 3 4 twice.
@g2 does not have at least two distinct points. It's a single point referenced twice.



Luis C.
I am a great believer in luck, and I find the harder I work the more I have of it. Stephen Leacock

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1510720
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse