.TH v.lrs.create 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBv.lrs.create\fR\fR - Creates Linear Reference System .SH KEYWORDS vector, LRS, networking .SH SYNOPSIS \fBv.lrs.create\fR .br \fBv.lrs.create help\fR .br \fBv.lrs.create in_lines\fR=\fIname\fR \fBout_lines\fR=\fIname\fR [\fBerr\fR=\fIname\fR] \fBpoints\fR=\fIname\fR [\fBllayer\fR=\fIinteger\fR] [\fBplayer\fR=\fIinteger\fR] \fBlidcol\fR=\fIstring\fR \fBpidcol\fR=\fIstring\fR [\fBstart_mp\fR=\fIstring\fR] [\fBstart_off\fR=\fIstring\fR] [\fBend_mp\fR=\fIstring\fR] [\fBend_off\fR=\fIstring\fR] [\fBrsdriver\fR=\fIstring\fR] [\fBrsdatabase\fR=\fIstring\fR] \fBrstable\fR=\fIstring\fR [\fBthresh\fR=\fIfloat\fR] [\-\-\fBoverwrite\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBin_lines\fR=\fIname\fR" 4m .br Input vector map containing lines .IP "\fBout_lines\fR=\fIname\fR" 4m .br Output vector map where oriented lines are written .IP "\fBerr\fR=\fIname\fR" 4m .br Output vector map of errors .IP "\fBpoints\fR=\fIname\fR" 4m .br Input vector map containing reference points .IP "\fBllayer\fR=\fIinteger\fR" 4m .br Layer number .br Line layer .br Default: \fI1\fR .IP "\fBplayer\fR=\fIinteger\fR" 4m .br Layer number .br Point layer .br Default: \fI1\fR .IP "\fBlidcol\fR=\fIstring\fR" 4m .br Column containing line identifiers for lines .IP "\fBpidcol\fR=\fIstring\fR" 4m .br Column containing line identifiers for points .IP "\fBstart_mp\fR=\fIstring\fR" 4m .br Column containing milepost position for the beginning of next segment .br Default: \fIstart_mp\fR .IP "\fBstart_off\fR=\fIstring\fR" 4m .br Column containing offset from milepost for the beginning of next segment .br Default: \fIstart_off\fR .IP "\fBend_mp\fR=\fIstring\fR" 4m .br Column containing milepost position for the end of previous segment .br Default: \fIend_mp\fR .IP "\fBend_off\fR=\fIstring\fR" 4m .br Column containing offset from milepost for the end of previous segment .br Default: \fIend_off\fR .IP "\fBrsdriver\fR=\fIstring\fR" 4m .br Driver name for reference system table .br Default: \fIdbf\fR .IP "\fBrsdatabase\fR=\fIstring\fR" 4m .br Database name for reference system table .br Default: \fI$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/\fR .IP "\fBrstable\fR=\fIstring\fR" 4m .br Name of table where the reference system will be written .br New table is created by this module .IP "\fBthresh\fR=\fIfloat\fR" 4m .br Maximum distance of point to line allowed .br Default: \fI1\fR .PP .SH DESCRIPTION \fIv.lrs.create\fR generates a LRS (Linear Reference System) from vector line and point data. .PP It is highly recommended to work with polylines instead of segmented vector lines. The command \fIv.build.polylines\fR creates this map structure. .SH NOTES The mileposts (point) vector map columns \fIstart_mp\fR, \fIstart_off\fR, \fIend_mp\fR, \fIend_off\fR must be of 'double precision' type. For milepost ordering, it is sufficient to enter increasing numbers into the \fIstart_mp\fR column indicating the order along the vector line. .PP The \fIlidcol\fR and \fIpidcol\fR columns contain the line IDs which relate mileposts and vector line(s) to each other. .PP When creating a LRS with this module, any existing \fIrstable\fR will be replaced. .SH EXAMPLE This example is written for the Spearfish dataset. .PP As first step, bus route data are prepared. \fC .DS .br # break into segments for correct route selection .br v.clean roads_net out=busroute_tmp tool=break .br .br # make polyline for easier line selection by coordinate pairs .br v.build.polylines busroute_tmp out=busroute_tmp2 .br .br # reverse delete: reduce route map to bus route (enter in one line) .br v.edit \-r busroute_tmp2 tool=delete coords=590273,4927304,\(rs .br 590346,4927246,590414,4927210,590438,4927096,590468,4926966,\(rs .br 590491,4926848,590566,4926798,590637,4926753,590701,4926698,\(rs .br 590830,4926726,590935,4926751,590993,4926830,590972,4926949,\(rs .br 590948,4927066,590922,4927182,590957,4927251 thresh=5 .br .br # vector line needs to be polyline .br v.build.polylines busroute_tmp2 out=busroute_tmp3 .br v.category busroute_tmp3 out=busroute op=add .br g.remove vect=busroute_tmp,busroute_tmp2,busroute_tmp3 .br .DE \fR The result can be visualized: \fC .DS .br g.region vect=busroute n=n+100 s=s-100 w=w-100 e=e+100 .br d.mon x0 .br d.vect roads_net .br d.vect busroute col=red width=2 .br .DE \fR The vector map 'busroute' needs have an attribute table which contain an integer column \fIlidcol\fR with value be '22' for this example (bus route): \fC .DS .br v.db.addtable busroute col="lid integer" .br v.db.update busroute col=lid value=22 .br v.db.select busroute .br cat|lid .br 1|22 .br .DE \fR A new point map 'busstops' shall contain mileposts (bus stops) along this line (use \fIthresh\fR to define maximal accepted deviation from this line): \fC .DS .br # generate points map .br echo "590263|4927361 .br 590432|4927120 .br 590505|4926776 .br 590660|4926687 .br 590905|4926742 .br 590972|4926949 .br 591019|4927263" | v.in.ascii out=busstops .br .br d.vect busstops icon=basic/triangle col=blue .br d.vect busstops disp=cat lcol=blue .br .DE \fR The milepost attributes table needs to be created with specific columns: \fC .DS .br v.db.addtable busstops col="lid integer, start_mp double precision, \(rs .br start_off double precision, end_mp double precision, \(rs .br end_off double precision" .br v.db.update busstops col=lid value=22 .br .DE \fR Since the digitizing order of v.in.ascii above reflects the bus stop order along the route, we can simply copy the category number as milepost order number in column \fIstart_mp\fR: \fC .DS .br v.db.update busstops col=start_mp qcol=cat .br # verify table .br v.db.select busstops .br cat|lid|start_mp|start_off|end_mp|end_off .br 1|22|1||| .br 2|22|2||| .br 3|22|3||| .br 4|22|4||| .br 5|22|5||| .br 6|22|6||| .br 7|22|7||| .br .br # visualize with start_mp to check order .br d.erase .br d.vect roads_net .br d.vect busroute col=red width=2 .br d.vect busstops icon=basic/triangle col=blue .br d.vect busstops disp=attr attrcol=start_mp lcol=blue .br .DE \fR Offsets (\fIstart_off\fR, \fIend_off\fR) can be later used in case the route or mileposts get modified. .PP As second step, the linear reference network is created: \fC .DS .br v.lrs.create busroute points=busstops out=route_lrs err=lrs_error \(rs .br lidcol=lid pidcol=lid rstable=route_lrs thresh=50 .br .DE \fR This creates the maps 'route_lrs' containing the LRS and 'lrs_error' containing the errors if any. The resulting LRS table and map can be shown: \fC .DS .br # show LRS table .br db.select route_lrs .br .br d.vect route_lrs col=blue width=2 .br .DE \fR .SH SEE ALSO \fILRS tutorial\fR, .br \fIIntroducing the Linear Reference System in GRASS\fR, .PP \fIv.build.polylines\fR, \fIv.lrs.segment\fR, \fIv.lrs.where\fR, \fIv.lrs.label\fR .SH AUTHOR Radim Blazek, ITC-irst/MPA Solutions .br Documentation update (based on above journal article and available fragments): Markus Neteler .PP \fILast changed: $Date: 2007-06-28 17:28:50 +0200 (Thu, 28 Jun 2007) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team