Geoserver+mysql+openlayers2
mysql几何数据数据存储参考:
DROP TABLE IF EXISTS `points`;
CREATE TABLE `points` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`x` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`y` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`location` point NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
SPATIAL INDEX `sp_index`(`location`)
) ENGINE = MyISAM AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
INSERT INTO `points` VALUES (1, '圆明园', '116.310558', '40.014033', ST_GeomFromText('POINT(116.311 40.014)'));
INSERT INTO `points` VALUES (2, '清华大学', '116.335279', '40.010497', ST_GeomFromText('POINT(116.335 40.0105)'));
INSERT INTO `points` VALUES (3, '颐和园', '116.277787', '116.277787', ST_GeomFromText('POINT(116.278 40.0065)'));
INSERT INTO `points` VALUES (4, '天安门', '116.404844', '39.915378', ST_GeomFromText('POINT(116.405 39.9154)'));
INSERT INTO `points` VALUES (5, '北京站', '116.434164', '39.910065', ST_GeomFromText('POINT(116.434 39.9101)'));
INSERT INTO `points` VALUES (6, '卢沟桥', '116.224895', '39.85647', ST_GeomFromText('POINT(116.225 39.8565)'));
INSERT INTO `points` VALUES (7, '北京西站', '116.32723', '39.901652', ST_GeomFromText('POINT(116.327 39.9025)'));
INSERT INTO `points` VALUES (8, '北京首都国际机场', '116.612388', '40.085613', ST_GeomFromText('POINT(116.612 39.9025)'));