ipalaus / geonames

A collection of models and commands to get all the power of GeoNames in Eloquent ORM.
MIT License
63 stars 34 forks source link

Design thoughts on implementing spatial indexes #11

Open Morgon opened 10 years ago

Morgon commented 10 years ago

Using spatial functions would be a pretty huge win for MySQL users in this library.

Of course, there are a number of ways one could go about this, and since it's not my project, I thought I'd start some discussion on the best way to approach it.

When I took a crack at implementing a GeoNames database before finding this project, I simply added an additional POINT column in the main names table, and adding the SPATIAL INDEX. This of course requires the table be MyISAM [and be using MySQL], but I don't think that's a big deal - I doubt anyone will need transactional support on these tables, and I finally figured out how to get the current DB Driver in Laravel :)

In any case, could I follow that same convention to add it to the main table, or would you prefer it be external - either in a separately managed table, or completely out of scope of this module? It'll be trickier to do it this way, but I suppose it could ensure that the main tables were consistent, regardless of driver or settings.

Morgon commented 10 years ago

Any thoughts here?

ipalaus commented 10 years ago

I'll review it tomorrow morning, sorry for the delay @Morgon! Thanks in advance

ipalaus commented 10 years ago

Sorry about this @Morgon, can you ping me on IRC anytime today or tomorrow?