use of com.revolsys.geometry.cs.CoordinateSystemType in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystems method loadCoordinateSystem.
private static void loadCoordinateSystem() {
try (ChannelReader reader = newChannelReader("coordinateSystem")) {
while (true) {
final int id = reader.getInt();
final int type = reader.getByte();
final boolean deprecated = readBoolean(reader);
final CoordinateSystemType coordinateSystemType = new CoordinateSystemType(id, type, deprecated);
COORDINATE_SYSTEM_TYPE_BY_ID.put(id, coordinateSystemType);
}
} catch (final NoSuchResourceException e) {
} catch (final WrappedException e) {
if (Exceptions.isException(e, EOFException.class)) {
} else {
throw e;
}
}
}
use of com.revolsys.geometry.cs.CoordinateSystemType in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystems method loadCoordinateReferenceSystem.
private static void loadCoordinateReferenceSystem(final IntHashMap<List<Axis>> axisMap) {
try (ChannelReader reader = newChannelReader("coordinateReferenceSystem")) {
while (true) {
final int id = reader.getInt();
final String name = reader.getStringUtf8ByteCount();
final Area area = readCode(reader, AREA_BY_ID);
final int type = reader.getByte();
final CoordinateSystemType coordinateSystemType = readCode(reader, COORDINATE_SYSTEM_TYPE_BY_ID);
final Datum datum = readCode(reader, DATUM_BY_ID);
final CoordinateSystem sourceCoordinateSystem = readCode(reader, COORDINATE_SYSTEM_BY_ID);
final CoordinateOperation operation = readCode(reader, OPERATION_BY_ID);
final CoordinateSystem horizontalCoordinateSystem = readCode(reader, COORDINATE_SYSTEM_BY_ID);
final VerticalCoordinateSystem verticalCoordinateSystem = (VerticalCoordinateSystem) readCode(reader, COORDINATE_SYSTEM_BY_ID);
final boolean deprecated = readBoolean(reader);
final List<Axis> axis;
if (coordinateSystemType == null) {
axis = null;
} else {
axis = axisMap.get(coordinateSystemType.getId());
}
CoordinateSystem coordinateSystem = null;
if (type == 0) {
// geocentric
coordinateSystem = newCoordinateSystemGeocentric(id, name, datum, axis, area, deprecated);
} else if (type == 1) {
// geographic 3D
coordinateSystem = new GeographicCoordinateSystem(id, name, (GeodeticDatum) datum, axis, area, sourceCoordinateSystem, operation, deprecated);
} else if (type == 2) {
// geographic 2D
coordinateSystem = new GeographicCoordinateSystem(id, name, (GeodeticDatum) datum, axis, area, sourceCoordinateSystem, operation, deprecated);
} else if (type == 3) {
// projected
coordinateSystem = newCoordinateSystemProjected(id, name, area, sourceCoordinateSystem, operation, axis, deprecated);
} else if (type == 4) {
// engineering
coordinateSystem = new EngineeringCoordinateSystem(id, name, (EngineeringDatum) datum, axis, area, deprecated);
} else if (type == 5) {
// vertical
coordinateSystem = new VerticalCoordinateSystem(id, name, (VerticalDatum) datum, axis, area, deprecated);
} else if (type == 6) {
coordinateSystem = new CompoundCoordinateSystem(id, name, horizontalCoordinateSystem, verticalCoordinateSystem, area, deprecated);
} else {
coordinateSystem = null;
}
addCoordinateSystem(coordinateSystem);
}
} catch (final NoSuchResourceException e) {
} catch (final WrappedException e) {
if (Exceptions.isException(e, EOFException.class)) {
} else {
throw e;
}
}
}
Aggregations