<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<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.<br>
</p>
<div class="moz-cite-prefix">Le 12/12/2023 à 15:02, Abel Pau a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:PAXPR07MB77755868C59532CF3A0C1611A28EA@PAXPR07MB7775.eurprd07.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<style>@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;}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-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.EstiloCorreo19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}span.EstiloCorreo20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}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.EstiloCorreo23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}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="color:#1F497D" lang="EN-US">Hi
again,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">thanks
for the interest, Even. You’ll rest of me when I finish the
driver. I promise :)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">I
didn’t explain it well. I try again.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Now
I am in the case I want to translate from MiraMon to other
GDAL formats.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">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. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Example:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">The
file <b>MiraMoin_zPoints.pnt</b> has 3 points:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">point
(2,2) has 3 heights: 8, 3.2 and 9<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">point
(1,2) has 2 heights: 3, 8.1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">point
(2,4) has 1 height: 9<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">User
has three options to get a Z for each point:
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span
style="color:#1F497D" lang="EN-US">Get the first one for
each point: 8, 3 and 9<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span
style="color:#1F497D" lang="EN-US">Get the highest one for
each point: 9, 8.1 and 9<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span
style="color:#1F497D" lang="EN-US">Get the lowest one for
each point: 3.2, 3 and 9<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">It’s
a user decision. By default user will obtain the first one
for each point but perhaps user wants another thing.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">So,
then, in a command line we could have:
<b>ogr2ogr gml_file.gml MiraMoin_zPoints.pnt</b> to
translate from MiraMon to GML<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">If
user wants to specify which Z wants, then this decision
should be expressed in this line in some way.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">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:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F497D" lang="EN-US">ogr2ogr
gml_file.gml MiraMoin_zPoints.pnt -oo Height=First</span></b><span
style="color:#1F497D" lang="EN-US">, for getting the GML
with the first Z of each point<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F497D" lang="EN-US">ogr2ogr
gml_file.gml MiraMoin_zPoints.pnt -oo Height=Hightest</span></b><span
style="color:#1F497D" lang="EN-US">, for getting the GML
with the highest Z of each point<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F497D" lang="EN-US">ogr2ogr
gml_file.gml MiraMoin_zPoints.pnt -oo Height=Lowest</span></b><span
style="color:#1F497D" lang="EN-US">, for getting the GML
with the lowest Z of each point<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></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">,<o:p></o:p></span></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">,<o:p></o:p></span></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><span
style="color:#1F497D" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">If
it’s correct, perfect. If not, then, which way would be the
appropriate?<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Thanks
and I hope have been clear now :)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" 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="mso-fareast-language:CA" lang="ES">De:</span></b><span
style="mso-fareast-language:CA" lang="ES"> Even Rouault
<a class="moz-txt-link-rfc2396E" 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 class="moz-txt-link-rfc2396E" href="mailto:a.pau@creaf.uab.cat"><a.pau@creaf.uab.cat></a>;
<a class="moz-txt-link-abbreviated" 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<o:p></o:p></span></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
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com" moz-do-not-send="true"
class="moz-txt-link-freetext">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>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>