In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article is mainly about parsing in a designated polygon area using mysql decision points. You can check the relevant professional terms on the Internet or find some related books to supplement them. Here, we will not dabble in it and go straight to the topic. I hope it can bring you some practical help.
1. Create a test table
CREATE TABLE `zone` (`id` int (10) unsigned NOT NULL AUTO_INCREMENT, `polygongeo` polygon NOT NULL, PRIMARY KEY (`id`)) ENGINE=MYISAM DEFAULT CHARSET=utf8
Note: spatial indexes can only be created in tables where the storage engine is MYISAM
two。 Insert polygonal data insert into zone (polygongeo) values (POLYGONFROMTEXT ('POLYGON (11-5-5-5-5-1-1); 3. Determine whether the point is in the polygonal area
Test POINT (3,4)
Select AsText (polygongeo) from zone where MBRWithin (POLYGONFROMTEXT ('POINT (3 4)'), polygongeo)
Output: POLYGON ((1, 1, 5, 5, 5, 5, 5, 1, 1))
Indicates that the point POINT (3,4) is in the polygon region.
Test POINT (6, 1)
Select AsText (polygongeo) from zone where MBRWithin (POLYGONFROMTEXT ('POINT (61)'), polygongeo)
Output: empty
Indicates that the point POINT (6,1) is outside the polygon region.
Summary: mysql spatial query is not very suitable for map coordinates, so map coordinates can be queried using mongodb. Refer to: "mongodb's method to determine whether the coordinates are within a specified polygon area"
This article explains whether to judge whether the point is within the specified polygon area by mysql. Please pay attention to more related content.
Related recommendations:
How to call php imagemagick to achieve the effect of old photos
An explanation on the Cartesian Product of php Computing multiple sets
On the use and performance Analysis of php File containing Directory configuration open_basedir
Use the mysql decision point to parse in the designated polygon area and that's it. If you want to know about other related issues, you can continue to follow our industry information. Our section will capture some industry news and professional knowledge to share with you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 230
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.