Getting Lat & Lang within 1000Ft radius of a central Lat Lang












0















I am working with a pandas data frame where I have 4 columns of lats and langs. You can call these as pickup and drop off points. I have identify lat and lang of a central location and figured the radius (1000FT)of the circle. I want to select all the pickup and drop off points within this circle. Potentially create a column in the data frame with a flag.



(Pdb) x.dtypes
Pickup_longitude float64
Pickup_latitude float64
Dropoff_longitude float64
Dropoff_latitude float64
dtype: object

Pickup_longitude,Pickup_latitude,Dropoff_longitude,Dropoff_latitude
-73.97948455810547,40.68495559692383,-73.97943115234375,40.685020446777344
-74.01079559326173,40.91221618652344,-74.01078033447266,40.91221237182617
-73.92140960693358,40.76670837402344,-73.91441345214845,40.764686584472656
-73.92138671875,40.76667785644531,-73.93142700195312,40.771583557128906
-73.95548248291014,40.71404647827149,-73.94441223144531,40.71472930908203
-73.94529724121094,40.80818557739258,-73.93766784667969,40.821197509765625
-73.89087677001955,40.7464256286621,-73.87692260742188,40.75630569458008
-73.94670104980467,40.79732131958008,-73.9376449584961,40.80451583862305
-73.96315002441406,40.69382858276367,-73.956787109375,40.680530548095696
-73.89682006835938,40.74612808227539,-73.88862609863281,40.752723693847656
-73.82991790771484,40.713768005371094,-73.83494567871094,40.70729064941406
-73.9055404663086,40.77252578735352,-73.8953628540039,40.76896286010742
-73.941650390625,40.81829452514648,-73.950927734375,40.82603073120117
-73.93252563476562,40.85680389404297,-73.93136596679686,40.856117248535156
-73.95282745361328,40.808353424072266,-73.94914245605469,40.80290985107422
-73.904052734375,40.87870788574219,-73.89696502685547,40.90113067626953
-74.02134704589844,40.647010803222656,-74.00405883789062,40.65459442138672
-73.95098876953125,40.68049621582031,-73.9539566040039,40.69042205810547
-73.84967041015625,40.72400665283203,-73.83512878417969,40.70719909667969
-73.9466781616211,40.80628967285156,-73.93624877929686,40.79925155639648
-73.98682403564453,40.70245742797852,-73.97278594970702,40.69290161132813
-73.91205596923827,40.7754020690918,-73.89364624023438,40.76850509643555
-73.9617462158203,40.71377944946289,-73.98593139648438,40.71804809570313
-73.94091033935547,40.69868087768555,-73.94107818603516,40.6828498840332
-73.84423828125,40.72149658203125,-73.8086929321289,40.73440170288085
-73.89108276367188,40.74691009521485,-73.87848663330078,40.7494010925293
-73.84487915039062,40.75502395629883,-73.87222290039062,40.77399063110352
-73.87079620361328,40.73346328735352,-73.87014770507811,40.73357391357422
-73.94847869873048,40.81386184692383,-73.94107055664062,40.81884002685547


** subset of the data



I found following question in stackoverflow but not really sure if thats the correct approach.
Haversine Formula in Python (Bearing and Distance between two GPS points)



Update: So far solution



import math

def getPoints(lon, lat):
radius = 1800 # in feet (not sure if this is the right approach)
N = 360

# generate points
circlePoints =
for k in range(N):
angle = math.pi*2*k/N









share|improve this question

























  • Checked this?

    – Cheche
    Nov 20 '18 at 22:07













  • Totally dependent on your problem. You could have an infinite number of coords in range; do you have any way of pruning down the options before you run the test?

    – roganjosh
    Nov 20 '18 at 22:08











  • @roganjosh May be I am missing something How can there be infinite. We use the Central point and from that point we define radius and then select all the points that are in above columns that are within the distance.

    – Null-Hypothesis
    Nov 20 '18 at 22:53






  • 1





    I think OP wants to select, form a set of already determined lat,long pairs, those that are within a certain distance of another lat,long point. It boils down to a bunch of pairwise distance queries, if you don't use a fancier GIS index data structure.

    – interfect
    Nov 20 '18 at 22:59











  • My point was that lat and long are continuous (you may limit to a certain number of decimal places) but without some kind of geofencing you can quickly become swamped by the number of pairs to test.

    – roganjosh
    Nov 21 '18 at 6:36
















