Search in sources :

Example 26 with RecordReader

use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.

the class EpsgCoordinateSystemsLoader method loadAlias.

private void loadAlias() {
    try (final RecordReader reader = newReader("/public/epsg_alias", "alias_code");
        ChannelWriter writer = newWriter("alias")) {
        for (final Record record : reader) {
            writeInt(writer, record, "alias_code");
            writeString(writer, record, "object_table_name");
            writeInt(writer, record, "object_code");
            writeInt(writer, record, "naming_system_code");
            writeString(writer, record, "alias");
        }
    }
}
Also used : RecordReader(com.revolsys.record.io.RecordReader) Record(com.revolsys.record.Record) ChannelWriter(com.revolsys.io.channels.ChannelWriter)

Example 27 with RecordReader

use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.

the class EpsgCoordinateSystemsLoader method loadCoordOperationParamValue.

private void loadCoordOperationParamValue() {
    try (RecordReader reader = newReader("/public/epsg_coordoperationparamvalue");
        ChannelWriter writer = newWriter("coordOperationParamValue")) {
        for (final Record record : reader) {
            writeInt(writer, record, "coord_op_code");
            writeInt(writer, record, "coord_op_method_code");
            writeInt(writer, record, "parameter_code");
            writeDouble(writer, record, "parameter_value");
            writeString(writer, record, "param_value_file_ref");
            writeInt(writer, record, "uom_code", 0);
        }
    }
}
Also used : RecordReader(com.revolsys.record.io.RecordReader) Record(com.revolsys.record.Record) ChannelWriter(com.revolsys.io.channels.ChannelWriter)

Example 28 with RecordReader

use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.

the class EpsgCoordinateSystemsLoader method loadCoordOperationPath.

private void loadCoordOperationPath() {
    try (final RecordReader reader = newReader("/public/epsg_coordoperationpath", "concat_operation_code", "op_path_step");
        ChannelWriter writer = newWriter("coordOperationPath")) {
        for (final Record record : reader) {
            writeInt(writer, record, "concat_operation_code");
            writeInt(writer, record, "single_operation_code");
            writeInt(writer, record, "op_path_step");
        }
    }
}
Also used : RecordReader(com.revolsys.record.io.RecordReader) Record(com.revolsys.record.Record) ChannelWriter(com.revolsys.io.channels.ChannelWriter)

Example 29 with RecordReader

use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.

the class EpsgCoordinateSystemsLoader method loadUnitOfMeasure.

private void loadUnitOfMeasure() throws IOException {
    final Map<Integer, Record> baseUnits = new TreeMap<>();
    final Map<Integer, List<Record>> unitsByBase = new TreeMap<>();
    try (final RecordReader reader = newReader("/public/epsg_unitofmeasure")) {
        for (final Record record : reader) {
            final int code = record.getInteger("uom_code");
            final int baseUnitCode = record.getInteger("target_uom_code");
            if (code == baseUnitCode) {
                baseUnits.put(code, record);
            } else {
                Maps.addToList(unitsByBase, baseUnitCode, record);
            }
        }
    }
    try (ChannelWriter writer = newWriter("unitOfMeasure")) {
        for (final Entry<Integer, Record> entry : baseUnits.entrySet()) {
            final int code = entry.getKey();
            final Record record = baseUnits.get(code);
            loadUnitOfMeasure(unitsByBase, record, writer);
        }
    }
}
Also used : RecordReader(com.revolsys.record.io.RecordReader) Record(com.revolsys.record.Record) List(java.util.List) TreeMap(java.util.TreeMap) ChannelWriter(com.revolsys.io.channels.ChannelWriter)

Example 30 with RecordReader

use of com.revolsys.record.io.RecordReader in project com.revolsys.open by revolsys.

the class EpsgCoordinateSystemsLoader method loadCoordinateSystem.

private void loadCoordinateSystem() throws IOException {
    try (final RecordReader reader = newReader("/public/epsg_coordinatesystem");
        ChannelWriter writer = newWriter("coordinateSystem")) {
        for (final Record record : reader) {
            writeInt(writer, record, "coord_sys_code");
            writeCodeByte(writer, record, "coord_sys_type", CoordinateSystemType.TYPE_NAMES);
            writeDeprecated(writer, record);
        }
    }
}
Also used : RecordReader(com.revolsys.record.io.RecordReader) Record(com.revolsys.record.Record) ChannelWriter(com.revolsys.io.channels.ChannelWriter)

Aggregations

RecordReader (com.revolsys.record.io.RecordReader)43 Record (com.revolsys.record.Record)34 ChannelWriter (com.revolsys.io.channels.ChannelWriter)19 RecordDefinition (com.revolsys.record.schema.RecordDefinition)11 Identifier (com.revolsys.identifier.Identifier)5 ArrayRecord (com.revolsys.record.ArrayRecord)5 ListRecordReader (com.revolsys.record.io.ListRecordReader)5 Query (com.revolsys.record.query.Query)5 HashMap (java.util.HashMap)5 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)4 BaseCloseable (com.revolsys.io.BaseCloseable)4 Transaction (com.revolsys.transaction.Transaction)4 ArrayList (java.util.ArrayList)4 Maps (com.revolsys.collection.map.Maps)3 Ellipsoid (com.revolsys.geometry.cs.Ellipsoid)3 Geometry (com.revolsys.geometry.model.Geometry)3 RecordWriter (com.revolsys.record.io.RecordWriter)3 RecordStore (com.revolsys.record.schema.RecordStore)3 Resource (com.revolsys.spring.resource.Resource)3 LinkedHashMap (java.util.LinkedHashMap)3