SQL Reference
Geospatial Functions
Point Constructors
{{ocientgeo}} point constructors use geospatial data to create a point object st centroid returns a point that is the geographic center of mass of a specified geospatial object the geographic center of mass is calculated by taking the average of all points on a three dimensional sphere, projecting the resultant point onto the sphere, and converting it back to latitude and longitude coordinates syntax st centroid( geo \[, use spheroid ] ) 136,178,350 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st centroid(st polygon('polygon((1 1, 2 1, 2 2, 1 1))')); output point(1 66 1 33) st geogpoint alias for st polygon(st linestring(array(st point(lon, lat)))) creates and returns a polygon geography with a single point, defined by the longitude and latitude specified for the function syntax st geogpoint(lon, lat) 108,139,350 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st geogpoint(41 882548, 87 63922); output polygon((41 882548 87 63922)) st makepoint alias for docid 9nnprzt3hqeet7csvwwxe st point creates a point from the specified input arguments st point(binary) alias for st pointfromwkb creates a point from the specified binary value, which must represent a point in wkb format syntax st point(binary) 135,147,350 2 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st point(binary('0x0101000000000000000000f03f0000000000000040')); output point(1 2) st point(char) creates a point from a char value that represents a point in wkt format syntax st point(char) 135,155,350 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st point('point(1 2)'); output point(1 2) st point(lon, lat) creates a point defined with the values provided for the longitude and latitude coordinates syntax st point(lon, lat) 135,155,350 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st point(87 6386, 41 8843); output point(87 6386 41 8843) st pointfromewkt alias for docid 9nnprzt3hqeet7csvwwxe creates a point using an ewkt formatted char as an input argument syntax st pointfromewkt(srid char) 135,156,350 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type example select st pointfromewkt('srid=4326;point(1 2)'); output point(1 2) st pointfromgeojson creates a point represented by the specified geojson value as an input argument a second optional boolean argument determines if the specified geojson should be converted from a planar to a geodesic representation if you specify a null value for either argument, the function returns null syntax st pointfromgeojson(geojson \[, geodesic ] ) 135,156,352 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type examples in this example, the function captures a point from an empty geojson representation select st pointfromgeojson('{"type" "point","coordinates" \[]}',false); output point empty in this example, the function captures a point from a geojson representation select st pointfromgeojson('{"type" "point","coordinates" \[1,1]}',false); output point(1 1) st pointfromgeohash creates a point represented by the specified geohash syntax st pointfromgeohash(geohash) 135,147,352 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type examples select st pointfromgeohash('c0w3hf1s70w3hf1s70w3'); output point( 126 00000000000003 48 00000000000007) select st pointfromgeohash('kzn21'); output point(42 60498046875 5 60302734375) st pointfromtext alias for docid 9nnprzt3hqeet7csvwwxe st pointfromwkb alias for docid 9nnprzt3hqeet7csvwwxe related links docid\ czxgepf3prq9ufwhwbiuy docid\ ln31h9xuiniz 9q3nd0m