SQL Reference
Geospatial Functions
the {{ocienthyperscaledatawarehouse}} has {{ocientgeo}} that supports three different geospatial geographies polygon , linestring , and point a polygon can be constructed with a closed linestring or an outer shell and array of inner rings a linestring represents a series of points connected by line segments it can be constructed with either linestring or point data types a point represents a point in space defined by an (x, y) or (longitude, latitude) coordinate pair each linestring or polygon value can be up to a maximum of 512 mb in size this means a linestring or polygon can contain approximately 32 million point values these supported geospatial data types require well known text (wkt) formatting for formatting examples, see docid\ ogtviwl gtbgv0chhrh 3 or https //en wikipedia org/wiki/well known text representation of geometry#geometric objects the ocientgeo functionality reference also contains examples with supported formatting and syntax each geospatial geography has a number of functions and operators that can be used in sql queries to perform analyses some functions apply to specific geography types for operators specific to geospatial data types, refer to /#geospatial operators ocientgeo uses the authalic radius of the earth, 6371007 1810824 meters, as the reference for many measurement calculations the authalic radius reference might cause slight differences in measurements compared to other geospatial systems that use a different radius definition geospatial operators ocientgeo supports special operators that perform operations on two different geographies these can be used in queries to compare geographies or calculate values based on the geographies operator syntax purpose intersects geoa && geob returns true if the bounding box of geography a intersects with the bounding box of b contained geoa @ geob returns true if the bounding box of geography a is contained within the bounding box of b equal geoa = geob returns true if the bounding box of geography a is the same as bounding box of b contains geoa geob returns true if the bounding box of geography a contains the bounding box of b distance geoa < > geob returns the distance in meters between the two geography parameters bounding box distance geoa <#> geob returns the distance in meters between the bounding box of the two geography parameters centroid distance geoa << >> geob returns the distance in meters between the centroids of the two geography parameters geospatial functions overview ocientgeo supports many geospatial functions that operate on point, linestring, and polygon values each function, its expected inputs, and return type are described in the following section geospatial filtering queries that involve geospatial filtering can make use of functions in the docid\ yna2fagkyiddm kxv4zgw section to optimize these queries, ocientgeo provides a spatial index that you can apply to columns with geospatial data types for details about the spatial index, see docid\ ssxi4zc3p mqdtr0b7qdn docid\ b7ofhdvlpchajicwqdpfb attribute functions return descriptive information on the specified data set st coorddim st dimension st geometrytype st isempty st memsize st ndims st ndimension st npoints st numpoints st srid st x st xmax st xmin st y st ymax st ymin docid\ uq rlzenk gtplkr2hyb5 conversion functions transform a specified operand to a different data type st asbinary st aswkb st asgeojson st asewkt st aslatlontext st astext st aswkt st geohash docid 276iafpj50xtsav3j0fte linestring constructors use geospatial data to create a linestring object st linefromtext st linefromgeojson st linefromwkb st linefromewkt st linestring st makeline docid 31upp yrw11odzobe2u49 linestring functions can perform alterations or access descriptive information on linestring objects st addpoint st endpoint st lineinterpolatepoint st linelocatepoint st linesubstring st pointn st removepoint st setpoint st startpoint docid\ c aaugo19qr znvjihgsy point constructors use geospatial data to create a point object st centroid st geogpoint st makepoint st point st pointfromewkt st pointfromgeohash st pointfromgeojson st pointfromtext st pointfromwkb docid\ bhntklcaesnevkgnxutqb polygon constructors use geospatial data to create a polygon object st forceccw st makepolygon st polygon st polygonfromgeojson st polygonfromwkb st polygonfromewkt st polygonfromtext st wholeearth docid 7gkks8lo euyq6 kadujb spatial measurement functions can perform basic calculations on geospatial data, such as measuring the distance between two point objects or the area of a polygon object st area st angle st azimuth st distance st distancesphere st distancespheroid st euclideandistance3d st hausdorffdistance st length st length2d st minimumdistancetosurface st maxdistance st perimeter st perimeter2d docid\ aawcrtqvk1nkc0hcgthci spatial operators perform geometry calculations on geospatial data to return a different type of geospatial data st boundingdiagonal st buffer st closestpoint st convexhull st differencearray st envelope st expand st exteriorring st flipcoordinates st force2d st interiorringn st intersectall st intersectionarray st longestline st makeenvelope st minimumboundingcircle st multidifferencearray st multiintersectionarray st multisymdifferencearray st multiunionarray st nrings st numinteriorring st numinteriorrings st pointonsurface st project st reduceprecision st removerepeatedpoints st reverse st segmentize st shortestline st simplify st simplifyarray st snaptogrid st symdifferencearray st unionarray docid\ yna2fagkyiddm kxv4zgw spatial relationship functions use arguments to test for different types of spatial relationships st clusterdbscan st contains st containsproperly st covers st coveredby st crosses st disjoint st dwithin st equals st intersects st isccw st ispolygonccw st ispolygoncw st isclosed st isring st issimple st isvalid st overlaps st pointinsidecircle st relate st touches st within docid 7 zeg8islnkj4baleyfqp spatiotemporal measurement functions can perform basic calculations on geospatial data paired with timestamp data st distance st maxdistance st totalsecondsinintersection docid\ wxa0sylklnrbwwv tlrxy spatiotemporal operators perform calculations on geospatial data using an array of timestamp arguments st longestline st linegetalltimesatpoint st linegetpointattime st linegettimeatpoint st intersection st shortestline related videos https //youtu be/tiltpbcp0rg