What precision do you need? if it’s a state/national wide search maybe you could do a lat-lon to zip lookup and have precomputed distance from zip area to zip area of the restaurant. If you need accurate distances that won’t be a good option.
You should look into a Geohash solution, in the Wikipedia article there is a link to a PHP library to encode decode lat long to geohashs.
Here you have a good article explaining why and how they use it in Google App Engine (Python code but easy to follow.) Because of the need to use geohash in GAE you can find some good python libraries and examples.
As this blog post explains, the advantage of using geohashes is that you can create an index on the MySQL table on that field.
Related Posts:
- What is copy-on-write?
- What is the purpose of the “role” attribute in HTML?
- Most efficient way to increment a Map value in Java
- Image rotation algorithm
- Refactoring WordPress to improve memory performance [closed]
- How can I implement a location based (zip code) search in WordPress?
- Why is home (a lot) slower than other pages?
- Long Waiting Times on GoDaddy? [closed]
- What’s the case against transient-ing almost everything that’s mostly static?
- I have geocoded posts with latitude longitude – How to search by radius?
- Post queries by latitude and longitude
- Is there a way to measure server resource (CPU) usage by WP plugins?
- wordpress with 1.5 million posts
- Any suggestions on how to make this function more efficient or more generally useful?
- better wordpress minify problem
- Compressing JS and CSS
- Is there a way to ensure local fonts load from CDN when CDN is enabled?
- Disable Garbage Collection? [closed]
- Does WP Super Cache really compress my pages? [closed]
- How to prevent Vimeo duplicate requests?
- Need to optimize wordpress websites on google pageinsight
- Number of queries in wordpress
- Combine several CSS files into one
- My website is slow on the initial load
- What are some ways to speed up a WordPress site that most people don’t know? [closed]
- How can you profile a Python script?
- SQL: How to properly check if a record exists
- Optimize post insert and delete for bulk operations?
- Set Alias for meta_query arguments in get_posts()
- How do I optimize a custom post type admin page with 25,000 posts?
- Is it possible to wrap Geo Location search around WP_Query?
- Best way to show map of tagged posts?
- How to remove in the wordpress database all posts revisions except the last three?
- Easy way to process search results before displaying
- Create multiple Search functions for posts / custom post types and everything
- How to solve slow WordPress site caused by attachment_metadata
- Minimal WordPress load for only `get_option` to work (because ajax…)
- Speed up WordPress
- Show posts on a Google Map
- If I consider changing my WordPress DB tables to InnoDB, will it have an effect on the way WordPress works?
- Image sizes and order of operations
- WordPress Query is taking more then 20 second and stuck on creating index
- Publish a message on facebook after having posted a comment
- Can’t move jQuery to footer
- WordPress hosting optimized servers – Is this just a sales gimmick? [closed]
- I’m designing a plugin to create database indexes. Suggestions?
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- Location-Based Content
- Improve performance by removing unnecessary database queries
- multi-vender wooCommerce ability to separate products based on zip code [closed]
- Cron Job Keep Running in spite of being disabled
- Least expensive way to get table prefix in multisite installation
- Optimizing site speed by localizing paths
- Add filter post_where and passing post_type argument
- get_the_id, get_the_permalink, and get_the_title all with one DB call
- How effective are cacheing plugins for dynamic pages?
- Combining several CSS files into one for optimization
- WordPress network vs Separate installs
- How to move core js files into the footer
- Querying posts by latitude and longitude to build a Google Maps with several markers
- Geo Mashup Maps show only specified categories
- Maps search box autocomplete with callback JS function?
- Can the benefits of performance optimization plugins outweigh the tax of installing them on performance?
- WordPress plugin activation, deactivation and uninstall hook not being triggered
- Is querying wpdb directly and skipping actions provided by WP’s core “wp_update_post” a good idea?
- How to find and remove unnecessary theme scripts? [closed]
- Ip2location plugin in my template header?
- Queries take 120+ seconds on my large WordPress site
- Optimizing function that automatically creates internal links based on post title string
- Optimising uploads folder then re-uploading?
- Function to retrieve IDs of posts, cache results, and improve wp_query
- Searching post types
- How do I minify ‘@import’ css files with wp-minify?
- Geo Blocking in WordPress – how can it be implemented?
- How to add some basic inline CSS using existing plugin or theme?
- My authors need to be able to preview their upload images and manipulate and scale
- Optimal image size for wordpress?
- Lazy Loading of all Images
- How to sort store location by specific category order in WP store locations
- WordPress Query for CPT that only shows posts within radius of current user’s geolocation
- Can mediaelement-and-play core JS be dequeued?
- WordPress UPDATE queries on MySQL database stuck
- Inserting data with Geometry field
- Does &$this is really disallowed to use anywhere?
- Can lots of tags affect performance?
- Dynamic Content w/ geolocation in WP?
- Allow user to select location and then set cookie for location in WordPress
- How to optimise this database query?
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Is there a way to analyze the load time of the functions in a custom plugin?
- Optimize WP_Query
- Help with WordPress search
- Cache metadata for set of posts
- What causes a theme to be inefficient?
- Extracting Distance from FacetWP Proximity Function to Display in WordPress Template
- Load different content for users from different country [closed]
- Lots of SQL queries
- How to make wordpress backend mobile optimized.?
- Reduce initial server response time wordpress
- How to reduce uncached page generation time?