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: Saturday, December 6, 2014 6:57 PM
Points: 39, Visits: 144
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


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 11:13 AM
Points: 4,066, Visits: 9,235
@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.
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

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