Saturday, March 11, 2017

Larvel + Mysql: Retrieve POI's within a bounding box

I have a database table with POI's that i want to connect with a record in my Geo table (containing cities, countries).

  • Within the POI table i have a Lat & Lon field.
  • Within the Geo table i have 4 coordinates, for West/East and North/South

enter image description here

I'm using Laravel 5 / Eloquent and Mysql. The coordindates are stored as a decimal (11,8). I can add multiple columns if needed.

How can i check if a POI is located within those 4 coordinates?



via user5512902

Advertisement