Analyzing Properties of Spatial Entities

Learn how to analyze properties of spatial entities in MySQL.

Until now, our focus for the e-scooter startup has been primarily on creating spatial entities. However, creating these entities is just the beginning of their utility in our operations. A crucial aspect we need to consider is the analysis of these spatial entities. For instance, we must determine where customers start their rides and travel distances. To achieve this, MySQL provides a comprehensive range of operators specifically designed to determine such properties of spatial entities. These operators vary depending on the spatial entity we are dealing with, such as points, lines, and polygons, offering tailored tools to analyze each kind effectively.

Points

In their simplest form, points are defined by their coordinates and do not inherently possess a wide array of properties for analysis. However, MySQL offers four specific functions to examine these properties, contingent upon the spatial reference system (SRS) in which the point is situated. For points embedded in a geographic SRS, the database management system utilizes two distinct functions: ST_Longitude() and ST_Latitude(). These functions are designed to access the longitude and latitude of a point, respectively:

Get hands-on with 1400+ tech skills courses.