Package org.opengis.referencing.cs

Examples of org.opengis.referencing.cs.CoordinateSystemAxis


     * - is AbstractCS a more appropriate place for this?
     */   
    public static Unit getDirectedAxisUnit(
            final CoordinateSystem cs,
            final AxisDirection direction) {
        CoordinateSystemAxis axis = getDirectedAxis(cs, direction);
        if (axis != null) {
            return axis.getUnit();
        }
        return null;
    }
View Full Code Here


    return processSegmentToPrimitive( bounds, segment, 1 );   
  }
 
  private PrimitiveImpl processSegmentToPrimitive(Envelope bounds, LineSegment segment, int dimension) {
    //int D = crs.getCoordinateSystem().getDimension();
    CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis( dimension );
   
    if( axis.getDirection() == AxisDirection.OTHER ){
      return processSegmentToPrimitive( bounds, segment, dimension+1 );
    }
    Ring ring = processBoundsToRing( bounds, segment, dimension );
    return processRingToPrimitive( bounds, ring, dimension+1 );       
  }
View Full Code Here

    int D = crs.getCoordinateSystem().getDimension();
    if( dimension == D ){ // create Surface from ring and return     
      SurfaceBoundary boundary = new SurfaceBoundaryImpl( crs, ring, Collections.EMPTY_LIST );
      return new SurfaceImpl( boundary );
    }   
    CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis( dimension );
    if( axis.getDirection() == AxisDirection.OTHER ){
      return processRingToPrimitive( bounds, ring, dimension+1 );
    }
    return processRingToVolumne( bounds, ring, dimension+1 );
  }
View Full Code Here

   * @param dimension
   */
  public LineSegment processBoundsToSegment( Envelope bounds ){
    final int D=0;
    CoordinateReferenceSystem crs = bounds.getCoordinateReferenceSystem();
    CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis( D );
   
    DirectPosition positionA = positionFactory.createDirectPosition(null); //new DirectPositionImpl(crs);
    DirectPosition positionB = positionFactory.createDirectPosition(null); //new DirectPositionImpl(crs);   
    if( axis.getDirection() != AxisDirection.OTHER ){
      positionA.setOrdinate(D, bounds.getMinimum(D) );
      positionB.setOrdinate(D, bounds.getMaximum(D) );
    }   
    PointArrayImpl array = new PointArrayImpl(crs );
    array.add( positionA );
View Full Code Here

     */
    public synchronized CoordinateSystemAxis generateCoordinateSystemAxis(final String code)
            throws FactoryException
    {
        ensureNonNull("code", code);
        CoordinateSystemAxis returnValue = null;
        try {
            final String primaryKey = trimAuthority(code);
            final PreparedStatement stmt;
            stmt = prepareStatement("Axis", "SELECT COORD_AXIS_CODE,"
                                    +             " COORD_AXIS_NAME_CODE,"
                                    +             " COORD_AXIS_ORIENTATION,"
                                    +             " COORD_AXIS_ABBREVIATION,"
                                    +             " UOM_CODE"
                                    +       " FROM [Coordinate Axis]"
                                    +      " WHERE COORD_AXIS_CODE = ?");
            stmt.setString(1, code);
            ResultSet result = stmt.executeQuery();
            while (result.next()) {
                final String epsg         = getString(result, 1, code);
                final String nameCode     = getString(result, 2, code);
                final String orientation  = getString(result, 3, code);
                final String abbreviation = getString(result, 4, code);
                final String unit         = getString(result, 5, code);
                AxisDirection direction;
                try {
                    direction = DefaultCoordinateSystemAxis.getDirection(orientation);
                } catch (NoSuchElementException exception) {
                    if (orientation.equalsIgnoreCase("Geocentre > equator/PM")) {
                        direction = AxisDirection.OTHER; // TODO: can we choose a more accurate direction?
                    } else if (orientation.equalsIgnoreCase("Geocentre > equator/90dE")) {
                        direction = AxisDirection.EAST;
                    } else if (orientation.equalsIgnoreCase("Geocentre > north pole")) {
                        direction = AxisDirection.NORTH;
                    } else {
                        throw new FactoryException(exception);
                    }
                }
                final AxisName an = getAxisName(nameCode);
                final Map<String,Object> properties = generateProperties(an.name, epsg, an.description);
                final CSFactory factory = factories.getCSFactory();
                final CoordinateSystemAxis axis = factory.createCoordinateSystemAxis(
                        properties, abbreviation, direction, createUnit(unit));
                returnValue = ensureSingleton(axis, returnValue, code);
            }
            result.close();
        } catch (SQLException exception) {
View Full Code Here

    setCoordianteReferenceSystem(envelope.getCoordinateReferenceSystem());
    return processSegmentToPrimitive( envelope, segment, 1 )
  }
 
  private Primitive processSegmentToPrimitive(Envelope bounds, LineSegment segment, int dimension) {
    CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis( dimension );
   
    if( axis.getDirection() == AxisDirection.OTHER ){
      return processSegmentToPrimitive( bounds, segment, dimension+1 );
    }
    Ring ring = processBoundsToRing( bounds, segment, dimension );
    return processRingToPrimitive( bounds, ring, dimension+1 );       
  }
View Full Code Here

    int D = crs.getCoordinateSystem().getDimension();
    if( dimension == D ){ // create Surface from ring and return     
      SurfaceBoundary boundary = createSurfaceBoundary( ring, Collections.EMPTY_LIST );
      return createSurface( boundary );
    }   
    CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis( dimension );
    if( axis.getDirection() == AxisDirection.OTHER ){
      return processRingToPrimitive( bounds, ring, dimension+1 );
    }
    return processRingToVolumne( bounds, ring, dimension+1 );
  }
View Full Code Here

  }
 
  private LineSegment processBoundsToSegment( Envelope bounds ) {
    final int D=0;
    CoordinateReferenceSystem crs = bounds.getCoordinateReferenceSystem();
    CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis( D );
   
    DirectPosition positionA = getPositionFactory().createDirectPosition(null);
    DirectPosition positionB = getPositionFactory().createDirectPosition(null)
    if( axis.getDirection() != AxisDirection.OTHER ){
      positionA.setOrdinate(D, bounds.getMinimum(D) );
      positionB.setOrdinate(D, bounds.getMaximum(D) );
    }   
    return getGeometryFactory().createLineSegment(positionA, positionB);
  }
View Full Code Here

  // sample implemenation with get/test
  public CoordinateSystemAxis createCoordinateSystemAxis(String code)
      throws FactoryException {
    final String key = toKey(code);
    CoordinateSystemAxis axis = (CoordinateSystemAxis) cache.get(key);
    if (axis == null) {
      try {
        cache.writeLock(key);
        axis = (CoordinateSystemAxis) cache.peek(key);
        if (axis == null) {
View Full Code Here

        if (crs != null) {
            final int dimension = ordinates.length / 2;
            final CoordinateSystem cs = crs.getCoordinateSystem();
            for (int i = 0; i < dimension; i++) {
                final int j = i + dimension;
                final CoordinateSystemAxis axis = cs.getAxis(i);
                final double minimum = axis.getMinimumValue();
                final double maximum = axis.getMaximumValue();
                final RangeMeaning rm = axis.getRangeMeaning();
                if (RangeMeaning.EXACT.equals(rm)) {
                    if (ordinates[i] < minimum) {
                        ordinates[i] = minimum;
                        changed = true;
                    }
View Full Code Here

TOP

Related Classes of org.opengis.referencing.cs.CoordinateSystemAxis

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.