Examples of DistanceUnit


Examples of org.mapfish.print.map.DistanceUnit

        double geoWidthInches = this.scale.getDenominator() * paintArea.width / dpi;
        double geoHeightInches = this.scale.getDenominator() * paintArea.height / dpi;

        ReferencedEnvelope bbox;

        final DistanceUnit projectionUnit = DistanceUnit.fromProjection(getProjection());
        if (projectionUnit == DistanceUnit.DEGREES) {
            bbox = computeGeodeticBBox(geoWidthInches, geoHeightInches);
        } else {
            final double centerX = this.center.getOrdinate(0);
            final double centerY = this.center.getOrdinate(1);
View Full Code Here

Examples of org.mapfish.print.map.DistanceUnit

            CoordinateReferenceSystem crs = getProjection();

            GeodeticCalculator calc = new GeodeticCalculator(crs);

            DistanceUnit ellipsoidUnit = DistanceUnit.fromString(calc.getEllipsoid().getAxisUnit().toString());
            double geoWidth = DistanceUnit.IN.convertTo(geoWidthInInches, ellipsoidUnit);
            double geoHeight = DistanceUnit.IN.convertTo(geoHeightInInches, ellipsoidUnit);

            DirectPosition2D directPosition2D = new DirectPosition2D(this.center.x, this.center.y);
            directPosition2D.setCoordinateReferenceSystem(crs);
View Full Code Here

Examples of org.mapfish.print.map.DistanceUnit

        MapBounds bounds = mapParams.getMapBounds();
        bounds = CreateMapProcessor.adjustBoundsToScaleAndMapSize(
                mapParams, mapParams.getRequestorDPI(), paintArea, bounds);
        paintArea.setBounds(0, 0, (int) (paintArea.width * dpiRatio), (int) (paintArea.height * dpiRatio));

        final DistanceUnit mapUnit = getUnit(bounds);
        // to calculate the scale the requestor DPI is used , because the paint area is already adjusted
        final Scale scale = bounds.getScaleDenominator(paintArea, mapParams.getRequestorDPI());

        DistanceUnit scaleUnit = scalebarParams.getUnit();
        if (scaleUnit == null) {
            scaleUnit = mapUnit;
        }

        // adjust scalebar width and height to the DPI value
View Full Code Here

Examples of org.mapfish.print.map.DistanceUnit

                    + ", scale: " + scale.getDenominator() + ")");
            return;
        }

        final ScalebarAttributeValues scalebarParams = settings.getParams();
        final DistanceUnit intervalUnit = bestUnit(scaleUnit, intervalLengthInWorldUnits, scalebarParams.lockUnits);
        final float intervalLengthInPixels = (float) scaleUnit.convertTo(
                intervalLengthInWorldUnits / scale.getDenominator(), DistanceUnit.PX);

        //compute the label positions
        final List<Label> labels = new ArrayList<Label>(scalebarParams.intervals + 1);
View Full Code Here

Examples of org.mapfish.print.map.DistanceUnit

     * @param lockUnits if set, the values are not scaled to a "nicer" unit.
     */
    @VisibleForTesting
    //CSOFF: MagicNumber
    protected final double getNearestNiceValue(final double value, final DistanceUnit scaleUnit, final boolean lockUnits) {
        DistanceUnit bestUnit = bestUnit(scaleUnit, value, lockUnits);
        double factor = scaleUnit.convertTo(1.0, bestUnit);

        // nearest power of 10 lower than value
        int digits = (int) Math.floor((Math.log(value * factor) / Math.log(10)));
        double pow10 = Math.pow(10, digits);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.