WKT
Returns a WKT (Well Known Text) geometric object from various Geo Data Types. Supported WKT objects are:- POINT
- MULTIPOINT
- POLYGON
- MULTIPOLYGON
- LINESTRING
- MULTILINESTRING
geo_data can be one of the following Geo Data Types or their underlying primitive types:
Returned value
- WKT geometric object
POINTis returned for a Point. - WKT geometric object
MULTIPOINTis returned for a MultiPoint. - WKT geometric object
POLYGONis returned for a Polygon - WKT geometric object
MULTIPOLYGONis returned for a MultiPolygon. - WKT geometric object
LINESTRINGis returned for a LineString. - WKT geometric object
MULTILINESTRINGis returned for a MultiLineString.
readWKTMultiPolygon
Converts a WKT (Well Known Text) MultiPolygon into a MultiPolygon type.Example
Input parameters
String starting withMULTIPOLYGON
Returned value
MultiPolygonreadWKTPolygon
Converts a WKT (Well Known Text) MultiPolygon into a Polygon type.Example
Input parameters
String starting withPOLYGON
Returned value
PolygonreadWKTPoint
ThereadWKTPoint function in ClickHouse parses a Well-Known Text (WKT) representation of a Point geometry and returns a point in the internal ClickHouse format.
Syntax
Arguments
wkt_string: The input WKT string representing a Point geometry.
Returned value
The function returns a ClickHouse internal representation of the Point geometry.Example
readWKTLineString
Parses a Well-Known Text (WKT) representation of a LineString geometry and returns it in the internal ClickHouse format.Syntax
Arguments
wkt_string: The input WKT string representing a LineString geometry.
Returned value
The function returns a ClickHouse internal representation of the linestring geometry.Example
readWKTMultiLineString
Parses a Well-Known Text (WKT) representation of a MultiLineString geometry and returns it in the internal ClickHouse format.Syntax
Arguments
wkt_string: The input WKT string representing a MultiLineString geometry.
Returned value
The function returns a ClickHouse internal representation of the multilinestring geometry.Example
readWKTMultiPoint
Parses a Well-Known Text (WKT) representation of a MultiPoint geometry and returns it in the internal ClickHouse format.Syntax
Arguments
wkt_string: The input WKT string representing a MultiPoint geometry.
Returned value
The function returns a ClickHouse internal representation of the multipoint geometry.Example
readWKTRing
Parses a Well-Known Text (WKT) representation of a Polygon geometry and returns a ring (closed linestring) in the internal ClickHouse format.Syntax
Arguments
wkt_string: The input WKT string representing a Polygon geometry.
Returned value
The function returns a ClickHouse internal representation of the ring (closed linestring) geometry.Example
polygonsWithinSpherical
Returns true or false depending on whether or not one polygon lies completely inside another polygon. Reference https://www.boost.org/doc/libs/1_62_0/libs/geometry/doc/html/geometry/reference/algorithms/within/within_2.htmlExample
readWKBMultiPolygon
Converts a WKB (Well Known Binary) MultiPolygon into a MultiPolygon type.Example
Input parameters
String starting withMULTIPOLYGON
Returned value
MultiPolygonreadWKBPolygon
Converts a WKB (Well Known Binary) MultiPolygon into a Polygon type.Example
Input parameters
String starting withPOLYGON
Returned value
PolygonreadWKBPoint
ThereadWKBPoint function in ClickHouse parses a Well-Known Binary (WKB) representation of a Point geometry and returns a point in the internal ClickHouse format.
Syntax
Arguments
wkb_string: The input WKB string representing a Point geometry.
Returned value
The function returns a ClickHouse internal representation of the Point geometry.Example
readWKBLineString
Parses a Well-Known Binary (WKB) representation of a LineString geometry and returns it in the internal ClickHouse format.Syntax
Arguments
wkb_string: The input WKB string representing a LineString geometry.
Returned value
The function returns a ClickHouse internal representation of the linestring geometry.Example
readWKBMultiLineString
Parses a Well-Known Binary (WKB) representation of a MultiLineString geometry and returns it in the internal ClickHouse format.Syntax
Arguments
wkb_string: The input WKB string representing a MultiLineString geometry.
Returned value
The function returns a ClickHouse internal representation of the multilinestring geometry.Example
Input parameters
Returned value
UInt8, 0 for false, 1 for truereadWKBMultiPoint
Parses a Well-Known Binary (WKB) representation of a MultiPoint geometry and returns it in the internal ClickHouse format.Syntax
Arguments
wkb_string: The input WKB string representing a MultiPoint geometry.
Returned value
The function returns a ClickHouse internal representation of the multipoint geometry.Example
polygonsDistanceSpherical
Calculates the minimal distance between two points where one point belongs to the first polygon and the second to another polygon. Spherical means that coordinates are interpreted as coordinates on a pure and ideal sphere, which is not true for the Earth. Using this type of coordinate system speeds up execution, but of course is not precise.Example
Input parameters
Two polygonsReturned value
Float64polygonsDistanceCartesian
Calculates distance between two polygonsExample
Input parameters
Two polygonsReturned value
Float64polygonsEqualsCartesian
Returns true if two polygons are equalExample
Input parameters
Two polygonsReturned value
UInt8, 0 for false, 1 for truepolygonsSymDifferenceSpherical
Calculates the spatial set theoretic symmetric difference (XOR) between two polygonsExample
Input parameters
PolygonsReturned value
MultiPolygonpolygonsSymDifferenceCartesian
The same aspolygonsSymDifferenceSpherical, but the coordinates are in the Cartesian coordinate system; which is more close to the model of the real Earth.
Example
Input parameters
PolygonsReturned value
MultiPolygonpolygonsIntersectionSpherical
Calculates the intersection (AND) between polygons, coordinates are spherical.Example
Input parameters
PolygonsReturned value
MultiPolygonpolygonsWithinCartesian
Returns true if the second polygon is within the first polygon.Example
Input parameters
Two polygonsReturned value
UInt8, 0 for false, 1 for truepolygonsIntersectCartesian
Returns true if the two polygons intersect (share any common area or boundary).Example
Input parameters
Two polygonsReturned value
UInt8, 0 for false, 1 for truepolygonsIntersectSpherical
Returns true if the two polygons intersect (share any common area or boundary). Reference https://www.boost.org/doc/libs/1_62_0/libs/geometry/doc/html/geometry/reference/algorithms/intersects.htmlExample
Input parameters
Two polygonsReturned value
UInt8, 0 for false, 1 for truegeometryIntersectCartesian
Returns true if two geometries intersect (share any common point, line or area). UnlikepolygonsIntersectCartesian, it accepts any geometry data type
(Point, MultiPoint, LineString, MultiLineString, Ring, Polygon, MultiPolygon), including the common
Geometry type, and the two arguments may be of different types.
Coordinates are in the Cartesian coordinate system.
Example
Input parameters
Two geometries of any geometry data type (orGeometry).
Returned value
UInt8, 0 for false, 1 for truegeometryIntersectSpherical
Returns true if two geometries intersect (share any common point, line or area). UnlikepolygonsIntersectSpherical, it accepts any geometry data type
(Point, MultiPoint, LineString, MultiLineString, Ring, Polygon, MultiPolygon), including the common
Geometry type, and the two arguments may be of different types.
Coordinates are interpreted as being on an ideal sphere.
Example
Input parameters
Two geometries of any geometry data type (orGeometry).