0















I am working with a pandas data frame where I have 4 columns of lats and langs. You can call these as pickup and drop off points. I have identify lat and lang of a central location and figured the radius (1000FT)of the circle. I want to select all the pickup and drop off points within this circle. Potentially create a column in the data frame with a flag.



(Pdb) x.dtypes
Pickup_longitude float64
Pickup_latitude float64
Dropoff_longitude float64
Dropoff_latitude float64
dtype: object

Pickup_longitude,Pickup_latitude,Dropoff_longitude,Dropoff_latitude
-73.97948455810547,40.68495559692383,-73.97943115234375,40.685020446777344
-74.01079559326173,40.91221618652344,-74.01078033447266,40.91221237182617
-73.92140960693358,40.76670837402344,-73.91441345214845,40.764686584472656
-73.92138671875,40.76667785644531,-73.93142700195312,40.771583557128906
-73.95548248291014,40.71404647827149,-73.94441223144531,40.71472930908203
-73.94529724121094,40.80818557739258,-73.93766784667969,40.821197509765625
-73.89087677001955,40.7464256286621,-73.87692260742188,40.75630569458008
-73.94670104980467,40.79732131958008,-73.9376449584961,40.80451583862305
-73.96315002441406,40.69382858276367,-73.956787109375,40.680530548095696
-73.89682006835938,40.74612808227539,-73.88862609863281,40.752723693847656
-73.82991790771484,40.713768005371094,-73.83494567871094,40.70729064941406
-73.9055404663086,40.77252578735352,-73.8953628540039,40.76896286010742
-73.941650390625,40.81829452514648,-73.950927734375,40.82603073120117
-73.93252563476562,40.85680389404297,-73.93136596679686,40.856117248535156
-73.95282745361328,40.808353424072266,-73.94914245605469,40.80290985107422
-73.904052734375,40.87870788574219,-73.89696502685547,40.90113067626953
-74.02134704589844,40.647010803222656,-74.00405883789062,40.65459442138672
-73.95098876953125,40.68049621582031,-73.9539566040039,40.69042205810547
-73.84967041015625,40.72400665283203,-73.83512878417969,40.70719909667969
-73.9466781616211,40.80628967285156,-73.93624877929686,40.79925155639648
-73.98682403564453,40.70245742797852,-73.97278594970702,40.69290161132813
-73.91205596923827,40.7754020690918,-73.89364624023438,40.76850509643555
-73.9617462158203,40.71377944946289,-73.98593139648438,40.71804809570313
-73.94091033935547,40.69868087768555,-73.94107818603516,40.6828498840332
-73.84423828125,40.72149658203125,-73.8086929321289,40.73440170288085
-73.89108276367188,40.74691009521485,-73.87848663330078,40.7494010925293
-73.84487915039062,40.75502395629883,-73.87222290039062,40.77399063110352
-73.87079620361328,40.73346328735352,-73.87014770507811,40.73357391357422
-73.94847869873048,40.81386184692383,-73.94107055664062,40.81884002685547


** subset of the data



I found following question in stackoverflow but not really sure if thats the correct approach.
Haversine Formula in Python (Bearing and Distance between two GPS points)



Update: So far solution



import math

def getPoints(lon, lat):
radius = 1800 # in feet (not sure if this is the right approach)
N = 360

# generate points
circlePoints =
for k in range(N):
angle = math.pi*2*k/N









share|improve this question

























  • Checked this?

    – Cheche
    Nov 20 '18 at 22:07













  • Totally dependent on your problem. You could have an infinite number of coords in range; do you have any way of pruning down the options before you run the test?

    – roganjosh
    Nov 20 '18 at 22:08











  • @roganjosh May be I am missing something How can there be infinite. We use the Central point and from that point we define radius and then select all the points that are in above columns that are within the distance.

    – Null-Hypothesis
    Nov 20 '18 at 22:53






  • 1





    I think OP wants to select, form a set of already determined lat,long pairs, those that are within a certain distance of another lat,long point. It boils down to a bunch of pairwise distance queries, if you don't use a fancier GIS index data structure.

    – interfect
    Nov 20 '18 at 22:59











  • My point was that lat and long are continuous (you may limit to a certain number of decimal places) but without some kind of geofencing you can quickly become swamped by the number of pairs to test.

    – roganjosh
    Nov 21 '18 at 6:36














