I just had a look at the package com.vividsolutions.jump.feature.AttributeType and found:
/** For long values (64-bit) */ public final static AttributeType INTEGER = new AttributeType("INTEGER", Integer.class); The comment is at odds with the type, and I can't see why ShapeFileWriter allocates 16 bytes if all we can store is an Integer. If we were to store a Long it would take 20 bytes (-9,223,372,036,854,775,808). if (columnType == AttributeType.INTEGER) { fields[f] = new DbfFieldDef(columnName, 'N', 16, 0); f++; } else if (columnType == AttributeType.DOUBLE) { fields[f] = new DbfFieldDef(columnName, 'N', 33, 16); f++; } We should be able to reduce the allocation to 11 for Integers (-2,147,483,648). To follow the GDAL/ORG lead (http://www.gdal.org/ogr/drv_shapefile.html): - Integer fields without an explicit width are treated as width 11. - Real (floating point) fields without an explicit width are treated as width 24 with 15 decimal places of precision Unfortunately this would not help with Michele's problem, but it would make smaller dbf files. regards, Larry On Tue, May 18, 2010 at 9:05 AM, <totenfe...@email.it> wrote: > Hi Stefan, > i'm sorry if i wasn't clear enough. The first row af a dbf file > describes the content of each > column. For an area field we can have "AREA,N,6" and 6 is what i mean as > field size. > I need to change this value from the standard "16" that openjump uses. > Thanks! > Michele > > > Hei, > > > > I would say "no" - but I am also not sure if I understand correctly > > what you mean by "length of a integer field". > > > > stefan > > > > Totenfeier wrote: > >> Hi all! > >> i'm a fellow worker of Politecnico di Milano and i'm working on a > >> project that need to manage field length of a shapefile. > >> Notably i have to set different dimension of integer fields in a dbf > >> file. > >> I'm wondering if this is possible with Openjump now or somebody is > >> working on that. > >> Thanks! > >> > > > > -- > Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP > autenticato? GRATIS solo con Email.it http://www.email.it/f > > Sponsor: > Conto Arancio ti regala 50 Euro da spendere su Media World on line. Cosa > aspetti, aprilo subito! > Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=10036&d=18-5 > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel >
------------------------------------------------------------------------------
_______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel