Search in sources :

Example 11 with LinkedHashMapEx

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;
}
Also used : GeometryFactory(com.revolsys.geometry.model.GeometryFactory) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) ClockDirection(com.revolsys.geometry.model.ClockDirection)

Example 12 with LinkedHashMapEx

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;
}
Also used : MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 13 with LinkedHashMapEx

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);
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) UrlResource(com.revolsys.spring.resource.UrlResource) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) File(java.io.File)

Example 14 with LinkedHashMapEx

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;
}
Also used : MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) CoordinateSystem(com.revolsys.geometry.cs.CoordinateSystem) ArrayList(java.util.ArrayList) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) LasPoint(com.revolsys.elevation.cloud.las.pointformat.LasPoint)

Example 15 with LinkedHashMapEx

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;
}
Also used : MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) BoundingBox(com.revolsys.geometry.model.BoundingBox) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Aggregations

LinkedHashMapEx (com.revolsys.collection.map.LinkedHashMapEx)39 MapEx (com.revolsys.collection.map.MapEx)38 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)3 Map (java.util.Map)3 BoundingBox (com.revolsys.geometry.model.BoundingBox)2 UrlResource (com.revolsys.spring.resource.UrlResource)2 Component (java.awt.Component)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 PropertyChangeArrayList (com.revolsys.collection.PropertyChangeArrayList)1 MapSerializerMap (com.revolsys.collection.map.MapSerializerMap)1 LasPoint (com.revolsys.elevation.cloud.las.pointformat.LasPoint)1 CoordinateSystem (com.revolsys.geometry.cs.CoordinateSystem)1 ClockDirection (com.revolsys.geometry.model.ClockDirection)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 PathName (com.revolsys.io.PathName)1 Resource (com.revolsys.spring.resource.Resource)1 ValueField (com.revolsys.swing.component.ValueField)1 PasswordField (com.revolsys.swing.field.PasswordField)1