<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: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;
        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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML con formato previo Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.HTMLconformatoprevioCar
        {mso-style-name:"HTML con formato previo Car";
        mso-style-priority:99;
        mso-style-link:"HTML con formato previo";
        font-family:Consolas;
        mso-fareast-language:EN-US;}
span.EstiloCorreo21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EstiloCorreo22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EstiloCorreo23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EstiloCorreo24
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.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 lang="CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="ES" style="color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I think it’s enough exporting one of the Z. It’s a not very used particularity of the format.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><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 lang="ES" style="mso-fareast-language:CA">De:</span></b><span lang="ES" style="mso-fareast-language:CA"> Even Rouault <even.rouault@spatialys.com>
<br>
<b>Enviado el:</b> dimarts, 12 de desembre de 2023 15:35<br>
<b>Para:</b> Abel Pau <a.pau@creaf.uab.cat>; gdal-dev@lists.osgeo.org<br>
<b>Asunto:</b> Re: [gdal-dev] Creating a diver: specify the options to create a layer<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>You could also potentially expose all the height values as a attribute of type RealList (not all OGR drivers support that though).  The open option also seems reasonable. Up to you w.r.t the use cases you've in mind.<o:p></o:p></p>
<div>
<p class="MsoNormal">Le 12/12/2023 à 15:02, Abel Pau a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Hi again,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">thanks for the interest, Even. You’ll rest of me when I finish the driver. I promise :)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">I didn’t explain it well. I try again.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Now I am in the case I want to translate from MiraMon to other GDAL formats.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">For instance, points MiraMon format can have one or several Z values for each point. Then the user who wants to translate from MiraMon to other formats has to decide from command line which of Z’s
 wants to get. </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Example:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">The file <b>MiraMoin_zPoints.pnt</b> has 3 points:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">point (2,2) has 3 heights: 8, 3.2 and 9</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">point (1,2) has 2 heights: 3, 8.1</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">point (2,4) has 1 height: 9</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">User has three options to get a Z for each point:
</span><o:p></o:p></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="color:#1F497D">Get the first one for each point: 8, 3 and 9</span><o:p></o:p></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="color:#1F497D">Get the highest one for each point: 9, 8.1 and 9</span><o:p></o:p></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span lang="EN-US" style="color:#1F497D">Get the lowest one for each point: 3.2, 3 and 9</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">It’s a user decision. By default user will obtain the first one for each point but perhaps user wants another thing.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">So, then, in a command line we could have:  
<b>ogr2ogr gml_file.gml MiraMoin_zPoints.pnt</b> to translate from MiraMon to GML</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">If user wants to specify which Z wants, then this decision should be expressed in this line in some way.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">After a research in the code (not documentation) I managed to get the way and now I would like to be sure that is the correct way:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#1F497D">ogr2ogr gml_file.gml MiraMoin_zPoints.pnt -oo Height=First</span></b><span lang="EN-US" style="color:#1F497D">, for getting the GML with the first Z of each point</span><o:p></o:p></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#1F497D">ogr2ogr gml_file.gml MiraMoin_zPoints.pnt -oo Height=Hightest</span></b><span lang="EN-US" style="color:#1F497D">, for getting the GML with the highest Z of each point</span><o:p></o:p></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#1F497D">ogr2ogr gml_file.gml MiraMoin_zPoints.pnt -oo Height=Lowest</span></b><span lang="EN-US" style="color:#1F497D">, for getting the GML with the lowest Z of each point</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Using “-oo“, in the Open() method of MiraMon driver datasource I can retrieve this value, save it in some variable and then give, for every feature, the appropriate Z in the GetNextRawFeature() method
 of the layer.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:CA">OGRMiraMonDataSource</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">::Open(</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">const</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">char</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> *</span><span style="font-size:9.5pt;font-family:Consolas;color:gray;mso-fareast-language:CA">pszFilename</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">,
</span><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:CA">VSILFILE</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> *</span><span style="font-size:9.5pt;font-family:Consolas;color:gray;mso-fareast-language:CA">fp</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">,</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">                          
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">const</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#2B91AF;mso-fareast-language:CA">OGRSpatialReference</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> *</span><span style="font-size:9.5pt;font-family:Consolas;color:gray;mso-fareast-language:CA">poSRS</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">,
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">int</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">
</span><span style="font-size:9.5pt;font-family:Consolas;color:gray;mso-fareast-language:CA">bUpdateIn</span><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">                           
</span><b><i><span style="font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:CA">char</span></i></b><b><i><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA"> **</span></i></b><b><i><span style="font-size:9.5pt;font-family:Consolas;color:gray;mso-fareast-language:CA">papszOpenOptionsUsr</span></i></b><span style="font-size:9.5pt;font-family:Consolas;color:black;mso-fareast-language:CA">)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">If it’s correct, perfect. If not, then, which way would be the appropriate?<br>
<br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thanks and I hope have been clear now :)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thanks!</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="ES" style="mso-fareast-language:CA">De:</span></b><span lang="ES" style="mso-fareast-language:CA"> Even Rouault
<a href="mailto:even.rouault@spatialys.com"><even.rouault@spatialys.com></a> <br>
<b>Enviado el:</b> dimarts, 12 de desembre de 2023 13:17<br>
<b>Para:</b> Abel Pau <a href="mailto:a.pau@creaf.uab.cat"><a.pau@creaf.uab.cat></a>;
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<b>Asunto:</b> Re: [gdal-dev] Creating a diver: specify the options to create a layer</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p>Abel Pau,<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Do I have to use the same to specify which height (in file with Z) I have to offer?<o:p></o:p></p>
<p class="MsoNormal">I have three possibilities: First Z, Highest or Lowest. I want the usem tells me what he/she wants.
<o:p></o:p></p>
<p class="MsoNormal">How can I do that? Where can I get, then, this values?<o:p></o:p></p>
</blockquote>
<p>I'm not sure to understand your question. Are those height values fields to fill in the file header?
<o:p></o:p></p>
<p>If so, yes you may obviously offer layer creation options to fill them.  If those values are directly related with the Z component of geometries of features the user writes into the file, and you can edit the header in a post processing stage (but I believe
 your strategy was to write some temporary file, before the final file, so that should be possible), you could also possibly infer them from the values of the features too.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:CA">Even
</span><o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</body>
</html>