php - 使用PHP:从给定点查找多边形中最近的点
问题描述
我有一个由多边形坐标组成的 mysql 表。在另一个表中,我有标记的坐标。我需要找到从标记到多边形的最近点
我正在尝试转换一些算法但没有得到任何地方
还尝试转换 javascript 选项
但我不知道如何在服务器端 PHP 或 mysql 中实现它
Table 1
Id Polygon
1 POLYGON((9.99954289860805 44.0511003950809,
9.99959799860805 44.0510457950809,9.99959799860805 44.0509783950809,
9.99957439860805 44.0508603950809,9.99961729860804 44.0508873950809,
9.99971659860803 44.0509201950809,9.999906998608 44.0509567950809,
10.000177898608 44.0509779950809,10.000272598608 44.0509802950809,
44.0513239950809,9.99954289860805 44.0511003950809))
Table 2
Id Marker
1 10.3333333322,45.3222222222
Output
A coordinate inside polygon or one of the coordinate of polygon
解决方案
推荐阅读
- mongodb - Mongoose 在更新时附加到字符串
- javascript - 滑块切换后悬停效果不起作用
- sql - SQL Server - 如何将散列密码插入表?
- android-jetpack-compose - 如何解释 Android Jetpack Compose 中“组”的概念?
- python - 使用 RandomizedCV 调整随机森林分类器的问题
- python - (
, ProtocolError('无效数据或不支持的协议版本'), ) - html - Express js 处理来自动态创建的不同字段的多个文件上传
- python - 如何有效地绘制 torch.nn 模型图?
- node.js - 使用nodejs typescript将数据插入postgreSQL
- oracle-nosql - Oracle NoSQL - 如何在 MAP 中查找键以值开头的所有行