php - Mysql retrieve polygon data -
i have been developing site stores spatial data in mysql database, of buildings, gardens, etc. in form of polygons (latitudes , longitudes).
i want know how retrieve polygon data in mysql.
i have seen sample query insert polygon data: http://amper.110mb.com/spat/mysql_initgeometry2.htm
but want know how retrieve data table, based on constraints like:
"where latitude < 9.33 , longitude > 22.4"
how find whether point lies inside or outside of polygon
here page lots of examples: http://howto-use-mysql-spatial-ext.blogspot.com/
this 1 of examples retrieve rows points intersect specified bounding box:
set @bbox = 'polygon((0 0, 10 0, 10 10, 0 10, 0 0))'; select name, astext(location) points intersects( location, geomfromtext(@bbox) );
the mysql documentation says these spatial functions work geometries (looks point geometry). can check if geometry in database intersects 1 specify in select statement.
Comments
Post a Comment