我試圖在我的MySQL數據庫中插入一個多邊形的地理座標。我有一個名爲類型的多邊形多邊形領域,我已經試過所有運行這些查詢,但繼續獲得SQL語法錯誤:將座標插入到MySQL中 - PolyFromText SQL語法錯誤/返回null
SET @g = 'POLYGON((-74.13591384887695 40.93750722242824,-74.13522720336914 40.929726129575016,-74.15102005004883 40.9329683629703,-74.14329528808594 40.94256444133327))';
INSERT INTO 'zones' ('polygon') VALUES (PolyFromText(@g));
INSERT INTO 'zones' ('polygon') VALUES (PolyFromText('POLYGON((-74.13591384887695 40.93750722242824,-74.13522720336914 40.929726129575016,-74.15102005004883 40.9329683629703,-74.14329528808594 40.94256444133327))'));
INSERT INTO 'zones' ('polygon') VALUES (PolyFromText('POLYGON((-74.13591384887695 40.93750722242824,-74.13522720336914 40.929726129575016,-74.15102005004883 40.9329683629703,-74.14329528808594 40.94256444133327))', 0));
上次查詢是使用phpmyadmins自己的地理空間工具生成的,並返回「Column」多邊形「不能爲null」。任何幫助表示讚賞!
我試過PolygonFromText,PolyFromText和GeomFromText的 - 既不是他們的工作。 – Yev 2013-03-16 19:05:04