0












0








0








I am working with a pandas data frame where I have 4 columns of lats and langs. You can call these as pickup and drop off points. I have identify lat and lang of a central location and figured the radius (1000FT)of the circle. I want to select all the pickup and drop off points within this circle. Potentially create a column in the data frame with a flag.



(Pdb) x.dtypes
Pickup_longitude float64
Pickup_latitude float64
Dropoff_longitude float64
Dropoff_latitude float64
dtype: object

Pickup_longitude,Pickup_latitude,Dropoff_longitude,Dropoff_latitude
-73.97948455810547,40.68495559692383,-73.97943115234375,40.685020446777344
-74.01079559326173,40.91221618652344,-74.01078033447266,40.91221237182617
-73.92140960693358,40.76670837402344,-73.91441345214845,40.764686584472656
-73.92138671875,40.76667785644531,-73.93142700195312,40.771583557128906
-73.95548248291014,40.71404647827149,-73.94441223144531,40.71472930908203
-73.94529724121094,40.80818557739258,-73.93766784667969,40.821197509765625
-73.89087677001955,40.7464256286621,-73.87692260742188,40.75630569458008
-73.94670104980467,40.79732131958008,-73.9376449584961,40.80451583862305
-73.96315002441406,40.69382858276367,-73.956787109375,40.680530548095696
-73.89682006835938,40.74612808227539,-73.88862609863281,40.752723693847656
-73.82991790771484,40.713768005371094,-73.83494567871094,40.70729064941406
-73.9055404663086,40.77252578735352,-73.8953628540039,40.76896286010742
-73.941650390625,40.81829452514648,-73.950927734375,40.82603073120117
-73.93252563476562,40.85680389404297,-73.93136596679686,40.856117248535156
-73.95282745361328,40.808353424072266,-73.94914245605469,40.80290985107422
-73.904052734375,40.87870788574219,-73.89696502685547,40.90113067626953
-74.02134704589844,40.647010803222656,-74.00405883789062,40.65459442138672
-73.95098876953125,40.68049621582031,-73.9539566040039,40.69042205810547
-73.84967041015625,40.72400665283203,-73.83512878417969,40.70719909667969
-73.9466781616211,40.80628967285156,-73.93624877929686,40.79925155639648
-73.98682403564453,40.70245742797852,-73.97278594970702,40.69290161132813
-73.91205596923827,40.7754020690918,-73.89364624023438,40.76850509643555
-73.9617462158203,40.71377944946289,-73.98593139648438,40.71804809570313
-73.94091033935547,40.69868087768555,-73.94107818603516,40.6828498840332
-73.84423828125,40.72149658203125,-73.8086929321289,40.73440170288085
-73.89108276367188,40.74691009521485,-73.87848663330078,40.7494010925293
-73.84487915039062,40.75502395629883,-73.87222290039062,40.77399063110352
-73.87079620361328,40.73346328735352,-73.87014770507811,40.73357391357422
-73.94847869873048,40.81386184692383,-73.94107055664062,40.81884002685547


** subset of the data



I found following question in stackoverflow but not really sure if thats the correct approach.
Haversine Formula in Python (Bearing and Distance between two GPS points)



Update: So far solution



import math

def getPoints(lon, lat):
radius = 1800 # in feet (not sure if this is the right approach)
N = 360

# generate points
circlePoints =
for k in range(N):
angle = math.pi*2*k/N









share|improve this question
















I am working with a pandas data frame where I have 4 columns of lats and langs. You can call these as pickup and drop off points. I have identify lat and lang of a central location and figured the radius (1000FT)of the circle. I want to select all the pickup and drop off points within this circle. Potentially create a column in the data frame with a flag.



