Revision 45425 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/feature/spi/simpleprovider/SimpleSequentialReaderStoreProvider.java
SimpleSequentialReaderStoreProvider.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import java.io.File; |
27 | 27 |
import java.io.IOException; |
28 |
import java.math.BigDecimal; |
|
28 | 29 |
import java.util.ArrayList; |
29 | 30 |
import java.util.HashMap; |
30 | 31 |
import java.util.Iterator; |
... | ... | |
32 | 33 |
import java.util.Locale; |
33 | 34 |
import java.util.Map; |
34 | 35 |
import java.util.Objects; |
36 |
import javax.json.JsonArray; |
|
37 |
import javax.json.JsonObject; |
|
35 | 38 |
|
36 | 39 |
import org.apache.commons.lang3.StringUtils; |
37 | 40 |
import org.cresques.cts.IProjection; |
... | ... | |
79 | 82 |
import org.gvsig.fmap.geom.primitive.Envelope; |
80 | 83 |
import org.gvsig.fmap.geom.primitive.Point; |
81 | 84 |
import org.gvsig.fmap.geom.type.GeometryType; |
85 |
import org.gvsig.json.Json; |
|
86 |
import org.gvsig.json.JsonObjectBuilder; |
|
82 | 87 |
import org.gvsig.tools.ToolsLocator; |
83 | 88 |
import org.gvsig.tools.dataTypes.Coercion; |
84 | 89 |
import org.gvsig.tools.dataTypes.CoercionContext; |
... | ... | |
936 | 941 |
private static final int YNAME = 1; |
937 | 942 |
private static final int ZNAME = 2; |
938 | 943 |
|
939 |
private final GeometryManager geommgr;
|
|
940 |
private final String[] fieldNames;
|
|
941 |
private final Coercion toDouble;
|
|
944 |
private GeometryManager geommgr; |
|
945 |
private String[] fieldNames; |
|
946 |
private Coercion toDouble; |
|
942 | 947 |
private int errorcount = 0; |
943 | 948 |
|
949 |
public PointAttributeEmulator() { |
|
950 |
|
|
951 |
} |
|
952 |
|
|
944 | 953 |
public PointAttributeEmulator(String[] pointDimensionNames) { |
945 | 954 |
if ( pointDimensionNames.length > 2 ) { |
946 | 955 |
this.fieldNames = new String[3]; |
... | ... | |
1029 | 1038 |
return this.fieldNames; |
1030 | 1039 |
} |
1031 | 1040 |
|
1041 |
@Override |
|
1042 |
public JsonObject toJson() { |
|
1043 |
return this.toJsonBuilder().build(); |
|
1044 |
} |
|
1045 |
|
|
1046 |
@Override |
|
1047 |
public JsonObjectBuilder toJsonBuilder() { |
|
1048 |
JsonObjectBuilder builder = Json.createObjectBuilder(); |
|
1049 |
builder.add("fieldNames",fieldNames); |
|
1050 |
builder.add_class(this); |
|
1051 |
return builder; |
|
1052 |
} |
|
1053 |
|
|
1054 |
@Override |
|
1055 |
public void fromJson(JsonObject json) { |
|
1056 |
JsonArray jsonFieldNames = json.getJsonArray("fieldNames"); |
|
1057 |
this.fieldNames = new String[jsonFieldNames.size()]; |
|
1058 |
for (int i = 0; i < jsonFieldNames.size(); i++) { |
|
1059 |
this.fieldNames[XNAME] = jsonFieldNames.getString(i); |
|
1060 |
} |
|
1061 |
this.geommgr = GeometryLocator.getGeometryManager(); |
|
1062 |
DataTypesManager datatypeManager = ToolsLocator.getDataTypesManager(); |
|
1063 |
|
|
1064 |
this.toDouble = datatypeManager.getCoercion(DataTypes.DOUBLE); |
|
1065 |
this.errorcount = 0; |
|
1066 |
} |
|
1067 |
|
|
1032 | 1068 |
} |
1033 | 1069 |
|
1034 | 1070 |
private void loadFeatures() throws IOException, DataException, |
Also available in: Unified diff