Determine which math transform to use when creating the coordinate of the label.

@param mapCrs the crs of the map, used if the {@link #labelProjection} is not defined.
513751
public MathTransform calculateLabelTransform(final CoordinateReferenceSystem mapCrs) {
        MathTransform labelTransform;
        if (this.labelProjection != null) {
            try {
                labelTransform = CRS.findMathTransform(mapCrs, this.labelCRS, true);
            } catch (FactoryException e) {
                throw new RuntimeException(e);
            }
        } else {
            labelTransform = IdentityTransform.create(2);
        }

        return labelTransform;
    }
836659
@Override
	public void setSecondAxis(Vector3D axis, double extent) {
		setSecondAxis(axis.getX(), axis.getY(), axis.getZ(), extent);
	}
901186
@Override
	public void setSecondAxis(double x, double y, double z, double extent, CoordinateSystem3D system) {
		this.axis2.set(x, y, z);
		assert(this.axis2.isUnitVector());
		if (system.isLeftHanded()) {
			this.axis3.set(this.axis1.crossLeftHand(this.axis2));
		} else {
			this.axis3.set(this.axis3.crossRightHand(this.axis2));
		}
		this.extent2 = extent;
	}
886375
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "GeographicCRS", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_CoordinateReferenceSystem")
    public JAXBElement<GeographicCRSType> createGeographicCRS(GeographicCRSType value) {
        return new JAXBElement<GeographicCRSType>(_GeographicCRS_QNAME, GeographicCRSType.class, null, value);
    }
597869
public void setCropFormat(String cropFormat) {

        boolean visible = (cropFormat != null);
        if (cropFormat == null) {
            cropFormat = "";
        }
        m_labelCropFormat.setVisible(visible);
        m_removeCrop.setVisible(visible);
        m_displayCropFormat.setText(cropFormat);
    }
1221029
protected void defineSmallRectangles(ZoomableGraphicsContext gc, T element) {
		final double ptsSize = element.getPointSize() / 2.;
		final Rectangle2afp<?, ?, ?, ?, ?, ?> visibleArea = gc.getVisibleArea();
		for (final Point2d point : element.points()) {
			if (visibleArea.contains(point)) {
				final double x = point.getX() - ptsSize;
				final double y = point.getY() - ptsSize;
				final double mx = point.getX() + ptsSize;
				final double my = point.getY() + ptsSize;
				gc.moveTo(x, y);
				gc.lineTo(mx, y);
				gc.lineTo(mx, my);
				gc.lineTo(x, my);
				gc.closePath();
			}
		}
	}
725416
def transform(self, crs):
        
        new_crs = CRS(crs)

        geometry = self.geometry
        if new_crs is not self.crs:
            project = functools.partial(pyproj.transform, self.crs.projection(), new_crs.projection())
            geometry = shapely.ops.transform(project, geometry)

        return Geometry(geometry, crs=new_crs)
456229
protected void defineSmallRectangle(ZoomableGraphicsContext gc, T element) {
		final double ptsSize = element.getPointSize() / 2.;
		final double x = element.getX() - ptsSize;
		final double y = element.getY() - ptsSize;
		final double mx = element.getX() + ptsSize;
		final double my = element.getY() + ptsSize;
		gc.moveTo(x, y);
		gc.lineTo(mx, y);
		gc.lineTo(mx, my);
		gc.lineTo(x, my);
		gc.closePath();
	}
878780
void computeProjectionTable( int width , int height ) {
		output.reshape(width,height);
		depthMap.reshape(width,height);

		ImageMiscOps.fill(depthMap,-1);

		pointing = new float[width*height*3];

		for (int y = 0; y < output.height; y++) {
			for (int x = 0; x < output.width; x++) {
				// Should this add 0.5 so that the ray goes out of the pixel's center? Seems to increase reprojection
				// error in calibration tests if I do...
				pixelTo3.compute(x, y, p3);
				if(UtilEjml.isUncountable(p3.x)) {
					depthMap.unsafe_set(x,y,Float.NaN);
				} else {
					pointing[(y*output.width+x)*3   ] = (float)p3.x;
					pointing[(y*output.width+x)*3+1 ] = (float)p3.y;
					pointing[(y*output.width+x)*3+2 ] = (float)p3.z;
				}
			}
		}
	}
178156
public static synchronized void initializeDXF_SCHEMA( CoordinateReferenceSystem crs ) {
        if (DXF_POINTSCHEMA != null && DXF_POINTSCHEMA.getAttributeCount() != 0)
            return;

        SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
        b.setName("dxfpointfile");
        b.setCRS(crs);
        b.add("the_geom", Point.class);
        b.add("LAYER", String.class);
        b.add("LTYPE", String.class);
        b.add("ELEVATION", Double.class);
        b.add("THICKNESS", Double.class);
        b.add("COLOR", Integer.class);
        b.add("TEXT", String.class);
        b.add("TEXT_HEIGHT", Double.class);
        b.add("TEXT_STYLE", String.class);
        DXF_POINTSCHEMA = b.buildFeatureType();

        b = new SimpleFeatureTypeBuilder();
        b.setName("dxflinefile");
        b.setCRS(crs);
        b.add("the_geom", LineString.class);
        b.add("LAYER", String.class);
        b.add("LTYPE", String.class);
        b.add("ELEVATION", Double.class);
        b.add("THICKNESS", Double.class);
        b.add("COLOR", Integer.class);
        b.add("TEXT", String.class);
        b.add("TEXT_HEIGHT", Double.class);
        b.add("TEXT_STYLE", String.class);
        DXF_LINESCHEMA = b.buildFeatureType();

        b = new SimpleFeatureTypeBuilder();
        b.setName("dxfpolygonfile");
        b.setCRS(crs);
        b.add("the_geom", Polygon.class);
        b.add("LAYER", String.class);
        b.add("LTYPE", String.class);
        b.add("ELEVATION", Double.class);
        b.add("THICKNESS", Double.class);
        b.add("COLOR", Integer.class);
        b.add("TEXT", String.class);
        b.add("TEXT_HEIGHT", Double.class);
        b.add("TEXT_STYLE", String.class);
        DXF_POLYGONSCHEMA = b.buildFeatureType();

    }
963220
public GeoShapeMapper transform(GeoTransformation... transformations) {
        if (this.transformations == null) {
            this.transformations = Arrays.asList(transformations);
        } else {
            this.transformations.addAll(Arrays.asList(transformations));
        }
        return this;
    }
1336077
public BaseGrid setAxisLabel(String... axisLabels) {
        if (axisLabels.length != base.getDimension()) {
            throw new IllegalArgumentException("Axis label size don't match base dimension.");
        }

        for (int i = 0; i < axisLabels.length; i++) {
            axis[i].setAxisLabel(axisLabels[i]);
        }

        return this;
    }
558495
public static void topBorderLabel(
            final LabelPositionCollector labels, final GeometryFactory geometryFactory,
            final Polygon rotatedBounds, final String unit, final double x,
            final AffineTransform worldToScreenTransform,
            final MathTransform toLabelProjection,
            final GridLabelFormat labelFormat) {
        Envelope envelopeInternal = rotatedBounds.getEnvelopeInternal();
        LineString lineString = geometryFactory.createLineString(new Coordinate[]{
                new Coordinate(x, envelopeInternal.centre().y),
                new Coordinate(x, envelopeInternal.getMaxY())
        });
        Geometry intersections = lineString.intersection(rotatedBounds.getExteriorRing());

        if (intersections.getNumPoints() > 0) {
            Coordinate borderIntersection = intersections.getGeometryN(0).getCoordinates()[0];
            double[] screenPoints = new double[2];
            worldToScreenTransform
                    .transform(new double[]{borderIntersection.x, borderIntersection.y}, 0, screenPoints, 0,
                               1);

            double[] labelProj = transformToLabelProjection(toLabelProjection, borderIntersection);
            labels.add(new GridLabel(createLabel(labelProj[0], unit, labelFormat), (int) screenPoints[0],
                                     (int) screenPoints[1], TOP));
        }
    }
187598
public void setMappings(List<String> mappings) {
        if (mappings.size() > 0) {
            @SuppressWarnings("unchecked") Pair<String, String>[] renames = (Pair<String, String>[])Array.newInstance(Pair.class, mappings.size());
            for (int i = 0; i < _renames.length; ++i) {
                String[] names = mappings.get(i).split("[ ,]+");
                renames[i] = new Pair<String, String>(names[0], names[1]);
            }
            _renames = renames;
        }
    }
221706
private void addXLabels(XAxis xAxis, Number min, Number max, boolean showYLabels) {
        xAxis.setOffset(false);
        YRange v = setAxisRange(xAxis, 0, max);
        if (!showYLabels) {
        	xAxis.setLabels("");
        } else {
        	xAxis.getLabels().setColour(getHexColor(chart.getYColor()));
        	// add orientation ? (we have only for x axis in layout)
        }
    }
1181077
protected void setMapClass(Class mapClass)
    {
        //
        // If the provided map class is a ControlBean type, then locate associated control
        // interface or extension that defines properties.
        //
        if (ControlBean.class.isAssignableFrom(mapClass))
        {
            Class [] intfs = mapClass.getInterfaces();
            for (int i = 0; i < intfs.length; i++)
            {
                if (intfs[i].isAnnotationPresent(ControlInterface.class) ||
                    intfs[i].isAnnotationPresent(ControlExtension.class))
                {
                    mapClass = intfs[i];
                    break;
                }
            }
        }
        else
        {
            if (!mapClass.isAnnotation() &&
                !mapClass.isAnnotationPresent(ControlInterface.class) &&
                !mapClass.isAnnotationPresent(ControlExtension.class))
                throw new IllegalArgumentException(mapClass+" must be Control or annotation type");
        }

        _mapClass = mapClass;
    }
966742
public void setMapSize(int mapWidth, int mapHeight) {
		double x = horizontalMargin;
		double y = verticalMargin;

		// Calculate horizontal position:
		switch (alignment) {
			case LEFT:
				break;
			case CENTER:
				x = Math.round((mapWidth - width) / 2);
				break;
			case RIGHT:
				x = mapWidth - width - horizontalMargin;
		}

		// Calculate vertical position:
		switch (verticalAlignment) {
			case TOP:
				break;
			case CENTER:
				y = Math.round((mapHeight - height) / 2);
				break;
			case BOTTOM:
				y = mapHeight - height - verticalMargin;
		}

		upperLeftCorner = new Coordinate(x, y);
	}