locked
Parameters in Spatial data methods: RRS feed

  • Question

  • 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

    Thursday, February 23, 2012 5:54 AM

All replies

  • 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/

    Thursday, February 23, 2012 10:16 AM