(Pdb) x.dtypes
Pickup_longitude float64
Pickup_latitude float64
Dropoff_longitude float64
Dropoff_latitude float64
dtype: object

Pickup_longitude,Pickup_latitude,Dropoff_longitude,Dropoff_latitude
-73.97948455810547,40.68495559692383,-73.97943115234375,40.685020446777344
-74.01079559326173,40.91221618652344,-74.01078033447266,40.91221237182617
-73.92140960693358,40.76670837402344,-73.91441345214845,40.764686584472656
-73.92138671875,40.76667785644531,-73.93142700195312,40.771583557128906
-73.95548248291014,40.71404647827149,-73.94441223144531,40.71472930908203
-73.94529724121094,40.80818557739258,-73.93766784667969,40.821197509765625
-73.89087677001955,40.7464256286621,-73.87692260742188,40.75630569458008
-73.94670104980467,40.79732131958008,-73.9376449584961,40.80451583862305
-73.96315002441406,40.69382858276367,-73.956787109375,40.680530548095696
-73.89682006835938,40.74612808227539,-73.88862609863281,40.752723693847656
-73.82991790771484,40.713768005371094,-73.83494567871094,40.70729064941406
-73.9055404663086,40.77252578735352,-73.8953628540039,40.76896286010742
-73.941650390625,40.81829452514648,-73.950927734375,40.82603073120117
-73.93252563476562,40.85680389404297,-73.93136596679686,40.856117248535156
-73.95282745361328,40.808353424072266,-73.94914245605469,40.80290985107422
-73.904052734375,40.87870788574219,-73.89696502685547,40.90113067626953
-74.02134704589844,40.647010803222656,-74.00405883789062,40.65459442138672
-73.95098876953125,40.68049621582031,-73.9539566040039,40.69042205810547
-73.84967041015625,40.72400665283203,-73.83512878417969,40.70719909667969
-73.9466781616211,40.80628967285156,-73.93624877929686,40.79925155639648
-73.98682403564453,40.70245742797852,-73.97278594970702,40.69290161132813
-73.91205596923827,40.7754020690918,-73.89364624023438,40.76850509643555
-73.9617462158203,40.71377944946289,-73.98593139648438,40.71804809570313
-73.94091033935547,40.69868087768555,-73.94107818603516,40.6828498840332
-73.84423828125,40.72149658203125,-73.8086929321289,40.73440170288085
-73.89108276367188,40.74691009521485,-73.87848663330078,40.7494010925293
-73.84487915039062,40.75502395629883,-73.87222290039062,40.77399063110352
-73.87079620361328,40.73346328735352,-73.87014770507811,40.73357391357422
-73.94847869873048,40.81386184692383,-73.94107055664062,40.81884002685547


** subset of the data



I found following question in stackoverflow but not really sure if thats the correct approach.
Haversine Formula in Python (Bearing and Distance between two GPS points)



Update: So far solution



import math

def getPoints(lon, lat):
radius = 1800 # in feet (not sure if this is the right approach)
N = 360

# generate points
circlePoints =
for k in range(N):
angle = math.pi*2*k/N






python pandas latitude-longitude






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 1:47







Null-Hypothesis

















asked Nov 20 '18 at 22:04









Null-HypothesisNull-Hypothesis

5,76132103174




