Examples of CoordinateSystem


Examples of org.opengis.referencing.cs.CoordinateSystem

            final ExtentImpl extent = new ExtentImpl();
            extent.getGeographicElements().add(validArea);
            properties.put(CoordinateReferenceSystem.DOMAIN_OF_VALIDITY_KEY, extent.unmodifiable());
        }
        final CoordinateReferenceSystem oppositeCRS = target ? sourceCRS : targetCRS;
        final CoordinateSystem cs;
        if (oppositeCRS != null) {
            cs = oppositeCRS.getCoordinateSystem();
        } else {
            switch (getDimension()) {
                case 2: cs = DefaultCartesianCS.GENERIC_2D; break;
View Full Code Here

Examples of org.opengis.referencing.cs.CoordinateSystem

                        ErrorKeys.MISMATCHED_DIMENSION_$3, label + '[' + i + ']', pointDim, dimension));
            }
            crs = getCoordinateReferenceSystem(point, crs);
        }
        if (crs != null) {
            final CoordinateSystem cs = crs.getCoordinateSystem();
            if (!getCoordinateSystemType().isAssignableFrom(cs.getClass())) {
                throw new MismatchedReferenceSystemException(Errors.format(
                        ErrorKeys.UNSUPPORTED_COORDINATE_SYSTEM_$1, cs.getName()));
            }
        }
        return crs;
    }
View Full Code Here

Examples of org.opengis.referencing.cs.CoordinateSystem

         * Computes matrix for swapping axis and performing units conversion.
         * There is one matrix to apply before projection on (longitude,latitude)
         * coordinates, and one matrix to apply after projection on (easting,northing)
         * coordinates.
         */
        final CoordinateSystem sourceCS = baseCRS.getCoordinateSystem();
        final Matrix swap1, swap3;
        try {
            swap1 = AbstractCS.swapAndScaleAxis(sourceCS, AbstractCS.standard(sourceCS));
            swap3 = AbstractCS.swapAndScaleAxis(AbstractCS.standard(derivedCS), derivedCS);
        } catch (IllegalArgumentException cause) {
View Full Code Here

Examples of ucar.nc2.dataset.CoordinateSystem

   * @param nt assign coordinates to this table.
   * @param ds look in this dataset's "Best" coordinate system. If no CoordSystem, try list of coordinate axes
   */
  static public void findCoords(TableConfig nt, NetcdfDataset ds) {

    CoordinateSystem use = findBestCoordinateSystem(ds);
    if (use == null)
      findCoords(nt, ds.getCoordinateAxes());
    else
      findCoords(nt, use.getCoordinateAxes());
  }
View Full Code Here

Examples of ucar.nc2.dataset.CoordinateSystem

    }
  }

  static public void findCoordWithDimension(TableConfig nt, NetcdfDataset ds, Dimension outer) {

    CoordinateSystem use = findBestCoordinateSystem(ds);
    if (use == null) return;

    for (CoordinateAxis axis : use.getCoordinateAxes()) {
      if (!outer.equals(axis.getDimension(0))) continue;

      if (axis.getAxisType() == AxisType.Lat)
        nt.lat = axis.getShortName();
      else if (axis.getAxisType() == AxisType.Lon)
View Full Code Here

Examples of ucar.nc2.dataset.CoordinateSystem

   * @param ds look in this dataset's "Best" coordinate system.
   * @param atype look for this type of CoordinateAxis. takes the first one it finds.
   * @return the found CoordinateAxis, or null if none
   */
  static public CoordinateAxis findCoordByType(NetcdfDataset ds, AxisType atype) {
    CoordinateSystem use = findBestCoordinateSystem(ds);
    if (use != null) {
      for (CoordinateAxis axis : use.getCoordinateAxes()) {
        if (axis.getAxisType() == atype)
          return axis;
      }
    }

View Full Code Here

Examples of ucar.nc2.dataset.CoordinateSystem

   * @param atype look for this type of CoordinateAxis.
   * @param p match this predicate
   * @return the found CoordinateAxis, or null if none
   */
  static public CoordinateAxis findCoordByType(NetcdfDataset ds, AxisType atype, Predicate p) {
    CoordinateSystem use = findBestCoordinateSystem(ds);
    if (use == null) return null;

    // try the "best" cs
    for (CoordinateAxis axis : use.getCoordinateAxes()) {
      if (axis.getAxisType() == atype)
        if (p.match(axis)) return axis;
    }

    // try all the axes
View Full Code Here

Examples of ucar.nc2.dataset.CoordinateSystem

   * @param ds look in this dataset
   * @return CoordinateSystem or null if none
   */
  static private CoordinateSystem findBestCoordinateSystem(NetcdfDataset ds) {
        // find coordinate system with highest rank (largest number of axes)
    CoordinateSystem use = null;
    for (CoordinateSystem cs : ds.getCoordinateSystems()) {
      if (use == null) use = cs;
      else if (cs.getCoordinateAxes().size() > use.getCoordinateAxes().size())
        use = cs;
    }
    return use;
  }
View Full Code Here

Examples of ucar.nc2.dataset.CoordinateSystem

    public String getCoordMap() {
      return coordMap;
    }

    public void setCoordMap(java.util.List<CoordinateSystem> csysList) {
      CoordinateSystem use = null;
      for (CoordinateSystem csys : csysList) {
        if (use == null) use = csys;
        else if (csys.getCoordinateAxes().size() > use.getCoordinateAxes().size())
          use = csys;
      }
      coordMap = (use == null) ? "" : "f:D(" + use.getRankDomain() + ")->R(" + use.getRankRange() + ")";
    }
View Full Code Here

Examples of ucar.nc2.dataset.CoordinateSystem

    // this call must be thread safe - done by implementation
    return useFactory.open(null, ncd, analysis, task, errlog);
  }

  static private boolean isGrid(java.util.List<CoordinateSystem> csysList) {
    CoordinateSystem use = null;
    for (CoordinateSystem csys : csysList) {
      if (use == null) use = csys;
      else if (csys.getCoordinateAxes().size() > use.getCoordinateAxes().size())
        use = csys;
    }

    if (use == null) return false;
    CoordinateAxis lat = use.getLatAxis();
    CoordinateAxis lon = use.getLonAxis();
    if ((lat != null) && (lat.getSize() <= 1)) return false; // COARDS singletons
    if ((lon != null) && (lon.getSize() <= 1)) return false;

    // hueristics - cant say i like this, multidim point features could eaily violate
    return (use.getRankDomain() > 2) && (use.getRankDomain() <= use.getRankRange());
  }
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.