[gdal-dev] Two questions about Java API

Barry DeZonia bdezonia at gmail.com
Tue Jun 6 19:54:19 PDT 2023


Hello,

I am trying to extend the Java API so that the MDArray code is more full
featured. Right now I am working on extending Attribute to return a
Vector<Dimension> when Attribute::GetDimensions() is called. Much of this
support is missing and I am in the process of wiring it up. I am starting
to write test code to drive development and have two questions about my
test code. I am pasting the code below with questions inlined.

private static void testGetDimensions() {

    // QUESTION 1:
    // how do I create a Group programmatically?

    Group group1 = new Group("universe1");  // NOPE

    Group group2 = Group.CreateGroup("universe2");  // NOPE

    // QUESTION 2:
    // What is a SWIGTYPE_p_GUIntBig?
    //  Is this type exposed in MDArray API as a flaw in the current Java
API?
    //  See API docs for MDArray::CreateAttribute()

    group1.CreateAttribute("jane",
                                1,
                                null,  // wants an array of
SWIGTYPE_p_GUIntBig

ExtendedDataType.Create(gdalconst.GDT_UInt16));

    Attribute attribute = group.GetAttribute("jane");

    Vector<Dimension> dims = attribute.GetDimensions();
}

So can anyone answer my two questions? Am I approaching this right? Thanks
for any info.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230606/865edc91/attachment.htm>


More information about the gdal-dev mailing list