static DBFeatureType getFeatureType(Connection connection, PostgresqlStoreParameters params) throws ReadException { DBFeatureType featureType = new DBFeatureType(); String[] ids = params.getFieldsId(); int i; DBAttributeDescriptor attr; loadFieldsToFeatureType(connection, params, featureType); try { featureType.setFieldsId(ids); } catch (DataException e) { throw new ReadException(PostgresqlStore.DATASTORE_NAME, e); } // Inicializamos los 'serial' ya que en postgres el // 'isAutonumeric' devuelve false // try{ // initializeSerialFields(connection,featureType); // } catch (java.sql.SQLException e) { // throw new InitializeException(PostgresqlStore.DATASTORE_NAME,e); // // } // // Inicializar campos geometricos si los hubiese // TODO Datos geometricos // featureType.setDefaultGeometry(params.getGeometryField()); getTableEPSG_and_shapeType(connection, params, featureType); // Inicializar la geometria por defecto if (params.getDefaultGeometryField() != null && params.getDefaultGeometryField() != "") { if (featureType.getIndex(params.getDefaultGeometryField()) < 0) { throw new InitializeException( PostgresqlStore.DATASTORE_NAME, new Exception("Geometry Field '" + params.getDefaultGeometryField() + "' not Found")); } attr = (DBAttributeDescriptor) featureType.get(params.getDefaultGeometryField()); if (attr.getDataType() != FeatureAttributeDescriptor.GEOMETRY) { throw new InitializeException( PostgresqlStore.DATASTORE_NAME, new Exception("Field '" + params.getDefaultGeometryField() + "' isn't a geometry")); } } featureType.setDefaultGeometry(params.getDefaultGeometryField()); // featureType.setGeometryTypes(new int[]{Geometry.TYPES.GEOMETRY}); return featureType; }