0

I am working on a s57 map reader using BBN Technologies' OpenMap TM package. I want my program to fully red the map, and to let the user draw on the map and save the drawing. I used gdal ogr2ogr to convert from ".000" format to ".shp" files. My problem is that I cannot read the depths from the generated "SOUNDG.dbf" file. I am reading the "SOUNDG.shp" file, but not it's associated depths. I worked on the openmap example, by modifying the proprieties file. I also want to work on the program programmatically. I also want to customize the menus, but I am struggling understanding the workflow imposed by the openmap library. Can you point me out to a good tutorial, or example, or at least tell me how to read the depth values and associate them to the soundings pointws? Thank!

sergium
  • 1
  • 1

1 Answers1

0

For OpenMap, the dbf file is going to be read by the DbfTableModel object. You'll end up with a DbfTableModel object containing a set of records (rows) with a list of values (each representing a value in a column). You can find out column information from the DbfTableModel.

The order of the records in the DbfTableModel are going to match the order of the EsriGraphics contained in the EsriGraphicList created from the shp file. You use the index of each to cross-reference the other.

If you just create the EsriGraphicList with the getEsriGraphicList static method, it'll search for the dbf file and store the DbfTableModel object in the EsriGraphicList attributes under the DBF_ATTRIBUTE key:

DbfTableModel dbf = (DbfTableModel) esriGraphicList.getAttribute(DBF_ATTRIBUTE);

You can also use methods to read the dbf directly using the DbfTableModel.