mysql - Store Geolocation coordinates in Grails Domain models? -


i want store geolocation coordinates longitude , latitude such later can specify area , query in gorm:

select * place  lat between :x1 , :x2 , lng between :y1 , :y2 

how have store coordinates in domain? underlying database mysql.

what propose is:

class place {   double lat   double lng } 

i read there spacial index. recommend using grails? if how map domain fit this?

you need hibernate spatial plugin: https://grails.org/plugin/hibernate-spatial


Comments