<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:m =
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 11.00.10570.1001">
<STYLE>@font-face {
font-family: Cambria Math;
}
@font-face {
font-family: Calibri;
}
@page WordSection1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; MARGIN: 0in
}
LI.MsoNormal {
FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; MARGIN: 0in
}
DIV.MsoNormal {
FONT-SIZE: 11pt; FONT-FAMILY: "Calibri",sans-serif; MARGIN: 0in
}
SPAN.EmailStyle17 {
FONT-FAMILY: "Calibri",sans-serif; COLOR: windowtext; mso-style-type: personal-compose
}
.MsoChpDefault {
FONT-FAMILY: "Calibri",sans-serif; mso-style-type: export-only
}
DIV.WordSection1 {
page: WordSection1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US style="WORD-WRAP: break-word" vLink=#954f72 link=#0563c1>
<DIV dir=ltr align=left><SPAN class=897140918-22032021><FONT color=#000080
size=2 face=Arial>Hi Javier,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=897140918-22032021><FONT color=#000080
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=897140918-22032021><FONT color=#000080
size=2 face=Arial>this should work with the vector tool 'disssolve' in
QGIS. </FONT></SPAN><FONT face=Arial><FONT color=#000080><FONT size=2>I<SPAN
class=897140918-22032021>n the menu </SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#000080><FONT size=2><SPAN
class=897140918-22032021>Vector > Geoprocessing tools >
Dissolve</SPAN></FONT></FONT></FONT><BR><SPAN class=897140918-22032021><FONT
color=#000080 size=2 face=Arial>open the dialog windows and select the dissolve
field. In your case this is the NewSegmentID, specify a new layer to be
created.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=897140918-22032021><FONT color=#000080
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=897140918-22032021><FONT color=#000080
size=2 face=Arial>Note that in PostGIS there are other options involving SQL
queries with "group by" and "st_collect" or "st_union"</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=897140918-22032021><FONT color=#000080
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=897140918-22032021><FONT color=#000080
size=2 face=Arial>Cheers</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=897140918-22032021><FONT color=#000080
size=2 face=Arial>Karsten</FONT></SPAN></DIV>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Qgis-us-user
[mailto:qgis-us-user-bounces@lists.osgeo.org] <B>On Behalf Of
</B>javier.valencia@vtgonline.com<BR><B>Sent:</B> Monday, March 22, 2021
09:25<BR><B>To:</B> qgis-us-user@lists.osgeo.org<BR><B>Subject:</B>
[Qgis-us-user] Merging segments<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=WordSection1>
<P class=MsoNormal>I have an application where I need to merge segments.
Every segment has an identifier OBJECTID which I believe is standard in
QGIS. The initial merging is done using an external database and I can generate
result in this format:<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal><U><SPAN style='FONT-FAMILY: "Courier New"'>OBJECTID
</SPAN></U><SPAN style='FONT-FAMILY: "Courier New"'>
<U>NewSegmentID</U><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10001
Seg00001<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10002
Seg00001<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10003
Seg00001<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10004
Seg00001<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10005
Seg00002<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10006
Seg00002<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10007
Seg00003<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10008
Seg00003<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10009
Seg00003<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10010
Seg00004<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10011
Seg00004<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'>10012
Seg00004<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style='FONT-FAMILY: "Courier New"'><o:p> </o:p></SPAN></P>
<P class=MsoNormal>I can generate the table above in just about any database
format, spreadsheet or any flavor of text including CSV, or tab
separated.<o:p></o:p></P>
<P class=MsoNormal>What I would like to do is merge individual segment into a
longer segment with the NewSegmentID (or a new OBJECTID as needed) as the
identifier, so, the new layer instead of having 12 segments has only 4 longer
segments.<o:p></o:p></P>
<P class=MsoNormal>I believe there is a way to manually select a few segments
and merge them into one, but we have 35,000 segments that we need to merge into
app, 8,000 longer segments so an automated solution is needed. The preferred
output format would be an ESRI shape file format.<o:p></o:p></P>
<P class=MsoNormal>Can I just link between the original layer and the new table
and then store the results in a new layer?<o:p></o:p></P>
<P class=MsoNormal>Is there a way to do this easily with existing QGIS
tools?<o:p></o:p></P>
<P class=MsoNormal>Is there a snippet of code with instructions that I can use
or easily modify to do what I need?<o:p></o:p></P>
<P class=MsoNormal>Any help you can provide would be greatly
appreciated.<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P>
<P class=MsoNormal>Javier Valencia, PE<o:p></o:p></P>
<P class=MsoNormal>913-915-3137<o:p></o:p></P>
<P class=MsoNormal><o:p> </o:p></P></DIV></BODY></HTML>