Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Well if those are the only distances that you need to calculate, it's much easier to get the coordinate of Heathrow and Gatwick in OSGB36 coordinates. These are, using this web form https://www.ordnancesurvey.co.uk/gps...ormation/batch to convert
    Code:
    51.470020,W,0.454295
    51.14806,W,0.19028
    to
    Code:
    507457.462 175694.047
    526676.516 140312.403
    To calculate your distances:
    Code:
    clear
    input str7 pcd str6 oseast1m str7 osnrth1m str9 ctry
    "AB1 0AA" "385386" "0801193" "S92000003"
    "AB1 0AB" "385177" "0801314" "S92000003"
    "AB1 0AD" "385053" "0801092" "S92000003"
    "AB1 0AE" "384600" "0799300" "S92000003"
    "AB1 0AF" "384460" "0800660" "S92000003"
    end
    
    destring oseast1m, gen(oseast)
    destring osnrth1m, gen(osnrth)
    
    local easting 507457.462
    local northing 175694.047
    gen d_heathrow = sqrt((oseast-`easting')^2+(osnrth-`northing')^2) / 1000
    
    local easting 526676.516
    local northing 140312.403
    gen d_gatwick = sqrt((oseast-`easting')^2+(osnrth-`northing')^2) / 1000
    To check, I calculate the distance from the first point converted in #12 to both airports using GPS coordinates and then compare to the distances calculated using OSGB36 coordinates:

    Code:
    . geodist 57.101459 -2.2428581 51.470020 -0.454295
    WGS 1984 ellipsoid(6378137,298.257223563) distance = 637.50746 km
    
    . geodist 57.101459 -2.2428581 51.14806 -0.19028
    WGS 1984 ellipsoid(6378137,298.257223563) distance = 676.02503 km
    
    . list in 1
    
         +-----------------------------------------------------------------------------------+
         |     pcd   oseast1m   oseast   osnrth1m   osnrth        ctry   d_heat~w   d_gatw~k |
         |-----------------------------------------------------------------------------------|
      1. | AB1 0AA     385386   385386    0801193   801193   S92000003   637.2993   675.8152 |
         +-----------------------------------------------------------------------------------+
    
    .
    As you can see, the distances are pretty close.

    Comment


    • #17
      Amazing thank you!

      Comment


      • #18
        Hello,

        I am struggling with kinda same problem as Eleonora a year ago and I hope someone can help me with.

        So, I also want to measure/know what the distance of several properties are from a certain point, namely one of new metro station in Amsterdam which will be in service next year.
        I want to investigate if that station already has effect on the value of the properties in its vicinity, and to what distance is this effect significant.

        My STATA knowledge is very very basic.

        In my data I have the following information about the location of each property:
        PC4_ID PC6_X PC6_Y
        1021 122999 488545
        1021 122919 488326
        PC4_ID is the 4-numbers of the 6-digit postcode (in Amsterdam), the last 2-digits should be letters (like 1021AB) but I don't have those letters in my data. And the PC6_X and PC6_Y should be the X,Y-coordinates of the 6-digit postcode, but I don't have any explanation about it in my data. And when I check for location of this coordinates in ArcMap (not so good with it either) it shows that it is somewhere in Africa and not in Amsterdam (The Netherlands).

        My questions: Are these PC6_X and PC6_Y good format of coordinates to work with? And if so, how can I find what the PC6_X and PC6_Y is for the location I want to measure distance from (address of the station: Nieuwe Leeuwarderweg, 1022 Amsterdam, Nederland)? And finally how can I find the distance between each property in my data and this station?

        I hope that someone can help me.

        Thank you very much in advance!!!!
        Gazella

        Comment

        Working...
        X