<html 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" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"Preformattato HTML Carattere";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
span.PreformattatoHTMLCarattere
        {mso-style-name:"Preformattato HTML Carattere";
        mso-style-priority:99;
        mso-style-link:"Preformattato HTML";
        font-family:"Consolas",serif;
        color:black;}
span.StileMessaggioDiPostaElettronica20
        {mso-style-type:personal;
        font-family:"Tahoma",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
span.StileMessaggioDiPostaElettronica21
        {mso-style-type:personal;
        font-family:"Tahoma",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
span.StileMessaggioDiPostaElettronica22
        {mso-style-type:personal;
        font-family:"Tahoma",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
span.StileMessaggioDiPostaElettronica23
        {mso-style-type:personal-compose;
        font-family:"Tahoma",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
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 bgcolor="white" lang="IT" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext">Hi Dmitry,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext">thank you for you response. There is a way to do the step 2 using GDAL?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext">Moreover, if the path lengths are not multiple of the split size (e.g. 1000m), how the last segment is handled?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext">Nicola<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext;mso-fareast-language:IT">Da:</span></b><span style="color:windowtext;mso-fareast-language:IT"> gdal-dev [mailto:gdal-dev-bounces@lists.osgeo.org]
<b>Per conto di </b>Dmitry Baryshnikov<br>
<b>Inviato:</b> martedì 7 giugno 2016 16:16<br>
<b>A:</b> gdal-dev@lists.osgeo.org<br>
<b>Oggetto:</b> Re: [gdal-dev] Problem using ogrlineref<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Nicola,<br>
<br>
The idea of ogrlineref was follow:<br>
1. You have layer with some lines and some reper points with known linear coordinates<br>
2. The reper points divide lines on equal parts (e.i. 1000 m) - this is important that parts should be equal<br>
3. The result file will have special structure (required fields: beg, end, scale, and some optional)<br>
4. During referencing  ogrlineref make attribute query and get needed part based on beg and end fields (which is rather fast), and than calc point position inside this part.<br>
<br>
In your case, the simple way is to extract begin and end point of your lines and make them reper points. After that all steps are usual.
<br>
<br>
There is no sense to move other fields into the parts file from your original datasource. But you can use -lf option to store some value and use it in future for join with your original data.<br>
<br>
<span style="font-size:12.0pt;mso-fareast-language:IT"><o:p></o:p></span></p>
<pre>Best regards,<o:p></o:p></pre>
<pre>    Dmitry<o:p></o:p></pre>
<div>
<p class="MsoNormal">07.06.2016 15:19, Nicola Baraldo (ICONSULTING) пишет:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Hi guys,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">I am trying to split some routes into segments of the same length (dynamic segmentation) using ogrlineref command.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">My data is stored in a shapefile containing a set of paths, for each path I know the length in meters.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">I have tried ogrlineref with –create, –get_coord and - get_subline.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">For the first option I don’t have a reper datasource to provide because I don’t have mile-stones, are they really necessaries?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">The second and third options give me the following error for each path contained in the input shapefile; with –get_coord I have tried both options “–m 0” and “–m
 1000”, with –get_subline I have tried “-mb 0 -me 1” options.</span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:IT"><br>
<br>
<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;mso-fareast-language:IT">Can someone help me using this command? Is there a better way to perform dynamic segmentation using GDAL?</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:IT">
</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Moreover my shapefile contains also a lot of other fields, there is a way to keep these information also in the output file?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif">Nicola</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:IT"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>gdal-dev mailing list<o:p></o:p></pre>
<pre><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><o:p></o:p></pre>
<pre><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:IT"><o:p> </o:p></span></p>
</div>
</body>
</html>