且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在PHP中将MYSQL多边形转换为文本

更新时间:2023-01-23 09:23:36

如果您使用ST_NumGeometries(来自

If you use ST_NumGeometries(from https://dev.mysql.com/doc/refman/5.7/en/gis-geometrycollection-property-functions.html#function_st-numgeometries) it should give you the number of points and then you could to use a loop and ST_GeometryN to fetch each individual point. This would still need to be decoded like you already have.

您可以将多边形转换回文本(AsText),然后在那里解析数据.

You could convert the polygon back to text (AsText) and then parse the data there.