|
|
@@ -53,20 +53,22 @@ public class CockpitFacilityGeometryService {
|
|
|
features.add(feature("pipe_network_base", network.getNetworkId(), network.getNetworkCode(),
|
|
|
network.getNetworkName(), industry == null ? "UNKNOWN" : industry,
|
|
|
CockpitPipeNetworkType.typeCodeOf(network.getNetworkType()), network.getNetworkType(),
|
|
|
- null, network.getNetworkId(), "LineString", Arrays.asList(
|
|
|
+ "DRAINAGE".equals(industry) && (network.getNetworkLevel() == null || network.getNetworkLevel().trim().isEmpty())
|
|
|
+ ? "0" : network.getNetworkLevel(),
|
|
|
+ null, network.getNetworkId(), network.getDiameter(), network.getRemark(), "LineString", Arrays.asList(
|
|
|
pair(network.getStartLongitude(), network.getStartLatitude()),
|
|
|
pair(network.getEndLongitude(), network.getEndLatitude()))));
|
|
|
}
|
|
|
for (GasPipePoint point : Objects.requireNonNull(gasPoints.list())) {
|
|
|
features.add(feature("gas_pipe_point", String.valueOf(point.getPointId()), point.getPointCode(),
|
|
|
- point.getPointName(), "GAS", "GAS_PIPE_POINT", null, point.getPointType(),
|
|
|
- point.getNetworkId(), "Point",
|
|
|
+ point.getPointName(), "GAS", "GAS_PIPE_POINT", null, null, point.getPointType(),
|
|
|
+ point.getNetworkId(), point.getDiameter(), null, "Point",
|
|
|
Collections.singletonList(pair(point.getLongitude(), point.getLatitude()))));
|
|
|
}
|
|
|
for (ManholeBase manhole : Objects.requireNonNull(manholes.list())) {
|
|
|
features.add(feature("manhole_base", manhole.getManholeId(), manhole.getManholeCode(),
|
|
|
- manhole.getManholeName(), "MANHOLE", "MANHOLE", null, null,
|
|
|
- manhole.getNetworkId(), "Point",
|
|
|
+ manhole.getManholeName(), "MANHOLE", "MANHOLE", null, null, null,
|
|
|
+ manhole.getNetworkId(), null, null, "Point",
|
|
|
Collections.singletonList(pair(manhole.getLongitude(), manhole.getLatitude()))));
|
|
|
}
|
|
|
List<Coverage> coverage = new ArrayList<>();
|
|
|
@@ -94,7 +96,7 @@ public class CockpitFacilityGeometryService {
|
|
|
}
|
|
|
|
|
|
private static Feature feature(String source, String sourceId, String code, String name, String industry,
|
|
|
- String typeCode, String networkType, String pointType, String networkId, String geometryType,
|
|
|
+ String typeCode, String networkType, String networkLevel, String pointType, String networkId, BigDecimal diameter, String remark, String geometryType,
|
|
|
List<List<BigDecimal>> coordinates) {
|
|
|
List<CockpitCoordinateValidation> validations = coordinates.stream()
|
|
|
.map(pair -> validate(pair.get(0), pair.get(1)))
|
|
|
@@ -105,8 +107,8 @@ public class CockpitFacilityGeometryService {
|
|
|
// Invalid GeoJSON coordinates cannot be represented as an empty or invented geometry.
|
|
|
Geometry geometry = "INVALID".equals(overall.getState()) ? null : new Geometry(geometryType,
|
|
|
"Point".equals(geometryType) ? coordinates.get(0) : coordinates);
|
|
|
- Properties properties = new Properties(source, sourceId, code, name, industry, typeCode, networkType,
|
|
|
- pointType, networkId, coordinates, overall, validations);
|
|
|
+ Properties properties = new Properties(source, sourceId, code, name, industry, typeCode, networkType, networkLevel,
|
|
|
+ pointType, networkId, diameter, remark, coordinates, overall, validations);
|
|
|
return new Feature(source + ":" + sourceId, geometry, properties);
|
|
|
}
|
|
|
|