Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At present, the geo type of doris is implemented based on the S2 library (https://github.com/google/s2geometry) , The official S2 documentation(http://s2geometry.io/) gives a very comprehensive introduction to the S2 library, So I just need to introduce the necessary information here. We describe a point on Earth in terms of (lng, lat), but in S2, points are represented internally as unit-length vectors (points on the surface of a three-dimensional unit sphere) as opposed to traditional (latitude, longitude) pairs. That is to say, S2 regards the earth as a unit sphere, About space calculations on this earth Transposition vector calculations on the unit sphere, But for us, we only need to care about latitude and longitude, So we need to know two things:1. doris only supports geographic analysis(Based on WGS-84 coordinate system,SRID = 4326 ), not spatial analysis. 2. For points, we only need to know the latitude and longitude, so it's 2D for us.

ST_Area_Square_Km(GEOMETRY geo)

I will discuss the three things mentioned above separately here:

...

support wkb: https://github.com/apache/doris/pull/18526

wkb parses the core code(be/src/geo/wkb_parse.cpp):

Scheduling

...


Scheduling

  1. I will first optimize the overall code of geo, sub-categories, type: put a class for each geometry type, parse (wkt, wkb, geojson code), the core function code does not divide into categories.
  2. Support for more geometry types:MultiPoint, MultiLineString, MultiPolygon, GeometryCollection
  3. Support for constructing GEOGRAPHY values in GEOJSON