Reputation: 915
This question examines geography::STBuffer. Expanding on David Storfer's comment, geometry fields are treated differently and have an entirely different set of documentation. However, that documentation doesn't explore the issue of units in great detail. Our information contains SHAPE data stored as a geometry field so I need to know what units is geometry::STBuffer using?
Upvotes: 3
Views: 1502
Reputation: 915
This discussion states "coordinate systems in sys.spatial_reference_systems are for the geography type" so despite looking at this in detail, it appeared that this information was not relevant to this question. After some further investigation, I resorted to using STDistance and manually examining a map to confirm that for our information at least, geometry::STBuffer (and geometry::STDistance) the values being used correspond with meters being used as the distance of measure. This SO question suggests that the return value from STDistance is in degrees but that was not the behaviour that I observed. Following the GIS SO link provided on that page and the subsequent MSDN post, where it was once again stated that "The SRIDs listed in sys.spatial_reference_systems refer to the geography type only" and, that "For the geometry type, the linear units returned by methods such as Distance, Length, and Area are always in the unit coordinates of the points", I concluded that the answer to this question actually depends on what unit was used to create the dataset.
P.S. Of course, I now wanted to know how to determine the unit of my information. This SO post examines units in general and the accepted answer ran along the lines of if your data columns were created with an SRID of 0, then the system is defined to be unit-less and you would need some metadata about the data model to figure out the units. If they were defined with a real SRID, then you can query sys.spatial_reference_systems. So it seems I had to return to where I started, looking at sys.spatial_reference_systems. Another MSDN post appears to support the notion that spatial_reference_systems is relevant when discussing geometry fields.
This GIS SO post explains how to determine which SRID is actually being used by your data - (select distinct SP_GEOMETRY.STSrid from dbo.MYTABLE). That can then be matched against the information in sys.spatial_reference_systems although, it takes a bit more work to determine which record in sys.spatial_reference_systems is a match, e.g. when using our data select distinct SP_GEOMETRY.STSrid from dbo.MYTABLE returned 28355 but that value doesn't appear in sys.spatial_reference_systems - according to http://spatialreference.org/ref/epsg/gda94-mga-zone-55/html/ that value is actually an identifier for the projection. Looking through the contents returned by spatialreference.org, the authority details (AUTHORITY["EPSG","4283"]) look like they provide the appropriate SRID to match a record in sys.spatial_reference_systems. In our case, the unit_of_measure is listed as metre.
P.P.S. Interested to hear thoughts before deciding if I post comments in some of the references above.
Upvotes: 2