MCPcopy Create free account
hub / github.com/ByConity/ByConity / registerDataTypeDomainGeo

Function registerDataTypeDomainGeo

src/DataTypes/DataTypeCustomGeo.cpp:11–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9{
10
11void registerDataTypeDomainGeo(DataTypeFactory & factory)
12{
13 // Custom type for point represented as its coordinates stored as Tuple(Float64, Float64)
14 factory.registerSimpleDataTypeCustom("Point", []
15 {
16 return std::make_pair(DataTypeFactory::instance().get("Tuple(Float64, Float64)"),
17 std::make_unique<DataTypeCustomDesc>(std::make_unique<DataTypePointName>()));
18 });
19
20 // Custom type for simple polygon without holes stored as Array(Point)
21 factory.registerSimpleDataTypeCustom("Ring", []
22 {
23 return std::make_pair(DataTypeFactory::instance().get("Array(Point)"),
24 std::make_unique<DataTypeCustomDesc>(std::make_unique<DataTypeRingName>()));
25 });
26
27 // Custom type for polygon with holes stored as Array(Ring)
28 // First element of outer array is outer shape of polygon and all the following are holes
29 factory.registerSimpleDataTypeCustom("Polygon", []
30 {
31 return std::make_pair(DataTypeFactory::instance().get("Array(Ring)"),
32 std::make_unique<DataTypeCustomDesc>(std::make_unique<DataTypePolygonName>()));
33 });
34
35 // Custom type for multiple polygons with holes stored as Array(Polygon)
36 factory.registerSimpleDataTypeCustom("MultiPolygon", []
37 {
38 return std::make_pair(DataTypeFactory::instance().get("Array(Polygon)"),
39 std::make_unique<DataTypeCustomDesc>(std::make_unique<DataTypeMultiPolygonName>()));
40 });
41}
42
43}

Callers 1

DataTypeFactoryMethod · 0.85

Calls 2

getMethod · 0.45

Tested by

no test coverage detected