×
BigML is working hard to support a wide range of browsers. Your experience will be better with:
English
Sign up / in
Sign up
Sign in
or Sign in with...
Amazon
Github
GitLab
Google
Toggle navigation
PRODUCT
Features
Releases
What's New
GETTING STARTED
PRICING
Subscriptions
Private Deployments
Training
Certifications
BigML for Education
SUPPORT
Toggle navigation
PRODUCT
Features
Releases
What's New
GETTING STARTED
PRICING
Subscriptions
Private Deployments
Training
Certifications
BigML for Education
SUPPORT
License
Oops!
We could not process your request!
Lat/long distance from a reference point | BigML.com
×
Embed this Script in your web site
Copy & Paste this code into your HTML code:
petersen
Public
petersen's
Scripts
1
Models
0
Datasets
1
3
FREE
BUY
Lat/Long Distance from a reference point
Details:
Created
Thu, 21 Sep 2023 18:48:22 +0000
Published
Thu, 21 Sep 2023 19:00:13 +0000
Description:
Extends a dataset with the distance in meters between lat/long fields and a reference point.
Tags:
URL:
https://bigml.com/user/petersen/gallery/script/650c8ff67411b45f016555c3
Script
FREE
Source code
; Computes the distance between lat/long coordinates and a reference point ; All lat/long coordinates must be in signed degrees (no N/W/S/E etc) (define (latlong-ref-dist dataset-in lat-field long-field lat-ref long-ref) (create-and-wait-dataset { "origin_dataset" dataset-in "new_fields" [ { "field" ( flatline "( let (" "R 6371000 " "latA (to-radians {lat-ref}) " "latB (to-radians ( field {{lat-field}} ) ) " "latD ( - latB latA ) " "longD ( to-radians ( - ( field {{long-field}} ) {long-ref} ) ) " "a ( + ( square ( sin ( / latD 2 ) ) ) ( * (cos latA) (cos latB) (square ( sin ( / longD 2))) ) ) " "c ( * 2 ( asin ( min (list 1 (sqrt a)) ) ) ) ) " "( * R c ) )" ) "name" "Distance (m)" } ] } ) ) (define dataset-out (latlong-ref-dist dataset-in lat-field long-field lat-ref long-ref))
Description
Extends a dataset with the distance in meters between lat/long fields and a reference point.
Extends a dataset with the distance in meters between lat/long fields and a reference point.
Show more
Inputs
Outputs
License:
GNU V3.0
Script
FREE
Lat/long distance from a reference point | BigML.com
Sending Request...
Sending Request...