Hi all,
I have already posted this below a (old) thread, but re-post it here as I did not receive a response.
I am new to smap and am trying to map villages (level=0) and cities (level=1) on a map and connect the points with a line in case the two levels share the same ID (meaning that a person goes both to the village and the city). In the example below, I would want a line connecting the 4th and 35th observation, for example. There could be a point that needs to be connected with several others.
The data looks like this:
+--------------------------------------+
| level latitude longitude ID |
|--------------------------------------|
1. | 0 14.8984 -16.5432 102 |
2. | 0 14.9084 -16.4556 103 |
3. | 0 14.7076 -16.0167 103 |
4. | 0 15.3681 -16.1361 102 |
34. | 1 14.941592 -16.490471 101 |
35. | 1 14.941592 -16.490471 102 |
So far, I am merging this data to data generated from a shapefile and plot the points using smap.
use corr.dta, clear
merge 1:m id using data", nogen
spmap Shape_Area using coord0.dta, id(id) fcolor(white) point(xcoord(longitude) ycoord(latitude) by(level) fcolor(Blues) legenda(on)) legend(size(medium) position(1))
Now, as I said, I am struggling with getting the lines to connect observations that share the same ID.
Do you have any advice on how to do this? Thank you very much in advance,
Best,
Marlene
Related Posts with Smap: connect points if fullfill a criteria
Dyadic analysis - what are the key assumptionsHi all, We want to perform dyadic analysis for a cross-sectional dataset of about 800 families with…
Remove spaces from string if consecutive one letter characters or numbersHi how would I go about removing spaces from strings such as the following: 1 2 B L GROW A I M INC b…
cutt-off missing dataDear statlisters, i have a data set with 1500 observation and 60 variables. the highest percentage o…
Elementary Question on string/concatenateHi Stata Community, I would like to destring multiple answers in my dataset. The survey allowed res…
reshape data?Dear All, I find this question here (https://bbs.pinggu.org/thread-6924503-1-1.html). The data is C…
Subscribe to:
Post Comments (Atom)
0 Response to Smap: connect points if fullfill a criteria
Post a Comment