MySQL before version 5.7 had less than stellar Geographic
Information Systems (GIS) support. In version 5.7 the
Boost.Geometry two dimensional or 2D libraries were added.
And with 8.0 came the three dimensional or 3D libraries. But how
do you use these features?
I would like to state up front that this is all new to me and
this is an attempt for me to document what it takes to go from
zero knowledge on GIS to something hopefully better. What I
want to do as an exercise is to get the distance between two
places from their longitude and latitude, say two cities near
where I live. So what do we have to do to accomplish
that?
It is actually easy with the functions provided if we have the
longitude and latitude in an SRID 4326 format.
SELECT ST_Distance(
(SELECT loc FROM cities WHERE name =
'Trondheim'),
(SELECT loc FROM cities WHERE …
Showing entries 1 to 1
Mar
27
2019
Showing entries 1 to 1