Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: exact command for distance ?


From   "Kieran McCaul" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: exact command for distance ?
Date   Sun, 13 Sep 2009 06:49:10 +0800

...


To quote GH Hardy: "I am reluctant to intrude in a discussion concerning
matters of which I have no expert knowledge,..."

But, it seems to me that for each farm, you could create a quick screen
that would remove the polygon points that were unlikely to be close to
the farm.  

If f_lat and f_long are the coordinates of the farm and the coordinates
for each polygon point are p_lat and p_long, then

gen fp_lat = f_lat - p_lat
gen fp_long = f_long - p_long
gen dist = sqrt(fp_lat^2 + fp_long^2)
qui sum dist, detail
keep if dist<`r(p5)'

If all your farms and lakes are in the UK, you would need to add a
constant to the longitudes before calculating the differences (modulo
180 or 360; I don't know how longitude is specified in the data).




______________________________________________
Kieran McCaul MPH PhD
WA Centre for Health & Ageing (M573)
University of Western Australia
Level 6, Ainslie House
48 Murray St
Perth 6000
Phone: (08) 9224-2701
Fax: (08) 9224 8009
email: [email protected]
http://myprofile.cos.com/mccaul 
http://www.researcherid.com/rid/B-8751-2008
______________________________________________
If you live to be one hundred, you've got it made.
Very few people die past that age - George Burns


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Laura
Platchkov
Sent: Sunday, 13 September 2009 12:59 AM
To: [email protected]
Subject: RE: st: RE: exact command for distance ?

Well, Roy, do you have any idea of how long it will take if i have one
dataset with 800 points  (farms) and the other, with 200'000 (points of
lakes lines) ???? Stata has been running the whole afternoon now, and I
am wondering whether I shouldn't maybe reduce the number of observaitons
of the second dataset...

Or Is there an amendment in the command that I could do in order for
STATA to compute only the distances from the farms to the nearest lakes,
and not from the points of the lakes to the nearest farms...?


Laura

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index