5,76132103174













  • Checked this?

    – Cheche
    Nov 20 '18 at 22:07













  • Totally dependent on your problem. You could have an infinite number of coords in range; do you have any way of pruning down the options before you run the test?

    – roganjosh
    Nov 20 '18 at 22:08











  • @roganjosh May be I am missing something How can there be infinite. We use the Central point and from that point we define radius and then select all the points that are in above columns that are within the distance.

    – Null-Hypothesis
    Nov 20 '18 at 22:53






  • 1





    I think OP wants to select, form a set of already determined lat,long pairs, those that are within a certain distance of another lat,long point. It boils down to a bunch of pairwise distance queries, if you don't use a fancier GIS index data structure.

    – interfect
    Nov 20 '18 at 22:59











  • My point was that lat and long are continuous (you may limit to a certain number of decimal places) but without some kind of geofencing you can quickly become swamped by the number of pairs to test.

    – roganjosh
    Nov 21 '18 at 6:36



















  • Checked this?

    – Cheche
    Nov 20 '18 at 22:07













  • Totally dependent on your problem. You could have an infinite number of coords in range; do you have any way of pruning down the options before you run the test?

    – roganjosh
    Nov 20 '18 at 22:08











  • @roganjosh May be I am missing something How can there be infinite. We use the Central point and from that point we define radius and then select all the points that are in above columns that are within the distance.

    – Null-Hypothesis
    Nov 20 '18 at 22:53






  • 1





    I think OP wants to select, form a set of already determined lat,long pairs, those that are within a certain distance of another lat,long point. It boils down to a bunch of pairwise distance queries, if you don't use a fancier GIS index data structure.

    – interfect
    Nov 20 '18 at 22:59











  • My point was that lat and long are continuous (you may limit to a certain number of decimal places) but without some kind of geofencing you can quickly become swamped by the number of pairs to test.

    – roganjosh
    Nov 21 '18 at 6:36

















Checked this?

– Cheche
Nov 20 '18 at 22:07







Checked this?

– Cheche
Nov 20 '18 at 22:07















Totally dependent on your problem. You could have an infinite number of coords in range; do you have any way of pruning down the options before you run the test?

– roganjosh
Nov 20 '18 at 22:08





Totally dependent on your problem. You could have an infinite number of coords in range; do you have any way of pruning down the options before you run the test?

– roganjosh
Nov 20 '18 at 22:08













@roganjosh May be I am missing something How can there be infinite. We use the Central point and from that point we define radius and then select all the points that are in above columns that are within the distance.

– Null-Hypothesis
Nov 20 '18 at 22:53





@roganjosh May be I am missing something How can there be infinite. We use the Central point and from that point we define radius and then select all the points that are in above columns that are within the distance.

– Null-Hypothesis
Nov 20 '18 at 22:53




1




1





I think OP wants to select, form a set of already determined lat,long pairs, those that are within a certain distance of another lat,long point. It boils down to a bunch of pairwise distance queries, if you don't use a fancier GIS index data structure.

– interfect
Nov 20 '18 at 22:59





I think OP wants to select, form a set of already determined lat,long pairs, those that are within a certain distance of another lat,long point. It boils down to a bunch of pairwise distance queries, if you don't use a fancier GIS index data structure.

– interfect
Nov 20 '18 at 22:59













My point was that lat and long are continuous (you may limit to a certain number of decimal places) but without some kind of geofencing you can quickly become swamped by the number of pairs to test.

– roganjosh
Nov 21 '18 at 6:36





My point was that lat and long are continuous (you may limit to a certain number of decimal places) but without some kind of geofencing you can quickly become swamped by the number of pairs to test.

– roganjosh
Nov 21 '18 at 6:36












1 Answer
1






active

oldest

votes


















1














How important is accuracy, especially near the poles of Earth?



The easy thing to do would be to work out the number of feet per degree of latitude and longitude at your central point. Then for each point, you calculate the latitude and longitude differences from your central point in degrees, an convert them to feet using the conversion factor that is correct at the central point. Then you compute the distance in feet as sqrt(latFeet^2 + longFeet^2).



The latitude/foot conversion factor will be constant everywhere (1 Earth circumference / 360 degrees of latitude), but the longitude/foot conversion factor will change as your latitude changes. If you draw a diagram and do some trigonometry, you can see that the distance around the (assumed spherical) Earth at a given latitude is 2 * Pi * Earth Radius * sin(90 degrees - abs(latitude)), and dividing that by 360 degrees of latitude gives you your distance per degree.



