获取多边形点mysql [英] Get polygon points mysql

查看:86
本文介绍了获取多边形点mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在mysql中创建了一个表来存储多边形数据:

i have created a table in mysql to store polygon data:

CREATE TABLE geom (g GEOMETRY);

然后我使用以下语法在其中插入了一个多边形:

And i inserted a polygon into it, using the following syntax:

INSERT INTO geom (g)
VALUES(PolygonFromText('POLYGON((
9.190586853 45.464518970,
9.190602686 45.463993916,
9.191572471 45.464001929,
9.191613325 45.463884676,
9.192136130 45.463880767,
9.192111509 45.464095594,
9.192427961 45.464117804,
9.192417811 45.464112862,
9.192509035 45.464225851,
9.192493139 45.464371079,
9.192448471 45.464439002,
9.192387444 45.464477861,
9.192051402 45.464483037,
9.192012814 45.464643592,
9.191640825 45.464647090,
9.191622331 45.464506215,
9.190586853 45.464518970))')
);

现在如何在mysql中取回该多边形的顶点(点)?为什么我要问是什么意思,后来我想找到一个点是否在多边形内.为了实现这一点,我希望我需要多边形顶点.

Now how can i get back the vertices (points) of this polygon in mysql? Why i am asking means, later i want to find whether a point is inside a polygon. And to achieve this, i hope i need the polygon vertices.

推荐答案

如果您想退回WKT:SELECT AsText(g) FROM geom;

If you want the WKT back: SELECT AsText(g) FROM geom;

这篇关于获取多边形点mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