How to save shp & dbf from an EsriPlugin?

From: Bart Jourquin <bart.jourquin@fucam.ac.be>
Date: Thu Oct 10 2002 - 06:01:31 EDT

Hi all,

I derived my own class from EsriPlugin, which allows to add, delete or
modify shapes and their associated dbf records.

Now, what is the best way to commit my changes to the relevant files?

Attempt 1 :
---------------
I modified the EsriShapeExport file in order to only save .shp and .shx
files. The changes in the .dbf file are then commited through sql
statements (jdbc). This works OK as long as no new shapes are added, in
which case EsriPlugin causes an exception when the mouse moves over a
shape (popup):

java.lang.NumberFormatException: empty String
java.lang.IllegalArgumentException: Cannot set a null TableModel
    at javax.swing.JTable.setModel(JTable.java:2695)

Attempt2 :
--------------
I would like to use a solution that is close to the first attemps for
performance reasons (just commit what is needed in the .dbf, instead of
streaming the whole stuff), but I tried the original EsriShapeExport.

My code :
if (_dirtyShp) {
      getEsriGraphicList().setTable(getModel());
      EsriShapeExport esriShapeExport = new
EsriShapeExport(getEsriGraphicList(), proj, _tablePath+"/"+_tableName);
      esriShapeExport.export();
      _dirtyShp = false;
    }
Doing this, the associated .dbf file has the correct table model, but
all the records are set to the content of the first one....

So, what did I miss?

Many thanks

b.

-- 
Prof Dr Bart Jourquin
F.U.Ca.M. - G.T.M.
Chaussée de Binche, 151a
B7000 Belgium
Tel. : +32 65 323293
Fax. : +32 65 315691
http://message.fucam.ac.be/~jourquin
--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Oct 10 06:09:10 2002

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT