DistanceDevelopment / spatial-workshops

Distance sampling workshop content
http://distancesampling.org/workshops/
2 stars 0 forks source link

Save transect ID in Segment_Centroids #28

Closed dill closed 8 years ago

dill commented 8 years ago

Can the ID for the transects be saved in the Segment_Centroids? This is quite useful later on and otherwise involves some rather painful reconstruction from other tables in R.

jjrob commented 8 years ago

What is the transect ID? Which survey it was (there were two)? The combination of survey and date?

dill commented 8 years ago

Ah, sorry, lack of specificity on my part.

By transect ID, I really mean: "an identifier for each contiguous set of segments".

Specifically:

What would be great is if I can re-create the graphic on page 3 of the what-is-a-dsm.pdf slides. At the moment it requires messing about with fortify() and only has lat/long (code here.

The fortify() call gives a group code to each polyline (?) in the object. Is it possible and simple to do this in Arc? If not it's not the end of the world.

jjrob commented 8 years ago

Sorry, but I'm unsure of what you mean by each contiguous set of segments. If you just want to separate the red lines from the blue lines in the page 3 what-is-a-dsm presentation, that information is kept in the Survey field. There are two values of this field and it is currently present in Sightings but not Segment_Centroids. Would you like me to add it to Segment_Centroids? That would be no problem...

dill commented 8 years ago

Maybe we can have a quick chat about this to resolve the ambiguity. Would 4pm work for you?

jjrob commented 8 years ago

Any time between now and 5 pm works for me.

dill commented 8 years ago

As pointed out by Jason, this data is stored in the Segments table in the Analysis.gdb file

tracks <- readOGR("Analysis.gdb", "Segments")
tracks <- fortify(tracks)
p <- p + geom_path(aes(x=long,y=lat, group=group), colour="white", data=tracks)
print(p)