Codota Logo
CRS.getMapProjection
Code IndexAdd Codota to your IDE (free)

How to use
getMapProjection
method
in
org.geotools.referencing.CRS

Best Java code snippets using org.geotools.referencing.CRS.getMapProjection (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: geotools/geotools

  public ProjectionHandler getHandler(
      ReferencedEnvelope renderingEnvelope,
      CoordinateReferenceSystem sourceCrs,
      boolean wrap,
      int maxWraps)
      throws FactoryException {
    if (renderingEnvelope == null) {
      return null;
    }
    MapProjection mapProjection =
        CRS.getMapProjection(renderingEnvelope.getCoordinateReferenceSystem());
    if (mapProjection instanceof WorldVanDerGrintenI) {
      ReferencedEnvelope validArea =
          new ReferencedEnvelope(
              -Integer.MAX_VALUE,
              Integer.MAX_VALUE,
              -90,
              90,
              DefaultGeographicCRS.WGS84);

      return new ProjectionHandler(sourceCrs, validArea, renderingEnvelope);
    }

    return null;
  }
}
origin: geotools/geotools

public void testGetMapProjection() throws Exception {
  CoordinateReferenceSystem utm32OnLonLat = CRS.decode("EPSG:23032", true);
  assertTrue(CRS.getMapProjection(utm32OnLonLat) instanceof TransverseMercator);
  CoordinateReferenceSystem utm32OnLatLon = CRS.decode("EPSG:23032", false);
  assertTrue(CRS.getMapProjection(utm32OnLatLon) instanceof TransverseMercator);
  CoordinateReferenceSystem nad27Tennessee = CRS.decode("EPSG:2062", false);
  assertTrue(CRS.getMapProjection(nad27Tennessee) instanceof LambertConformal1SP);
}
origin: geotools/geotools

@Test
public void testEllipsoidalWKTParameters() {
  ParameterValueGroup parameters =
      CRS.getMapProjection(ellipsoidalGeosCRS).getParameterValues();
  double satelliteHeight = parameters.parameter("satellite_height").doubleValue();
  assertThat(satelliteHeight, is(35785831.0));
}
origin: geotools/geotools

@Test
public void testSpheroidalWKTParameters() {
  ParameterValueGroup parameters =
      CRS.getMapProjection(sphericalGeosCRS).getParameterValues();
  double satelliteHeight = parameters.parameter("satellite_height").doubleValue();
  assertThat(satelliteHeight, is(35832548.5));
}
origin: geotools/geotools

@Test
public void testPolarStereographic() throws Exception {
  ReferencedEnvelope envelope =
      new ReferencedEnvelope(
          -10700000, 14700000, -10700000, 14700000, CRS.decode("EPSG:5041", true));
  ProjectionHandler handler = ProjectionHandlerFinder.getHandler(envelope, WGS84, true);
  assertNotNull(handler);
  assertEquals(envelope, handler.getRenderingEnvelope());
  assertTrue(
      CRS.getMapProjection(envelope.getCoordinateReferenceSystem())
          instanceof PolarStereographic);
}
origin: geotools/geotools

    CRS.getMapProjection(renderingEnvelope.getCoordinateReferenceSystem());
