use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class FeatureLayer method newRecordReader.
@Override
public <V extends Record> RecordReader newRecordReader(final RecordFactory<V> recordFactory, final Query query) {
final MapEx queryParameters = new LinkedHashMapEx();
final String resourceId = this.featureSource.getResourceId();
queryParameters.put("RESOURCEID", resourceId);
final String name = this.recordDefinition.getName();
queryParameters.put("CLASSNAME", name);
int offset = 0;
int limit = Integer.MAX_VALUE;
if (query != null) {
offset = query.getOffset();
limit = query.getLimit();
}
return new MapGuideServerFeatureIterator(this, queryParameters, offset, limit, recordFactory);
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class GeometryOperationTest method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
map.put("type", "test");
addToMap(map, "description", this.testDescription);
map.put("propertyName", this.geometryIndex.toLowerCase());
map.put("methodName", this.operation);
final List<Object> arguments = new ArrayList<>();
for (int i = 0; i < this.arguments.size(); i++) {
final Object argument = this.arguments.get(i);
if (argument instanceof String) {
final String string = (String) argument;
if ("a".equalsIgnoreCase(string)) {
arguments.add(Collections.singletonMap("reference", "a"));
} else if ("b".equalsIgnoreCase(string)) {
arguments.add(Collections.singletonMap("reference", "b"));
} else {
arguments.add(argument);
}
} else {
arguments.add(argument);
}
}
addToMap(map, "arguments", arguments, Collections.emptyList());
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class MapSerializer method newTypeMap.
default MapEx newTypeMap(final String type) {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, type);
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class AbstractLayerRenderer method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, this.type);
addToMap(map, "name", this.name);
addToMap(map, "visible", this.visible, true);
addToMap(map, "maximumScale", this.maximumScale, 0);
addToMap(map, "minimumScale", this.minimumScale, Long.MAX_VALUE);
addToMap(map, "open", this.open, false);
return map;
}
use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.
the class AbstractGeoreferencedImage method loadSettings.
protected long loadSettings() {
final Resource resource = getImageResource();
final Resource settingsFile = resource.newResourceAddExtension("rgobject");
if (settingsFile.exists()) {
try {
Map<String, Object> settings;
try {
settings = Json.toMap(settingsFile);
} catch (final Throwable e) {
settings = new LinkedHashMapEx();
}
final String boundingBoxWkt = (String) settings.get("boundingBox");
if (Property.hasValue(boundingBoxWkt)) {
final BoundingBox boundingBox = BoundingBox.newBoundingBox(boundingBoxWkt);
if (!boundingBox.isEmpty()) {
setBoundingBox(boundingBox);
}
}
final List<?> tiePointsProperty = (List<?>) settings.get("tiePoints");
final List<MappedLocation> tiePoints = new ArrayList<>();
if (tiePointsProperty != null) {
for (final Object tiePointValue : tiePointsProperty) {
if (tiePointValue instanceof MappedLocation) {
tiePoints.add((MappedLocation) tiePointValue);
} else if (tiePointValue instanceof Map) {
@SuppressWarnings("unchecked") final Map<String, Object> map = (Map<String, Object>) tiePointValue;
tiePoints.add(new MappedLocation(map));
}
}
}
if (!tiePoints.isEmpty()) {
setTiePoints(tiePoints);
}
return settingsFile.getLastModified();
} catch (final Throwable e) {
Logs.error(this, "Unable to load:" + settingsFile, e);
return -1;
}
} else {
return -1;
}
}
Aggregations