1

I need to create a shape file with custom attribues. Particularly my problem is about Double that is write like Number,33,31 and I need Number,10,3.

I'm using SimpleFeatureTypeBuilder for create the fields definitions an to method buildFeatureType() for build it.

Is there any chance to do it with org.geotools?

    SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
    builder.setName("Location");

    builder.setCRS(DefaultGeographicCRS.WGS84);
    java.lang.Class<?> colClass = java.lang.Class.forName(geometryClass);
    builder.add("the_geom", colClass);
    for (Entry<String, java.lang.Class<?>> m : map.entrySet()) {

        if (!GeometryConverter.isGeometryType(m.getValue().getClass())) {
            builder.add(m.getKey(), m.getValue());
        }

    }
    // build the type
    final SimpleFeatureType LOCATION = builder.buildFeatureType();
    return LOCATION;
Jagadesh
  • 2,104
  • 1
  • 16
  • 28

1 Answers1

0

No, looking at the code shows the sizes to be hardcoded into the DataStoreFactory.

I guess if you absolutely have to change the format you could override createDbaseHeader to do so but it seems like a lot of work for no real benefit.

Ian Turton
  • 10,018
  • 1
  • 28
  • 47