Package models.csv

Examples of models.csv.CodePointOpenCsvEntry


    }

    @Override
    public void onReceive(Object message) {
        if (message instanceof CodePointOpenCsvEntry) {
            CodePointOpenCsvEntry entry = (CodePointOpenCsvEntry) message;

            PostcodeUnit unit = new PostcodeUnit(CharMatcher.WHITESPACE.removeFrom(entry.getPostcode()));
            unit.pqi = entry.getPositionalQualityIndicator();

            try {
                int eastings = Integer.parseInt(entry.getEastings());
                int northings = Integer.parseInt(entry.getNorthings());

                unit.cartesianLocation = new CartesianLocation(eastings, northings);

                final TimerContext latLongCtx = latLongTransform.time();
                try {
                    DirectPosition eastNorth = new GeneralDirectPosition(eastings, northings);
                    DirectPosition latLng = osgbToWgs84Transform.transform(eastNorth, eastNorth);

                    unit.location = new Location(round(latLng.getOrdinate(1), 8), round(latLng.getOrdinate(0), 8));
                } finally {
                    latLongCtx.stop();
                }
            } catch (NumberFormatException e) {
                throw new RuntimeException("NumberFormatException parsing easting/northings '" + entry.getEastings() + ", " + entry.getNorthings() + "'.");
            } catch (TransformException e) {
                throw Throwables.propagate(e);
            }

            final TimerContext saveCtx = savePostcodeUnit.time();
View Full Code Here

TOP

Related Classes of models.csv.CodePointOpenCsvEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.