The approximation that 1 degree of latitude or longitude is the same distance in feet over the area you are working in breaks down at the poles, but if you don't have to operate near the poles, and if you don't care about the oblateness of the Earth, it should hold relatively well over distances of 1000 feet.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402280%2fgetting-lat-lang-within-1000ft-radius-of-a-central-lat-lang%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    How important is accuracy, especially near the poles of Earth?



    The easy thing to do would be to work out the number of feet per degree of latitude and longitude at your central point. Then for each point, you calculate the latitude and longitude differences from your central point in degrees, an convert them to feet using the conversion factor that is correct at the central point. Then you compute the distance in feet as sqrt(latFeet^2 + longFeet^2).



    The latitude/foot conversion factor will be constant everywhere (1 Earth circumference / 360 degrees of latitude), but the longitude/foot conversion factor will change as your latitude changes. If you draw a diagram and do some trigonometry, you can see that the distance around the (assumed spherical) Earth at a given latitude is 2 * Pi * Earth Radius * sin(90 degrees - abs(latitude)), and dividing that by 360 degrees of latitude gives you your distance per degree.



    The approximation that 1 degree of latitude or longitude is the same distance in feet over the area you are working in breaks down at the poles, but if you don't have to operate near the poles, and if you don't care about the oblateness of the Earth, it should hold relatively well over distances of 1000 feet.






    share|improve this answer




























      1














      How important is accuracy, especially near the poles of Earth?



      The easy thing to do would be to work out the number of feet per degree of latitude and longitude at your central point. Then for each point, you calculate the latitude and longitude differences from your central point in degrees, an convert them to feet using the conversion factor that is correct at the central point. Then you compute the distance in feet as sqrt(latFeet^2 + longFeet^2).



      The latitude/foot conversion factor will be constant everywhere (1 Earth circumference / 360 degrees of latitude), but the longitude/foot conversion factor will change as your latitude changes. If you draw a diagram and do some trigonometry, you can see that the distance around the (assumed spherical) Earth at a given latitude is 2 * Pi * Earth Radius * sin(90 degrees - abs(latitude)), and dividing that by 360 degrees of latitude gives you your distance per degree.



      The approximation that 1 degree of latitude or longitude is the same distance in feet over the area you are working in breaks down at the poles, but if you don't have to operate near the poles, and if you don't care about the oblateness of the Earth, it should hold relatively well over distances of 1000 feet.






      share|improve this answer


























        1












        1








        1







        How important is accuracy, especially near the poles of Earth?



        The easy thing to do would be to work out the number of feet per degree of latitude and longitude at your central point. Then for each point, you calculate the latitude and longitude differences from your central point in degrees, an convert them to feet using the conversion factor that is correct at the central point. Then you compute the distance in feet as sqrt(latFeet^2 + longFeet^2).



        The latitude/foot conversion factor will be constant everywhere (1 Earth circumference / 360 degrees of latitude), but the longitude/foot conversion factor will change as your latitude changes. If you draw a diagram and do some trigonometry, you can see that the distance around the (assumed spherical) Earth at a given latitude is 2 * Pi * Earth Radius * sin(90 degrees - abs(latitude)), and dividing that by 360 degrees of latitude gives you your distance per degree.



        The approximation that 1 degree of latitude or longitude is the same distance in feet over the area you are working in breaks down at the poles, but if you don't have to operate near the poles, and if you don't care about the oblateness of the Earth, it should hold relatively well over distances of 1000 feet.






        share|improve this answer













        How important is accuracy, especially near the poles of Earth?



        The easy thing to do would be to work out the number of feet per degree of latitude and longitude at your central point. Then for each point, you calculate the latitude and longitude differences from your central point in degrees, an convert them to feet using the conversion factor that is correct at the central point. Then you compute the distance in feet as sqrt(latFeet^2 + longFeet^2).



        The latitude/foot conversion factor will be constant everywhere (1 Earth circumference / 360 degrees of latitude), but the longitude/foot conversion factor will change as your latitude changes. If you draw a diagram and do some trigonometry, you can see that the distance around the (assumed spherical) Earth at a given latitude is 2 * Pi * Earth Radius * sin(90 degrees - abs(latitude)), and dividing that by 360 degrees of latitude gives you your distance per degree.



        The approximation that 1 degree of latitude or longitude is the same distance in feet over the area you are working in breaks down at the poles, but if you don't have to operate near the poles, and if you don't care about the oblateness of the Earth, it should hold relatively well over distances of 1000 feet.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 '18 at 23:10









        interfectinterfect

        1,4791021




        1,4791021
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53402280%2fgetting-lat-lang-within-1000ft-radius-of-a-central-lat-lang%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?