Geospatial Functions
the has 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 data types docid\ jklzoceo9ij3akjz5r bi or wkt representation of geometry 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 docid\ c xku2wubvnuz7vck rnl 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 spatial relationships docid\ fvbf3zgu l24y1bqdtnd4 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 secondary indexes docid\ xmmylaxzqfci6ysnff5tg attribute functions docid\ yzitmkmyxkeu7r6cntc5a 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 conversion functions docid\ l 4bbb9ayyg7wylg5ltmq 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 linestring constructors docid 6uezqid8dcteeex56nu i linestring constructors use geospatial data to create a linestring object st linefromtext st linefromgeojson st linefromwkb st linefromewkt st linestring st makeline linestring functions docid 4rydqn3pevreftzqwzaqv 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 point constructors docid\ fsfzuzxxkqdygtxlhvutg 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 polygon constructors docid\ ydhdag fujbsgtwiqdtl 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 spatial measurement docid\ swxyidktpfo 1rw15l3wq 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 spatial operators docid\ nmeng1 xs7g55ks6jbrwk 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 spatial relationships docid\ fvbf3zgu l24y1bqdtnd4 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 spatiotemporal measurement docid\ py20tggfthft07gsdu5b2 spatiotemporal measurement functions can perform basic calculations on geospatial data paired with timestamp data st distance st maxdistance st totalsecondsinintersection spatiotemporal operators docid\ bk87nieddtgdcco8n6asg 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 at the whiteboard with ocient geospatial analytics https //youtu be/tiltpbcp0rg