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 S2 based on a sphere, s2earth radius is the mean radius which averages the difference between polar and equatorial radius. It's 6,371.0088 km which is the same as the WGS-84 mean radius. ), not spatial analysis. 2. For points, we only need to know the latitude and longitude, so it's 2D for us.

...