経度テーブルに、緯度のMYSQL 5.7小数点表現を挿入:次のようにIは、テーブルのgeomを有する
id (Int) not null (pk),
name (varchar 25),
timestamp (timestamp),
lat (decimal 6,4),
lon (decimal 6,4),
g (geometry),
pt (point)
Iは緯度、経度フィールドを移入別のプロセスを有します。
私は太っ指次のINSERT文に緯度経度が、ある場合には5.7の地理空間拡張
を利用するためにPTフィールドを移入したい正常に動作します:
[email protected]='point(-80.00 40.00)';
insert into geom (pt,timestamp) values (pointfromtext(@g),now());
けどそのレコードのlon、latフィールドに格納されている値を使用したい
concat文を使用して正しい値に見えるが、insert "pointfromtext"文は結果を取らない
あなたは全世界をカバーするために予想される場合、とりわけ、CONCAT("point(", lon, ",", lat, ")")
lon
を使用して
[Create MySQL spatial column - Point変更のテーブルを使用せずにlat longを持つデータ型](http://stackoverflow.com/questions/39612856/create-mysql-spatial-column-point-data-type- with-lat-long-without-using-alter) – e4c5