MCPcopy Create free account
hub / github.com/OSGeo/gdal / main

Method main

swig/java/apps/OGRTest.java:18–30  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

16public class OGRTest
17{
18 public static void main(String[] args) throws Exception
19 {
20 ogr.RegisterAll();
21 DataSource poDS = ogr.Open("tmp_test/iso_8859_1.csv", false);
22 Layer lyr = poDS.GetLayer(0);
23 FieldDefn fld_defn = lyr.GetLayerDefn().GetFieldDefn(1);
24 String got = fld_defn.GetName();
25 if (!got.equals("field_"))
26 throw new Exception("Got '" + got + "'");
27 byte[] byteArray = fld_defn.GetNameAsByteArray();
28 if(!Arrays.equals(byteArray, new byte[]{'f', 'i', 'e', 'l', 'd', '_', 0xE9 - 256, 'x'}))
29 throw new Exception("GetNameAsByteArray() returned unexpected content of size " + byteArray.length);
30 }
31}

Callers

nothing calls this directly

Calls 5

OpenMethod · 0.45
GetLayerMethod · 0.45
GetFieldDefnMethod · 0.45
GetLayerDefnMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected