Hello,
I'm trying to merge two datasets using GPS data (latitude and longitude) as ID. On the first dataset, the GPS data is like this : -1.467934012413. On the other one, like this : -1.5.
In order to be able to merge the datasets, i tried to round the observations from the first dataset using:
At first I thought it worked fine, but when I tried to perform the merge, I realized that observations that should have matched didn't.
I think the problem comes from the round function, because when I use dataex, it shows that some observations are not quite rounded. I read on another thread that it was a common phenomen and a matter of format, but I couldn't find how to fix the problem in my case.
How can I make these observations perfectly rounded si I can perform the merge?
Thanks,
Mathias Imboden
I'm trying to merge two datasets using GPS data (latitude and longitude) as ID. On the first dataset, the GPS data is like this : -1.467934012413. On the other one, like this : -1.5.
In order to be able to merge the datasets, i tried to round the observations from the first dataset using:
Code:
replace lon_mod=round(lon_mod, 0.1) replace lat_mod=round(lat_mod, 0.1)
I think the problem comes from the round function, because when I use dataex, it shows that some observations are not quite rounded. I read on another thread that it was a common phenomen and a matter of format, but I couldn't find how to fix the problem in my case.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double(lat_mod lon_mod) -1.5 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 29.900000000000002 -1.4000000000000001 30 -1.3 29.8 -1.3 29.8 -1.3 29.8 -1.3 29.8 -1.3 29.8 -1.3 29.8 -1.3 29.8 -1.3 29.8 -1.3 29.8 -1.3 29.8 -1.3 30.1 -1.3 30.1 end
Thanks,
Mathias Imboden
Comment