COGO: Compute chord length of segment of a circle (arc)

In working with circles one must be able to compute the arc2chord separation, the length of an arc and the length of the chord subtended by an angle subtended at the centre of a circle. In particular this is important for converting circles to vertex-stroked polygons and vice versa. Here is an encoding of theRead More

COGO: Computing Arc To Chord (Arc2Chord) Separation

Computing the arc to chord (Arc2Chord) separation between an arc on the circumference of a circle and the chord subtended by that arc is considered to be a vital measure for determining how well a vertex defined polygon matches its related circle (or arc in a circular arc). In cadastral applications, an arc to chordRead More

COGO: Creating a stroked polygon from a circle’s centre x,y and radius

The relevant standards covering spatial data types within databases provide functionality at many levels (and miss some that is required by pratitioners like myself) from object definition through to API specification. One area within those standards that has limited support within commercial GIS software and database implementations is the case of circular arcs (line andRead More

COGO: Finding centre and radius of a curve defined by three points: FindCircle function

Recently I had need to convert a PL/SQL Oracle Spatial function I created years ago called FindCircle to SQL Server 2008 for use in another project. That function was original work already released to the public domain as part of my free COGO package for Oracle. Here is that function for SQL Server. Note that IRead More

Generating random point data for SQL Server 2008 Spatial

There is often a need for all sorts of reasons, for the generation of spatial data within a database like SQL Server 2008. I have blogged on this before for Oracle Locator/Spatial but the tricks to doing this in SQL Server 2008 are very much different from what is achievable in Oracle. This is toRead More

New Presentation on Active (Searchable) Spatial Metadata for SQL Server 2008 Spatial and FreeText

I gave a presentation on some work I did last year for a customer on providing a sophisticated spatial/textual search capability against over 700 tables of spatial data stored in SQL Server 2008 Spatial. The searching combined Spatial and Free Text index based searching. The basic idea is that the main thing in static spatialRead More

STisGeo: Checking if a column in a table or a view is of type geometry or geography

Sometimes things are simple and prosaic rather than clever and complicated. Building solutions in TSQL requires one to build a prior collection of handy functions before one can be really productive. Here is a function I use called isGeo which if provided the name of a table/view and a column name returns 1 (true) ifRead More

STGeometryTypes: Extracting all geometry type string values from complex geometry

Ever needed to extract a textual description of all geometry types in a single geometry/geography in SQL Server 2008 inluding all sub-elements? Recently I had cause to do so and created the following function that implements this need. Now let’s test it against a selection of all possible geometry types I hope this function isRead More

Vectorising geometry objects in SQL Server 2008

I demonstrated in this article the usefulness of having a vectorising function in one’s spatial database kitbag (there are GetVector functions in my CENTROID and GEOM packages – in particular the GetVector function is vital to the implementation of the algorithm in my CENTROID.SDO_CENTROID function). So, I have also added one to my SQL ServerRead More

STMBR2Geometry/STMBR2Geography functions

Oracle has a polygon geometry type (non-standard) called an optimized rectangle. To define one all one has to do is supply it with the lower-left and upper-right coordinates. This is a much easier thing to do than having to supply 5 coordinates in anti-clockwise order. PostGIS also has a bunch of bounding box functions thatRead More