public class ExtractSpatialJoins extends Object
For example:
Joins expressed via ST_Contains and ST_Intersects functions must match all of the following criteria:
- arguments of the spatial function are non-scalar expressions; - one of the arguments uses symbols from left side of the join, the other from right.
Joins expressed via ST_Distance function must use less than or less than or equals operator to compare ST_Distance value with a radius and must match all of the following criteria:
- arguments of the spatial function are non-scalar expressions; - one of the arguments uses symbols from left side of the join, the other from right; - radius is either scalar expression or uses symbols only from the right (build) side of the join.
For inner join, replaces cross join node and a qualifying filter on top with a single spatial join node.
For both inner and left joins, pushes non-trivial expressions of the spatial function arguments and radius into projections on top of join child nodes.
Examples:
Point-in-polygon inner join
ST_Contains(ST_GeometryFromText(a.wkt), ST_Point(b.longitude, b.latitude))
becomes a spatial join
ST_Contains(st_geometryfromtext, st_point)
with st_geometryfromtext -> 'ST_GeometryFromText(a.wkt)' and
st_point -> 'ST_Point(b.longitude, b.latitude)' projections on top of child nodes.
Distance query
ST_Distance(ST_Point(a.lon, a.lat), ST_Point(b.lon, b.lat)) <= 10 / (111.321 * cos(radians(b.lat)))
becomes a spatial join
ST_Distance(st_point_a, st_point_b) <= radius
with st_point_a -> 'ST_Point(a.lon, a.lat)', st_point_b -> 'ST_Point(b.lon, b.lat)'
and radius -> '10 / (111.321 * cos(radians(b.lat)))' projections on top of child nodes.
| Modifier and Type | Class and Description |
|---|---|
static class |
ExtractSpatialJoins.ExtractSpatialInnerJoin |
static class |
ExtractSpatialJoins.ExtractSpatialLeftJoin |
| Constructor and Description |
|---|
ExtractSpatialJoins(Metadata metadata,
SplitManager splitManager,
PageSourceManager pageSourceManager,
TypeAnalyzer typeAnalyzer) |
public ExtractSpatialJoins(Metadata metadata, SplitManager splitManager, PageSourceManager pageSourceManager, TypeAnalyzer typeAnalyzer)
Copyright © 2012–2019. All rights reserved.