if (mapProjection instanceof LambertAzimuthalEqualArea) {
  ParameterValueGroup params = mapProjection.getParameterValues();
origin: geotools/geotools

private static GeneralDirectPosition getProjectionCenterLonLat(
    CoordinateReferenceSystem crs, GeneralDirectPosition centerPt) {
  // set defaults
  centerPt.setOrdinate(0, 0);
  centerPt.setOrdinate(1, 0);
  MapProjection projection = getMapProjection(crs);
  if (projection == null) {
    return centerPt;
  }
  for (GeneralParameterValue gpv : projection.getParameterValues().values()) {
    // for safety
    if (!(gpv instanceof ParameterValue)) {
      continue;
    }
    ParameterValue pv = (ParameterValue) gpv;
    ReferenceIdentifier pvName = pv.getDescriptor().getName();
    if (MapProjection.AbstractProvider.LATITUDE_OF_ORIGIN.getName().equals(pvName)) {
      centerPt.setOrdinate(1, pv.doubleValue());
    } else if (MapProjection.AbstractProvider.LATITUDE_OF_CENTRE.getName().equals(pvName)) {
      centerPt.setOrdinate(1, pv.doubleValue());
    } else if (MapProjection.AbstractProvider.LONGITUDE_OF_CENTRE
        .getName()
        .equals(pvName)) {
      centerPt.setOrdinate(0, pv.doubleValue());
    } else if (MapProjection.AbstractProvider.CENTRAL_MERIDIAN.getName().equals(pvName)) {
      centerPt.setOrdinate(0, pv.doubleValue());
    }
  }
  return centerPt;
}
origin: geotools/geotools

  throws FactoryException {
MapProjection mapProjection =
    CRS.getMapProjection(renderingEnvelope.getCoordinateReferenceSystem());
if (renderingEnvelope != null && mapProjection instanceof TransverseMercator) {
  double centralMeridian =
origin: geotools/geotools

  throws FactoryException {
MapProjection mapProjection =
    CRS.getMapProjection(renderingEnvelope.getCoordinateReferenceSystem());
if (renderingEnvelope != null && mapProjection instanceof PolarStereographic) {
  final boolean north;
origin: geotools/geotools

  throws FactoryException {
MapProjection mapProjection =
    CRS.getMapProjection(renderingEnvelope.getCoordinateReferenceSystem());
if (renderingEnvelope != null && mapProjection instanceof Mercator) {
  ProjectionHandler handler;
origin: geotools/geotools

/** Circumscribed rectangle (smallest) for full disk earth image */
public static Envelope2D circumscribeFullDisk(CoordinateReferenceSystem geosCRS)
    throws TransformException, FactoryException {
  if (!isGeostationaryCRS(geosCRS)) {
    return null;
  }
  MathTransform mt =
      CRS.findMathTransform(geosCRS, CRS.getProjectedCRS(geosCRS).getBaseCRS(), true);
  MathTransform imt = mt.inverse();
  ParameterValueGroup parameters = CRS.getMapProjection(geosCRS).getParameterValues();
  double semiMajorAxis = parameters.parameter("semi_major").doubleValue();
  double satelliteHeight = parameters.parameter("satellite_height").doubleValue();
  double centralMeridian = parameters.parameter("central_meridian").doubleValue();
  DirectPosition2D dp2d = new DirectPosition2D();
  double halfFoVRadians = Math.acos(semiMajorAxis / (satelliteHeight + semiMajorAxis));
  double halfFoVDegrees = Math.toDegrees(halfFoVRadians);
  dp2d.setLocation(centralMeridian - halfFoVDegrees, 0.);
  imt.transform(dp2d, dp2d);
  double xMin = dp2d.getX();
  dp2d.setLocation(centralMeridian + halfFoVDegrees, 0.);
  imt.transform(dp2d, dp2d);
  double xMax = dp2d.getX();
  dp2d.setLocation(centralMeridian, -halfFoVDegrees);
  imt.transform(dp2d, dp2d);
  double yMin = dp2d.getY();
  dp2d.setLocation(centralMeridian, halfFoVDegrees);
  imt.transform(dp2d, dp2d);
  double yMax = dp2d.getY();
  return new Envelope2D(geosCRS, xMin, yMin, xMax - xMin, yMax - yMin);
}
origin: geotools/geotools

    CRS.getMapProjection(renderingEnvelope.getCoordinateReferenceSystem());
if (mapProjection instanceof LambertConformal
    || mapProjection instanceof EquidistantConic) {
origin: org.geotools/gt-render

public ProjectionHandler getHandler(ReferencedEnvelope renderingEnvelope, boolean wrap, int maxWraps) {
  MapProjection mapProjection = CRS.getMapProjection(renderingEnvelope
      .getCoordinateReferenceSystem());
  if (renderingEnvelope != null && mapProjection instanceof TransverseMercator) {
    double centralMeridian = mapProjection.getParameterValues().parameter(
        AbstractProvider.CENTRAL_MERIDIAN.getName().getCode()).doubleValue();
    ReferencedEnvelope validArea = new ReferencedEnvelope(centralMeridian - 45,
        centralMeridian + 45, -90, 90, DefaultGeographicCRS.WGS84);
    return new ProjectionHandler(renderingEnvelope, validArea);
  }
  return null;
}
origin: org.geoserver/gs-wcs2_0

MapProjection mapProjection = CRS.getMapProjection(crs);
if (crs instanceof GeographicCRS || mapProjection instanceof Mercator) {
  double offset;
origin: geotools/geotools

MapProjection sourceProjection = CRS.getMapProjection(sourceCRS);
if (sourceProjection instanceof PolarStereographic
    || (sourceProjection instanceof LambertAzimuthalEqualArea)) {
MapProjection targetProjection = CRS.getMapProjection(targetCRS);
if (targetProjection instanceof PolarStereographic && sourceCRS instanceof GeographicCRS) {
  final CoordinateSystem sourceCS = sourceCRS.getCoordinateSystem();
origin: org.geotools/gt-render

public ProjectionHandler getHandler(ReferencedEnvelope renderingEnvelope, boolean wrap, int maxWraps) {
  MapProjection mapProjection = CRS.getMapProjection(renderingEnvelope
      .getCoordinateReferenceSystem());
  if (renderingEnvelope != null && mapProjection instanceof Mercator) {
    if(wrap && maxWraps > 0) {
      double centralMeridian = mapProjection.getParameterValues().parameter(
          AbstractProvider.CENTRAL_MERIDIAN.getName().getCode()).doubleValue();
      return new WrappingProjectionHandler(renderingEnvelope, VALID_AREA, centralMeridian, maxWraps);
    } else {
      return new ProjectionHandler(renderingEnvelope, VALID_AREA);
    }
  }
  return null;
}
origin: org.geotools/gt-render

public ProjectionHandler getHandler(ReferencedEnvelope renderingEnvelope, boolean wrap, int maxWraps) {
  MapProjection mapProjection = CRS.getMapProjection(renderingEnvelope
      .getCoordinateReferenceSystem());
  if (renderingEnvelope != null && mapProjection instanceof PolarStereographic) {
origin: bcdev/beam

};
final CoordinateReferenceSystem crs = EnviCrsFactory.createCrs(9, parameter, EnviConstants.DATUM_NAME_WGS84, "Meters");
final ParameterValueGroup parameterValues = CRS.getMapProjection(crs).getParameterValues();
final List<GeneralParameterValue> valueList = parameterValues.values();
double[] actualValues = new double[8];
org.geotools.referencingCRSgetMapProjection

Javadoc

Returns the MapProjection driving the specified crs, or null if none could be found.

Popular methods of CRS

  • decode
  • findMathTransform
  • equalsIgnoreMetadata
  • parseWKT
  • lookupEpsgCode
  • transform
    Implementation of #transform(MathTransform,Envelope) with the opportunity to save the projected cent
  • getAxisOrder
  • lookupIdentifier
  • toSRS
  • getHorizontalCRS
  • getEnvelope
  • getCoordinateOperationFactory
  • getEnvelope,
  • getCoordinateOperationFactory,
  • getAuthorityFactory,
  • getSupportedCodes,
  • getGeographicBoundingBox,
  • reset,
  • getEllipsoid,
  • getProjectedCRS,
  • getTemporalCRS

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • getSystemService (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now