WKT
Returns a WKT (Well Known Text) geometric object from various Geo Data Types. Supported WKT objects are:- POINT
- 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
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
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 truepolygonsDistanceSpherical
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.