use of com.revolsys.collection.map.MapEx 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.MapEx in project com.revolsys.open by revolsys.
the class CreateIndex method main.
public static void main(final String[] args) {
SymbolLibrary.findSymbol("maki/police");
final Resource makiFile = new UrlResource("https://www.mapbox.com/maki/www/maki.json");
final List<MapEx> symbolList = Json.toMapList(makiFile);
final SymbolLibrary symbolLibrary = new SymbolLibrary("maki", "Maki");
for (final MapEx symbolMap : symbolList) {
final String name = "maki/" + symbolMap.getString("icon");
final String title = symbolMap.getString("name");
symbolLibrary.addSymbolSvg(name, title);
}
final File symbolLibraryFile = new File("src/main/resources/META-INF/com.revolsys.swing.map.symbol.SymbolLibrary.json");
MapObjectFactory.write(symbolLibraryFile, symbolLibrary);
final SymbolLibrary symbolLibrary2 = MapObjectFactory.toObject(symbolLibraryFile);
}
use of com.revolsys.collection.map.MapEx 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.MapEx in project com.revolsys.open by revolsys.
the class LasPoint0Core method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
addToMap(map, "intensity", this.intensity, 0);
addToMap(map, "returnNumber", getReturnNumber(), 0);
addToMap(map, "numberOfReturns", getNumberOfReturns(), 0);
addToMap(map, "scanDirectionFlag", isScanDirectionFlag(), false);
addToMap(map, "edgeOfFlightLine", isEdgeOfFlightLine(), false);
addToMap(map, "classification", getClassification());
addToMap(map, "synthetic", isSynthetic(), false);
addToMap(map, "keyPoint", isKeyPoint(), false);
addToMap(map, "withheld", isWithheld(), false);
addToMap(map, "scanAngle", this.scanAngleRank, 0);
addToMap(map, "userData", this.userData, 0);
addToMap(map, "pointSourceID", this.pointSourceID, 0);
addToMap(map, "scannerChannel", this.scannerChannel, 0);
return map;
}
use of com.revolsys.collection.map.MapEx in project com.revolsys.open by revolsys.
the class LasPoint10GpsTimeRgbNirWavePackets method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
addToMap(map, "wavePacketDescriptorIndex", this.wavePacketDescriptorIndex);
addToMap(map, "byteOffsetToWaveformData", this.byteOffsetToWaveformData);
addToMap(map, "waveformPacketSizeInBytes", this.waveformPacketSizeInBytes);
addToMap(map, "returnPointWaveformLocation", this.returnPointWaveformLocation);
addToMap(map, "xT", this.xT);
addToMap(map, "yT", this.yT);
addToMap(map, "zT", this.zT);
return map;
}
Aggregations