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/