In Mysql, to determine whether a point falls within a polygon and about geospatial data, you often need to process the associations between the two spatial data. There are many ways to handle this by writing program algorithms or calling the corresponding functions in the database. In the mysql database, http://dev.mysql.com/doc/refman/5.1/en/functions-for-testing-spatial-relations-between-geometric-objects.html I have made a detailed introduction, but it does not take a specific engineering practice as an example. This article will judge whether a vertex falls within a polygon and simply expand it. Www.2cto.com first, CREATE a simple Geographic Data TABLE, [SQL] CREATE TABLE 'Ci _ special_zone '('id' int (11) NOT NULL auto_increment, 'ploygongeo' text NOT NULL, primary key ('id') ENGINE = MyISAM default charset = utf8; and INSERT several pieces of data [SQL] INSERT INTO ci_special_zone (ploygongeo) VALUES ('polygon (113.547 22.186, 113.549 22.186, 113.549 22.188, 113.547 22.188, 113.547 22.186) '); insert into ci_special_zone (ploygongeo) VALUES ('polygo N (112.547 21.186, 112.549 212.186, 112.549 21.188, 112.547 212.188, 112.547 21.186) '). Finally, run the following SQL statement [SQL] SELECT substring (ploygongeo, 10, length (ploygongeo)-11) from ci_special_zone where MBRContains (PolygonFromText (ploygongeo), PolygonFromText ('point (113.547 22.186) ')> 0 limit 113.547 coordinate Point 22.186 is the longitude and latitude, if a return value exists, it indicates that the coordinate point falls into the range.