Skip to content
  • ZipCode Api
  • Blog
  • About RedLine13
RedLine13
RedLine13
Primary Navigation Menu
Menu
  • Start Testing
  • Demo
  • Pricing
  • JMeter
  • Partners
  • Docs
    • Documentation Home
    • AWS Set Up for load testing
    • AWS Approval for Large Tests
    • PHP, NodeJS, Python Load Tests
    • Scalability
    • Jenkins Plugin Setup
    • Premium Features
    • Knowledge Base

Lat/Long SQL Where Clause for Your Database

By: Rich Friedman

Polygon Approximation of a CircleWe have added an interesting extension to our Zipcode API. This is for applications that have their own database of latitude and longitude positions, but need to calculate items within a certain radius of another latitude/longitude.

You can try it here – https://www.zipcodeapi.com/API#radiusSql. Hint – use the Zipcode to Location API to find your specific Lat/Long.

You specify the latitude and longitude of a center point, the distance/radius from this location, the field names used in your database for latitude and longitude, and a precision. The higher the precision, the more detailed the SQL string will be and the more accurate the results will be. A precision of 2 gives decent results for short distances. Larger distances might require a higher precision. To make your database queries efficient, you should create an index on the latitude/longitude pair in your database.

For example, a precision of 1 in the Zipcode API Live Documentation is done with this setup:

Zipcode API Lat/Long Setup

 

will yield an SQL clause like this:

SQL for Lat/Long Polygon

 

While a precision of 4 would yield:

Lat/Long Polygon

 

Obviously, the higher the precision, the more points on your polygon and the closer approximation to ta true circle and radius.

polygon edges accuracy

 

2013-09-09
Previous Post: Load Testing Graphic Reporting Performance Improvements
Next Post: EU Servers Added for Load Testing

Recent Posts

  • Cost-Effective Cloud Load Testing
  • Guest Post: Load Testing with Locust and JMeter on RedLine13
  • Executing Gatling Tests with The SBT + Java RedLine13 Plugin
  • Selenium Load Testing: When and How
  • RedLine13 Basic vs Premium Subscription

Related

  • Case Study: iCIMS, The Talent Acquisition Software Experts
  • How to Run a Multi-Region Test – Available in Paid and Free Plans
  • Cost-Effective Cloud Load Testing
  • Guest Post: Load Testing with Locust and JMeter on RedLine13
  • Selenium Load Testing: When and How
  • Selecting Custom OpenJDK version for JMeter
  • Executing Gatling Tests with The SBT + Java RedLine13 Plugin
  • JMeter Alternatives: k6 and Gatling
  • RedLine13 Basic vs Premium Subscription
  • Speak the Lingo using Load Testing Terms

© RedLine13, LLC | Privacy Policy | Contract
Contact Us: info@redline13.com

Designed using Responsive Brix. Powered by WordPress.