why is The following LineString instances are not valid.

  • 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();

    00

    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

  • @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.
    General Disclaimer:
    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?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply