use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class RecordDefinitionImpl method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, "recordDefinition");
final String path = getPath();
map.put("path", path);
final ClockDirection polygonRingDirection = getPolygonRingDirection();
addToMap(map, "polygonRingDirection", polygonRingDirection, null);
final GeometryFactory geometryFactory = getGeometryFactory();
addToMap(map, "geometryFactory", geometryFactory, null);
final List<FieldDefinition> fields = getFields();
addToMap(map, "fields", fields);
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class FieldDefinition method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, "field");
map.put("name", getName());
map.put("title", getTitle());
addToMap(map, "description", getDescription(), "");
map.put("dataType", getDataType().getName());
map.put("length", getLength());
map.put("scale", getScale());
map.put("required", isRequired());
addToMap(map, "minValue", getMinValue(), null);
addToMap(map, "maxValue", getMaxValue(), null);
addToMap(map, "defaultValue", getDefaultValue(), null);
addToMap(map, "allowedValues", getAllowedValues(), Collections.emptyMap());
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class GeoPackage method newDataSource.
@Override
public DataSource newDataSource(final Map<String, ? extends Object> config) {
final MapEx newConfig = new LinkedHashMapEx(config);
final String url = newConfig.getString("url");
if (Property.hasValue(url) && !url.startsWith("jdbc")) {
try {
final UrlResource resource = new UrlResource(url);
final File file = resource.getFile();
final String newUrl = JDBC_PREFIX + FileUtil.getCanonicalPath(file);
newConfig.put("url", newUrl);
} catch (final Exception e) {
throw new IllegalArgumentException(url + " must be a file", e);
}
}
newConfig.put("enable_load_extension", true);
return JdbcDatabaseFactory.super.newDataSource(newConfig);
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class LasPointCloudHeader method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addToMap(map, "version", this.version);
addToMap(map, "fileSourceId", this.fileSourceId, 0);
addToMap(map, "systemIdentifier", this.systemIdentifier);
addToMap(map, "generatingSoftware", this.generatingSoftware);
addToMap(map, "date", this.date);
if (this.geometryFactory != null) {
final int coordinateSystemId = this.geometryFactory.getCoordinateSystemId();
if (coordinateSystemId > 0) {
addToMap(map, "coordinateSystemId", coordinateSystemId);
}
final CoordinateSystem coordinateSystem = this.geometryFactory.getCoordinateSystem();
if (coordinateSystem != null) {
addToMap(map, "coordinateSystemName", coordinateSystem.getCoordinateSystemName());
addToMap(map, "coordinateSystem", coordinateSystem.toEsriWktCs());
}
}
addToMap(map, "boundingBox", getBoundingBox());
addToMap(map, "headerSize", this.headerSize);
if (this.laszip) {
addToMap(map, "laszip", this.lasZipHeader);
}
addToMap(map, "pointRecordsOffset", this.pointRecordsOffset, 0);
addToMap(map, "pointFormat", this.pointFormat.getId());
addToMap(map, "pointCount", this.pointCount);
int returnCount = 15;
if (this.pointFormat.getId() < 6) {
returnCount = 5;
}
int returnIndex = 0;
final List<Long> pointCountByReturn = new ArrayList<>();
for (final long pointCountForReturn : this.pointCountByReturn) {
if (returnIndex < returnCount) {
pointCountByReturn.add(pointCountForReturn);
}
returnIndex++;
}
addToMap(map, "pointCountByReturn", pointCountByReturn);
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class AbstractGeoreferencedImage method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, "bufferedImage");
final BoundingBox boundingBox = getBoundingBox();
if (boundingBox != null) {
addToMap(map, "boundingBox", boundingBox.toString());
}
final List<MappedLocation> tiePoints = getTiePoints();
addToMap(map, "tiePoints", tiePoints);
return map;
}
Aggregations