Search in sources :

Example 21 with ChannelWriter

use of com.revolsys.io.channels.ChannelWriter 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 22 with ChannelWriter

use of com.revolsys.io.channels.ChannelWriter 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 23 with ChannelWriter

use of com.revolsys.io.channels.ChannelWriter 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 24 with ChannelWriter

use of com.revolsys.io.channels.ChannelWriter 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 25 with ChannelWriter

use of com.revolsys.io.channels.ChannelWriter 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

ChannelWriter (com.revolsys.io.channels.ChannelWriter)27 Record (com.revolsys.record.Record)19 RecordReader (com.revolsys.record.io.RecordReader)19 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)5 HashMap (java.util.HashMap)4 LinkedHashMap (java.util.LinkedHashMap)4 Map (java.util.Map)4 Maps (com.revolsys.collection.map.Maps)3 GeographicCoordinateSystem (com.revolsys.geometry.cs.GeographicCoordinateSystem)2 ParameterName (com.revolsys.geometry.cs.ParameterName)2 ParameterValue (com.revolsys.geometry.cs.ParameterValue)2 LinearUnit (com.revolsys.geometry.cs.unit.LinearUnit)2 BoundingBox (com.revolsys.geometry.model.BoundingBox)2 IOException (java.io.IOException)2 List (java.util.List)2 TreeMap (java.util.TreeMap)2 Ellipsoid (com.revolsys.geometry.cs.Ellipsoid)1 PrimeMeridian (com.revolsys.geometry.cs.PrimeMeridian)1 ProjectedCoordinateSystem (com.revolsys.geometry.cs.ProjectedCoordinateSystem)1 VerticalCoordinateSystem (com.revolsys.geometry.cs.VerticalCoordinateSystem)1