"distance_sphere(), distance_spheroid() for MySQL" を Winodows でコンパイルする方法です。
FOSS4G 2008 Osaka で「MySQLへの地理空間距離関数の追加」というタイトルで発表しました。
The Documentation of UDF, distance_sphere() and distance_spheroid(), for MySQL. distance_sphere(point, point) returns linear distance in meters between two lat/lon points. Uses a spherical earth and radius of 6370986 meters. Faster than distance_spheroid(), but less accurate. Only implemented for points. distance_spheroid(point, point, spheroid) returns linear distance between two lat/lon points given a particular spheroid. Currently only implemented for points.
先に distance_sphere(), distance_spheroid() for MySQL を公開しましたが、 ドキュメントがダウンロードして解凍しないと見れないのは不便だということなので、ここに置きます。 また配布物の中に日本語ドキュメントがなかったので、まずは日本語ドキュメントを。
I release 2 functions, distance_sphere(), distance_spheroid(), for MySQL. The functions are provided under the GNU General Public License Version 2. These are compatible with same name functions in PostGIS. PostGISには、緯度/経度で表された二点間の距離を求めるdistance_sphere(), distance_spheroid()という関数があるのですが、MySQLでは、現状、これらの関数が用意されていません。そこでMySQLのUDF(User Defined Function)として、これらの関数をPostGISに含まれているソースコードlwgeom_spheroid.c((c)Refractions Research Inc)を元に作成しました。