Geo Implementation Scenarios

Source: Internet
Author: User
Tags mysql query

1, the database of internal support GIS (Geographic information System)
MySQL: Currently only the MyISAM engine supports GIS, and InnoDB supports spatial indexing in version 5.7. MyISAM this engine.
Transactions, foreign keys, and table locks are not supported. Suitable for read-oriented, not suitable for writing operations. And if you build a single table, it's always
Existing table union queries return the location of the tag, and the efficiency is somewhat affected, and it is not certain whether Django supports InnoDB and MyISAM
Engine union query. (currently used InnoDB engine)
Other databases: MongoDB and PostgreSQL support GIS, the former is not studied carefully, the latter is very strong in GIS,
However, there is no consideration for switching databases.

2. Third-party apps or frameworks
Geodjango: It's a Django-derived project that supports GIS storage and querying. But this frame is too heavy, too much content, simple
Familiar with it, its function is still very powerful. But at the database level, it also requires a database to support GIS.
Database Full-Text search: Using more of the Lucene and Sphinx tools, the time cost of familiarity with these two tools is too high, and from the performance
The same as using MySQL query.


3, own development
There are two scenarios to consider,
(1) The latitude and longitude of the location of the database, and the distance between the spherical two points is used to calculate and sort the nearby locations.
To improve efficiency, you can also save it as a stored procedure.
(2) Convert latitude and longitude to one-dimensional data geohash, which can be indexed on Geohash, and use like statements
can implement queries. But to call at least 6 like statements, and can not achieve any distance search, only a few distance search
The location within the range.

At present, the company is responsible for the development of product requirements do not need accurate search, from the time cost, performance two aspects of these scenarios, the best two scenarios are
More appropriate. Final selection of Geohash scenarios

Geo Implementation Scenarios

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.