1.2.1 • Published 9 years ago

mysql-haversine v1.2.1

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

mysql-haversine

Mysql haversine query generator.

Install

npm install mysql-haversine

Basic usage

Given your coordinates it compares the circular distance from you with each coordinate in the given database table.

var mysqlHaversine = require('mysql-haversine');

var query = mysqlHaversine.query(100, 'stores', 18.370531, -66.143399, 'ASC');

API

query(distance, table_name, your_latitude, your_longitude, order_by)

It compares the circular distance from your coordinates with each coordinate in the given db table. It only returns the results of the ones that are less than or equal to the given distance(km) and orders them ascending(ASC) or descending(DESC).

distance = max radius to query of the circle around your coordinate(km) table_name = name of the the database table your_latitude = your current latitude your_longitude your current longitude order_by = how you want to order the results(ASC or DESC)

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago