use of com.revolsys.geometry.cs.AxisName in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystems method loadCoordinateAxis.
private static IntHashMap<List<Axis>> loadCoordinateAxis() {
final IntHashMap<List<Axis>> axisesByCoordinateSystemId = new IntHashMap<>();
try (ChannelReader reader = newChannelReader("coordinateAxis")) {
while (true) {
final int coordinateSystemId = reader.getInt();
final AxisName axisName = readCode(reader, AXIS_NAMES);
final String orientation = reader.getStringUtf8ByteCount();
final Character abbreviation = (char) reader.getByte();
final UnitOfMeasure unitOfMeasure = readCode(reader, UNIT_BY_ID);
final Axis axis = new Axis(axisName, orientation, abbreviation.toString(), unitOfMeasure);
List<Axis> axises = axisesByCoordinateSystemId.get(coordinateSystemId);
if (axises == null) {
axises = new ArrayList<>();
axisesByCoordinateSystemId.put(coordinateSystemId, axises);
}
axises.add(axis);
}
} catch (final NoSuchResourceException e) {
} catch (final WrappedException e) {
if (Exceptions.isException(e, EOFException.class)) {
} else {
throw e;
}
}
return axisesByCoordinateSystemId;
}
use of com.revolsys.geometry.cs.AxisName in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystems method loadCoordinateAxisNames.
private static void loadCoordinateAxisNames() {
try (ChannelReader reader = newChannelReader("coordinateAxisName")) {
while (true) {
final int code = reader.getInt();
final String name = reader.getStringUtf8ByteCount();
final AxisName axisName = new AxisName(code, name);
AXIS_NAMES.putInt(code, axisName);
AXIS_NAME_BY_NAME.put(name.toLowerCase(), axisName);
}
} catch (final NoSuchResourceException e) {
} catch (final WrappedException e) {
if (Exceptions.isException(e, EOFException.class)) {
} else {
throw e;
}
}
}
Aggregations