<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Sorry, missed the question</p>
<p>You need to create a typemap for "(int nList, GUIntBig* pList)"
that can be mapped to an a long[] in Java. You probably don't care
about the range of uint64_t (GUIntBig is a GDAL specific alias of
uint64_t) that cannot be mapped to a int64_t, so no need to go
with Biginteger[]</p>
<p>Such typemap should be similar to the existing "(int nList, int*
pList)" one</p>
<p>SWIG indeed generates rather dummy SWIGTYPE_p_xxxx types when
there are missing typemaps. When such types appear in the Java API
it means that a typemap is missing</p>
<p>Even<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">Le 07/06/2023 à 18:03, Barry DeZonia a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAKcvfuSpdBunv9m1vrV50-EN2hyBL2+7j1aUtn0bN+84rdH9bQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Thanks Even. I'll look at this later. But you only
answered one of my questions. The type SWIGTYPE_p_GUIntBig is
specified in the Java API for CreateAttribute(). No such thing
is shown in the python tests you showed me. I would suspect
because python has unlimited range integers and an array for
them will work just fine, But this weird SWIG type in Java seems
misplaced. What should the signature be? dimensions as lon[]?
dimensions as Biginteger[]? And if so then why is the current
signature so messy with this SWIG type. If it is supposed to be
this weird SWIG type then how do I create it? The Java api
javadoc does not show it has any useful methods.<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jun 7, 2023 at 3:47 AM
Even Rouault <<a href="mailto:even.rouault@spatialys.com"
moz-do-not-send="true" class="moz-txt-link-freetext">even.rouault@spatialys.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Barry,<br>
<br>
you can't instantiate the objects directly. They are tied to
an <br>
underlying driver.<br>
<br>
You could for example port this subset of those tests of the
MEM driver: <br>
<a
href="https://github.com/OSGeo/gdal/blob/master/autotest/gdrivers/memmultidim.py#L85"
rel="noreferrer" target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://github.com/OSGeo/gdal/blob/master/autotest/gdrivers/memmultidim.py#L85</a>
<br>
and <br>
<a
href="https://github.com/OSGeo/gdal/blob/master/autotest/gdrivers/memmultidim.py#L188"
rel="noreferrer" target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://github.com/OSGeo/gdal/blob/master/autotest/gdrivers/memmultidim.py#L188</a>
<br>
. Note that they test a bit more than just the API, but also
the <br>
implementation of the MEM driver, so you don't need to test
all error <br>
cases for example<br>
<br>
Even<br>
<br>
Le 07/06/2023 à 04:54, Barry DeZonia a écrit :<br>
> Hello,<br>
><br>
> I am trying to extend the Java API so that the MDArray
code is more <br>
> full featured. Right now I am working on extending
Attribute to return <br>
> a Vector<Dimension> when Attribute::GetDimensions()
is called. Much of <br>
> this support is missing and I am in the process of wiring
it up. I am <br>
> starting to write test code to drive development and have
two <br>
> questions about my test code. I am pasting the code below
with <br>
> questions inlined.<br>
><br>
> private static void testGetDimensions() {<br>
><br>
> // QUESTION 1:<br>
> // how do I create a Group programmatically?<br>
><br>
> Group group1 = new Group("universe1"); // NOPE<br>
><br>
> Group group2 = Group.CreateGroup("universe2"); //
NOPE<br>
><br>
> // QUESTION 2:<br>
> // What is a SWIGTYPE_p_GUIntBig?<br>
> // Is this type exposed in MDArray API as a flaw in
the current <br>
> Java API?<br>
> // See API docs for MDArray::CreateAttribute()<br>
><br>
> group1.CreateAttribute("jane",<br>
> 1,<br>
> null, // wants an array
of <br>
> SWIGTYPE_p_GUIntBig<br>
> ExtendedDataType.Create(gdalconst.GDT_UInt16));<br>
><br>
> Attribute attribute = group.GetAttribute("jane");<br>
><br>
> Vector<Dimension> dims =
attribute.GetDimensions();<br>
> }<br>
><br>
> So can anyone answer my two questions? Am I
approaching this right? <br>
> Thanks for any info.<br>
><br>
><br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a><br>
> <a
href="https://lists.osgeo.org/mailman/listinfo/gdal-dev"
rel="noreferrer" target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
-- <br>
<a href="http://www.spatialys.com" rel="noreferrer"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
</blockquote>
</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>