Home » Projects » Rangeland Soil Management and Hydrology » Watershed-scale Hydropedology » Hydrologic Modeling in Oak Woodland Soilscapes » SFREC » Generation of Vegetation Sampling Areas » Conversion of Sampling Blocks to GPS Waypoints
Conversion of Sampling Blocks to GPS Waypoints
Conversion of Sample Plot Boundaries to Points
Example
# extract vertices and centroid
# interpolate vertices resulting in a vertex every 50m
v.to.points -v -i in=blocks_1 out=b1p dmax=75 --o
v.to.points -v -i in=blocks_2 out=b2p dmax=75 --o
# patch them together:
v.patch in=b1p,b2p out=vp --o
v.build vp
# remove duplicate points
# new file does not have an attribute table
v.out.ascii vp | sort -g | uniq | v.in.ascii -t out=veg_points
# add attribute table:
v.db.addtable veg_points
# cleanup
g.remove vect=b1p,b2p,vp
# export to shapefile:
v.out.ogr -e in=veg_points type=point dsn=veg_points.shp
# convert to GPX [LL WGS84]
# translate the 'cat' column to 'name'
ogr2ogr -t_srs '+proj=latlong +datum=WGS84' \
-f GPX -dsco GPX_USE_EXTENSIONS=YES \
veg_points.gpx veg_points.shp \
-sql "SELECT cat AS name FROM veg_points"
# upload the wp_gps.gpx file to the GPS unit
gpsbabel -i gpx -f veg_points.gpx -o garmin -F /dev/ttyS0
# simple PDF map:
# results in a rather large PDF
# looks like Cairo is used by default
d.font.freetype font=VeraBd
d.rast doqq
d.vect veg_points disp=shape,cat icon=basic/circle size=9 lsize=9 fcol=yellow col=black lcol=white
d.out.file format=pdf out=veg_survey/simple_map paper=us-letter