Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Locked Parameters in Spatial data methods:

  • 2012년 2월 23일 목요일 오전 5:54
     
     

    Hi,

    I was lokking at this query:

    DECLARE @geom1 geometry

    SET @geom1 = geometry::STPolyFromText('POLYGON((2 0, 0 2, 2 4, 4 4, 6 2, 4 0, 2 0))',0) 

    SELECT @geom1

    The query is working fine. But I'm not getting what the parameters are for in

    POLYGON((2 0, 0 2, 2 4, 4 4, 6 2, 4 0, 2 0))',0)
    Can any body please explain the same?

    Thanks,

    Santosh

모든 응답

  • 2012년 2월 23일 목요일 오전 10:16
     
     

    The first parameter, POLYGON((2 0, 0 2, 2 4, 4 4, 6 2, 4 0, 2 0)) , is the WKT of the shape that you want to create - in this case, a 6-sided polygon like this:

    The second parameter is the SRID in which the coordinates have been defined. Since this is just an abstract geometric shape, it's 0 in this case.


    twitter: @alastaira blog: http://alastaira.wordpress.com/