use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystemsLoader method loadCoordinateReferenceSystem.
private void loadCoordinateReferenceSystem() throws IOException {
final Map<Integer, List<Record>> recordByKind = new TreeMap<>();
try (final RecordReader reader = newReader("/public/epsg_coordinatereferencesystem", "coord_ref_sys_code")) {
for (final Record record : reader) {
final String code = record.getValue("coord_ref_sys_kind");
final int kind = COORDINATE_REFERENCE_SYSTEM_TYPES.indexOf(code);
Maps.addToList(recordByKind, kind, record);
}
}
try (ChannelWriter writer = newWriter("coordinateReferenceSystem")) {
for (final List<Record> records : recordByKind.values()) {
for (final Record record : records) {
final int id = writeInt(writer, record, "coord_ref_sys_code");
writeString(writer, record, "coord_ref_sys_name");
writeInt(writer, record, "area_of_use_code");
writeCodeByte(writer, record, "coord_ref_sys_kind", COORDINATE_REFERENCE_SYSTEM_TYPES);
writeInt(writer, record, "coord_sys_code", 0);
writeInt(writer, record, "datum_code", 0);
writeInt(writer, record, "source_geogcrs_code", 0);
writeInt(writer, record, "projection_conv_code", 0);
writeInt(writer, record, "cmpd_horizcrs_code", 0);
writeInt(writer, record, "cmpd_vertcrs_code", 0);
writeDeprecated(writer, record);
}
}
}
}
use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystemsLoader method loadCoordinateAxis.
private void loadCoordinateAxis() {
try (final RecordReader reader = newReader("/public/epsg_coordinateaxis", "coord_sys_code", "coord_axis_order");
ChannelWriter writer = newWriter("coordinateAxis")) {
for (final Record record : reader) {
writeInt(writer, record, "coord_sys_code");
writeInt(writer, record, "coord_axis_name_code");
writeString(writer, record, "coord_axis_orientation");
final String abbreviation = record.getValue("coord_axis_abbreviation");
writer.putByte((byte) abbreviation.charAt(0));
writeInt(writer, record, "uom_code");
}
}
}
use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystemsLoader method loadCoordinateAxisName.
private void loadCoordinateAxisName() {
try (final RecordReader reader = newReader("/public/epsg_coordinateaxisname", "coord_axis_name_code");
ChannelWriter writer = newWriter("coordinateAxisName")) {
for (final Record record : reader) {
writeInt(writer, record, "coord_axis_name_code");
writeString(writer, record, "coord_axis_name");
}
}
}
use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystemsLoader method loadCoordOperationMethod.
private void loadCoordOperationMethod() {
try (RecordReader reader = newReader("/public/epsg_coordoperationmethod");
ChannelWriter writer = newWriter("coordOperationMethod")) {
for (final Record record : reader) {
writeInt(writer, record, "coord_op_method_code");
writeString(writer, record, "coord_op_method_name");
writeByte(writer, record, "reverse_op");
writeDeprecated(writer, record);
}
}
}
use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.
the class EpsgCoordinateSystemsLoader method loadEllipsoid.
private void loadEllipsoid() throws IOException {
try (final RecordReader reader = newReader("/public/epsg_ellipsoid", "ellipsoid_code");
ChannelWriter writer = newWriter("ellipsoid")) {
for (final Record record : reader) {
writeInt(writer, record, "ellipsoid_code");
writeString(writer, record, "ellipsoid_name");
writeInt(writer, record, "uom_code");
writeDouble(writer, record, "semi_minor_axis");
writeDouble(writer, record, "semi_major_axis");
writeDouble(writer, record, "inv_flattening");
writeByte(writer, record, "ellipsoid_shape");
writeDeprecated(writer, record);
}
}
}
Aggregations