![]() csv (that can be read by any software).dta (which requires Stata), and. We provide the dataset in three different formats. Distance accuracy depends on the map projection used. Detailed explanations on how variables have been generated based on these sources are provided in the following sections. All map projections involve distorsions as portions of a spheroid are transfered to a plane. geodist is a useful command in Stata that helps you to find the distance between two cities/locations, the nearest location from your target city/location, and the number of cities/location within a certain radius. Geodist latitude0 longitude0 latitude longitude, gen(km_to_wellNo)īysort wellNo0 (km_to_wellNo): egen hasNearby = total(km_to_wellNo > 0 & km_to_wellNo < 1)Įrase "temp.dta"If the locations are in map coordinates (in meters, kms, yards, etc.) instead of geographic coordinates, then you can only compute distances on the map (using Euclidean distances). Different measures of bilateral distances are available for 225 countries. * second method - form all pairwise combinations of points GeoDist Description GeoDist provides several geographical variables, in particular bilateral distances measured using city-level data to account for the geographic distribution of population inside each nation. Counties are from Census 2000 SF1 and Census 2010 SF1 files. > -Original Message- > From: mailto: On Behalf Of Robert Picard > Sent: 15:12 > To: > Subject: Re: st. Neighbor(wellNo latitude longitude) within(1) longīysort wellNo0 (km_to_wellNo): keep if _n = _N Public Use Data Archive County Distance Database County Distance Database County Distances are great-circle distances calculated using the Haversine formula based on internal points in the geographic area. Just one (I hope) more question: I'm using Stata 10, and am not sure what the equivalent of 'merge 1:1 n' is. Geonear wellNo0 latitude longitude using "temp.dta", /// ![]() Language: Stata Requires: Stata version 9. geodist can also calculate great-circle distances using the haversine formula. Heres an updated version of my example the looping is over all observations of the second dataset. By default, geodist implements Vincenty's (1975) formula to calculate distances on a reference ellipsoid. This puts each set of observations side-to-side and its easier to manage. Input float wellNo double(longitude latitude) Re: st: looping with geodist If you have two kinds of locations, then the easiest solution is not to append both datasets but to do an unmatched merge. Input float wellNo str24(longitude latitude)ĮndThis will create a variable = 1 if there exists another well within 1 km of it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |