我正在尝试与Grafana WorldMap Panel
合作并最终希望基于城市或纬度/经度的圈子,这比国家/地区更为精细。
DROP TABLE lumenis_db.device_status_worldmap;
我按照以下说明构建数据库
CREATE TABLE `device_status_worldmap` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`city_name` varchar(20) NOT NULL,
`geohash` varchar(20) NOT NULL,
`latitude` varchar(20) NOT NULL,
`longitude` varchar(20) NOT NULL,
`value` varchar(45) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
INSERT INTO `lumenis_db`.`device_status_worldmap`
(`city_name`,`geohash`,`latitude`,`longitude`,`value`,`timestamp`)
VALUES
('london1','u10j41ut0sq0','51.514400482177734','0.0940999984741211',1,now()),
('paris','sv9h9rujpfrv','31.771959','35.217018',1,now());
无法使其正常运行, 请注意,我也可以重建数据库以使其工作
我也尝试使用this链接作为示例
SELECT
city_name AS City,
geohash AS Geohash,
COUNT(*) AS Count
FROM device_status_worldmap
WHERE $__timeFilter(timestamp)
GROUP BY Geohash
有关重构数据库或更改我的Grafana查询的任何帮助