distance_sphere(), distance_spheroid() for MySQL
mysql-udf-distance_spheroid-1.0.tar.gz
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.
I tested with only mysql-5.1.23-beta-GIS.
( http://downloads.mysql.com/forge/mysql-5.1.23-beta-GIS/ )
Please refer to documentations in this tarball for more information about compiling and using.
Or refer to "The Documentation of UDF, distance_sphere() and distance_spheroid(), for MySQL"
The functions are derived from lwgeom_spheroid.c in PostGIS by Refractions Research Inc, ( http://postgis.refractions.net ).
Thanks to Refractions Research Inc.
I'm sorry that I don't prepare enough documents with English and my poor English.
PostGISには、緯度/経度で表された二点間の距離を求める
distance_sphere(), distance_spheroid()という関数があるのですが、
MySQLでは、現状、これらの関数が用意されていません。
そこでMySQLのUDF(User Defined Function)として、これらの関数を
PostGISに含まれているソースコードlwgeom_spheroid.c((c)Refractions Research Inc)を
元に作成しました。
MySQLの内部データ構造にアクセスする関係で、通常のUDFとは異なるコンパイル
手順が必要です。詳しくは配布ファイルに含まれているドキュメントを参照してください。
あるいは、MySQL向け距離関数 distance_sphere(), distance_spheroid() のドキュメントを参考にしてください。
現在、http://downloads.mysql.com/forge/mysql-5.1.23-beta-GIS/ より
ダウンロードした mysql-5.1.23-beta-GIS への追加でのみ動作を確認しております。
UDFとして登録した後は、PostGISのdistance_sphere(), distance_spheroid()と
同様に使用できます。ライセンスは GNU General Public License Version 2 となります。
ご興味のある方は、一度お試しください。コンパイルや使用方法に関する詳細は
tarballの中のドキュメントを参照ください。
最後になりましたが、GPL2でソースコードを公開された Refractions Research Inc,







コメント (1)
Without changing source codes distributed here, I confirmed the functions are able to work on "mysql-5.1.35-snapshot20090630" that is distributed at "http://downloads.mysql.com/forge/mysql-5.1.35-gis"
----
http://downloads.mysql.com/forge/mysql-5.1.35-gis/ で配布されている mysql-5.1.35-snapshot20090630 でも、そのまま使用できることを確認しました。
投稿者: okumula | 2009年10月06日 18:22