<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Nicola,<br>
    <br>
    The first and last segments usually have beg and end fields value
    not <span id="result_box" class="short_text" lang="en"><span
        class="">a multiple of 1000. <br>
        I.e. begin = 576 m, end 1000 m or begin 76200 m, end 76234 m<br>
        This is ok, and ogrlineref correctly woks with this case. <br>
        <br>
        I think, that you can try to play with your data without equal
        parts sizes. But ogrlineref need - beg (double), end(double) and
        scale (double) fields.<br>
        Scale - is spatial length of you part divided on linear lenght.<br>
        I.e. scale = part.get_Length() / (end - beg) <br>
      </span></span><br>
    <pre class="moz-signature" cols="72">Best regards,
    Dmitry</pre>
    <div class="moz-cite-prefix">07.06.2016 18:25, Nicola Baraldo
      (ICONSULTING) пишет:<br>
    </div>
    <blockquote
cite="mid:VI1PR0201MB1790D008D519A34D67561552E75D0@VI1PR0201MB1790.eurprd02.prod.outlook.com"
      type="cite">
      <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]-->
      <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
style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"
            lang="EN-US">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
style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"
            lang="EN-US">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
style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"
            lang="EN-US">Best regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"
            lang="EN-US">Nicola<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:windowtext"
            lang="EN-US"><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 [<a class="moz-txt-link-freetext" href="mailto:gdal-dev-bounces@lists.osgeo.org">mailto:gdal-dev-bounces@lists.osgeo.org</a>]
                <b>Per conto di </b>Dmitry Baryshnikov<br>
                <b>Inviato:</b> martedì 7 giugno 2016 16:16<br>
                <b>A:</b> <a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><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
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US">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
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US">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
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US"> </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
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US">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
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US">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
style="font-size:10.0pt;font-family:"Tahoma",sans-serif;mso-fareast-language:IT"
              lang="EN-US">Can someone help me using this command? Is
              there a better way to perform dynamic segmentation using
              GDAL?</span><span
              style="font-size:12.0pt;font-family:"Times New
              Roman",serif;mso-fareast-language:IT" lang="EN-US">
            </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
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US">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
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US">Thanks,</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:10.0pt;font-family:"Tahoma",sans-serif"
              lang="EN-US">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 moz-do-not-send="true" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><o:p></o:p></pre>
          <pre><a moz-do-not-send="true" 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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>