How draw circle into circle or "donut" ?

כל התגובות

  • You declare it exactly the same way - with the exterior ring (the outside of the circle) listed first, and then the inner ring (the "hole") listed second.

    SQL Server 2008/R2 doesn't support truly curved geometries (but then again neither does the Google Maps example you've given). You can create approximate "circular" n-sided polygons around a point using STBuffer(), like this:

    DECLARE @Centre geography = 'POINT(151.2 -33.9)'; --Sydney, Australia
    DECLARE @RadiusOfCircle float = 150000; --150km
    DECLARE @RadiusOfHole float = 70000;  --70km
    -- Create a Doughnut polygon by subtracting hole from the circle
    SELECT @Centre.STBuffer(@RadiusOfCircle).STDifference(@Centre.STBuffer(@RadiusOfHole));

    Or, if you're using SQL Server 2012, you can use the BufferWithCurves() method to create CurvePolygon of the same.

    twitter: @alastaira blog:

    שבת 25 פברואר 2012 07:58