Search code examples
mysqlmysql-spatial

What is the unit of measurement used in MySQL's spatial Buffer call?


The Buffer call is formatted Buffer(g,d).

g is a geometry value (e.g. point, linestring, and polygon).

d is a distance.

What unit of measurement is d using? Meters? Miles? Kilometers?


Solution

  • There aren't units here, or in any of the spatial analysis functions.

    These functions are commonly used with geometriy values with coordinates using degrees latitude and longitude, but the spatial capabilities can be used with data from any arbitrary grid coordinate system, and the server's capabilities don't have any awareness of the nature of the particular "space" being mapped.

    The distance, then, would be in "units."

    The units would be whatever units your coordinates are also using. If the coordinates are in feet, the distance is expressed in feet; if the distance is in degrees lat/long, you'd need to express the desired buffer distance in degrees.