我在下面有以下 MySQL 查询。我正在尝试提取四组坐标,然后将它们绘制在我的自定义 Google v3 API 页面上。(我还需要用蓝线“连接”点)
以下是原始“printable_text”列数据的样子:
Grids : T04SR08W09NW
BestFit: 38.204326/-89.995942 38.204330/-89.993452
: 38.203490/-89.993451 38.203486/-89.995941
PreMark: NO Directional Boring: NO Depth>7Ft: NO
这是我当前的 MySQL 查询:
SELECT ticket
, SUBSTR(printable_text
, LOCATE('BestFit: ',printable_text)+9
, LOCATE('PreMark:', printable_text) - LOCATE('BestFit: '
, printable_text) - 9) AS coord
, REPLACE((SUBSTR(printable_text
, LOCATE('BestFit: ',printable_text)+9
, LOCATE('PreMark:', printable_text) - LOCATE('BestFit: '
, printable_text) - 9)),'/',',') AS coord
FROM tickets
WHERE ticket = 'A3041073'
这是我到目前为止提取的内容:
38.204326/-89.995942 38.204330/-89.993452 : 38.203490/-89.993451 38.203486/-89.995941
38.204326,-89.995942 38.204330,-89.993452 : 38.203490,-89.993451 38.203486,-89.995941
我猜我需要去掉“/”、“空格”、“冒号”,并将四个坐标提供给我的 Google API 以进行绘图和连接..?