70 likes | 162 Views
Implementing the Region Syntax. A.Szalay, T.Budavari, P.Dowler, +ADQL Working Group. Function-Based Approach. Region is an object that has Constructors Properties (area) Operators
E N D
Implementing the Region Syntax A.Szalay, T.Budavari, P.Dowler, +ADQL Working Group IVOA Interop
Function-Based Approach • Region is an object that has • Constructors • Properties (area) • Operators • Implemented in SQL Server 2005, using the Spherical library (C# + SQL) built for SDSS and the NVO Footprint Service IVOA Interop
Similar to Existing GIS Systems • SpatialWare (MapInfo) uses the same technique but with lots of functions • Geometry datatypes • Point, Line, PolyLine, Polygon, Arc, … • Constructors • Circle, Box, Polygon,… • Full set operators • More detailed topological relations • Contain, Outside, Overlaps, Adjacent, … • Buffer • Cast • AsText IVOA Interop
Steps • Create a Region schema (namespace) • Define constructors • Region, Circle, Rectangle • Define properties • Area • Operators • Contains, Intersects, ToString • Support • Distance IVOA Interop
Lessons • SQL-92 functions with variable number of arguments (Polygon) not allowed • Use the Region(string) to build these • No boolean datatype in SQL-92 • Use bit (0,1) and explicit comparisons • Contains is protected in T-SQL (freetext) • Need to write it as Region.[Contains] • Distance function was trivial IVOA Interop
Immediate Questions • Units? • Angles: degrees • Area: square degrees • Distances: degrees • GIS Compatibility? • Contains-> Contain • Intersects -> Overlap • ToString -> AsText • Distance -> SphericalDistance IVOA Interop
Operator Extensions Later? • Output is Region type • Intersection(r1,r2) • Difference(r1,r2) • Union(r1,r2) • Buffer(r1, delta) IVOA Interop