• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CoordinateArraySequence类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vividsolutions.jts.geom.impl.CoordinateArraySequence的典型用法代码示例。如果您正苦于以下问题:Java CoordinateArraySequence类的具体用法?Java CoordinateArraySequence怎么用?Java CoordinateArraySequence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CoordinateArraySequence类属于com.vividsolutions.jts.geom.impl包,在下文中一共展示了CoordinateArraySequence类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: homothetie

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
public static Polygon homothetie(Polygon geom, double x0, double y0,
    double scale) {
  GeometryFactory gf = new GeometryFactory();

  // le contour externe
  Coordinate[] coord = geom.getExteriorRing().getCoordinates();
  Coordinate[] coord_ = new Coordinate[coord.length];
  for (int i = 0; i < coord.length; i++) {
    coord_[i] = new Coordinate(x0 + scale * (coord[i].x - x0),
        y0 + scale * (coord[i].y - y0));
  }
  LinearRing lr = gf.createLinearRing(new CoordinateArraySequence(coord_));

  // les trous
  LinearRing[] trous = new LinearRing[geom.getNumInteriorRing()];
  for (int j = 0; j < geom.getNumInteriorRing(); j++) {
    Coordinate[] hole_coord = geom.getInteriorRingN(j).getCoordinates();
    Coordinate[] hole_coord_ = new Coordinate[hole_coord.length];
    for (int i = 0; i < hole_coord.length; i++) {
      hole_coord_[i] = new Coordinate(x0 + scale * (hole_coord[i].x - x0),
          y0 + scale * (hole_coord[i].y - y0));
    }
    trous[j] = gf.createLinearRing(new CoordinateArraySequence(hole_coord_));
  }
  return gf.createPolygon(lr, trous);
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:27,代码来源:CommonAlgorithms.java


示例2: createCompoundLineString

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * <p>createCompoundLineString.</p>
 *
 * @param factory a {@link com.vividsolutions.jts.geom.GeometryFactory} object.
 * @param segments a {@link com.vividsolutions.jts.geom.LineString} object.
 * @return a {@link nl.pdok.gml3.impl.geometry.extended.CompoundLineString} object.
 */
public static CompoundLineString createCompoundLineString(GeometryFactory factory,
		LineString... segments) {
	List<Coordinate> coordinates = new ArrayList<Coordinate>();
	for(int i=0; i<segments.length; i++) {
		LineString segment = segments[i];
		Coordinate[] coordinateArray = segment.getCoordinates();
		if(i != segments.length-1) {
			int lengtWithoutLastElement = coordinateArray.length-1;
			Coordinate[] coordinateArray2 = new Coordinate[lengtWithoutLastElement];
			System.arraycopy(coordinateArray, 0, coordinateArray2, 0, lengtWithoutLastElement);
			coordinates.addAll(Arrays.asList(coordinateArray2));
		}
		else {
			coordinates.addAll(Arrays.asList(coordinateArray));
		}
		
	}
	
	CoordinateSequence coordinateSequence = new CoordinateArraySequence(
			coordinates.toArray(new Coordinate[]{}));
	CompoundLineString curveLineString = new CompoundLineString(coordinateSequence, factory,
			segments);
	return curveLineString;
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:32,代码来源:CompoundLineString.java


示例3: translateLinearRingType

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
private LinearRing translateLinearRingType(LinearRingType ring) throws GeometryException {
	if (ring.getPosList() == null) {
		throw new DeprecatedGeometrySpecificationException("Geen post list voor ring gespecificeerd");
	}

	CoordinateArraySequence sequence = gmlToPointConvertor.translateOrdinates(ring.getPosList());
	int length = sequence.size();
       Coordinate firstCoordinate = length == 0 ? null : sequence.getCoordinate(0);

	if (length < NUMBER_OF_COORDINATES_NEEDED_FOR_RING) {
		throw new InvalidGeometryException(GeometryValidationErrorType.TOO_FEW_POINTS, firstCoordinate);
	}
	
	if (!isClosed(sequence)) {
		throw new InvalidGeometryException(GeometryValidationErrorType.RING_NOT_CLOSED, firstCoordinate);
	}

	return geometryFactory.createLinearRing(sequence);
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:20,代码来源:GMLToLineConvertor.java


示例4: getCoordinatesForArc

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
private CoordinateArraySequence getCoordinatesForArc(ArcType arc) throws GeometryException {
    if(arc.getPosList() != null) {
        return gmlToPointConvertor.translateOrdinates(arc.getPosList());
    }
    else if(arc.getPosOrPointPropertyOrPointRep() != null &&
            arc.getPosOrPointPropertyOrPointRep().size() > 0) {
        List<Double> values = new ArrayList<Double>();
        Iterator<JAXBElement<?>> iterator = arc.getPosOrPointPropertyOrPointRep().iterator();
        while(iterator.hasNext()) {
            Object value = iterator.next().getValue();
            if(value instanceof DirectPositionType) {
                DirectPositionType position = (DirectPositionType) value;
                values.addAll(position.getValue());
            }
            else {
                throw new DeprecatedGeometrySpecificationException(
                        "Geen poslist voor arc binnen curve gespecificeerd");
            }
        }
        return gmlToPointConvertor.translateOrdinates(values, 2); // could be 3 too?
    }
    else {
        throw new DeprecatedGeometrySpecificationException("Geen poslist voor arc binnen curve gespecificeerd");
    }
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:26,代码来源:GMLToLineConvertor.java


示例5: translateOrdinates

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * <p>translateOrdinates.</p>
 *
 * @param coordinates a {@link java.util.List} object.
 * @param dimension a {@link int}.
 * @return a {@link com.vividsolutions.jts.geom.impl.CoordinateArraySequence} object.
 * @throws nl.pdok.gml3.exceptions.InvalidGeometryException if any.
 * @throws nl.pdok.gml3.exceptions.CoordinateMaxScaleExceededException if any.
 */
public CoordinateArraySequence translateOrdinates(List<Double> coordinates, int dimension)
		throws InvalidGeometryException, CoordinateMaxScaleExceededException {
	if (coordinates == null || coordinates.size() < dimension) {
		throw new InvalidGeometryException(GeometryValidationErrorType.EMPTY_GEOMETRY, null);
	}
	
	if(coordinates.size()%dimension != 0) {
		throw new InvalidGeometryException(GeometryValidationErrorType.INVALID_COORDINATE, null);
	}

	CoordinateArraySequence sequence = new CoordinateArraySequence(coordinates.size() / dimension);
	int i = 0;
	for (Double ordinate : coordinates) {
		BigDecimal bd = new BigDecimal(ordinate);
		int ordinateIndex = i % dimension;
		int index = (i / dimension);
		sequence.setOrdinate(index, ordinateIndex, bd.doubleValue());
		i++;
	}
	
	return sequence;

}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:33,代码来源:GMLToPointConvertor.java


示例6: convertPoint

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * <p>convertPoint.</p>
 *
 * @param point a {@link net.opengis.gml.v_3_1_1.PointType} object.
 * @return a {@link com.vividsolutions.jts.geom.Point} object.
 * @throws nl.pdok.gml3.exceptions.GeometryException if any.
 */
public Point convertPoint(PointType point) throws GeometryException {
	DirectPositionType pos = point.getPos();
	int dimension = pos.getSrsDimension() != null ? pos.getSrsDimension().intValue() : pos.getValue().size();
	if(point.getPos() == null) {
		throw new DeprecatedGeometrySpecificationException(
			"Geen post list voor ring gespecificeerd");
	}
	List<Double> values = pos.getValue();
	if(values.size() != dimension) {
		throw new InvalidGeometryException(GeometryValidationErrorType.POINT_INVALID_NUMBER_OF_ORDINATES, null);
	}
	
	CoordinateArraySequence sequence = translateOrdinates(values, dimension);
	return geometryFactory.createPoint(sequence);
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:23,代码来源:GMLToPointConvertor.java


示例7: translateOrdinates

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * <p>translateOrdinates.</p>
 *
 * @param ordinates a {@link java.util.List} object.
 * @param dimension a {@link int}.
 * @return a {@link com.vividsolutions.jts.geom.impl.CoordinateArraySequence} object.
 * @throws nl.pdok.gml3.exceptions.InvalidGeometryException if any.
 * @throws nl.pdok.gml3.exceptions.CoordinateMaxScaleExceededException if any.
 */
public CoordinateArraySequence translateOrdinates(List<Double> ordinates, int dimension)
        throws InvalidGeometryException, CoordinateMaxScaleExceededException {
    if (ordinates == null || ordinates.size() < dimension) {
        throw new InvalidGeometryException(GeometryValidationErrorType.EMPTY_GEOMETRY, null);
    }

    if (ordinates.size()%dimension != 0) {
        throw new InvalidGeometryException(GeometryValidationErrorType.INVALID_COORDINATE, createCoordinateFromFirstTwoOrdinates(ordinates));
    }

    CoordinateArraySequence sequence = new CoordinateArraySequence(ordinates.size() / dimension);
    int i = 0;
    for (Double ordinate : ordinates) {
        BigDecimal bd = new BigDecimal(ordinate);
        int ordinateIndex = i % dimension;
        int index = (i / dimension);
        sequence.setOrdinate(index, ordinateIndex, bd.doubleValue());
        i++;
    }

    return sequence;

}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:33,代码来源:GML321ToPointConvertor.java


示例8: convertPoint

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * <p>convertPoint.</p>
 *
 * @param point a {@link net.opengis.gml.v_3_2_1.PointType} object.
 * @return a {@link com.vividsolutions.jts.geom.Point} object.
 * @throws nl.pdok.gml3.exceptions.GeometryException if any.
 */
public Point convertPoint(PointType point) throws GeometryException {
    DirectPositionType pos = point.getPos();
    List<Double> values = pos.getValue();
    int dimension = pos.getSrsDimension() != null ? pos.getSrsDimension().intValue() : values.size();
    if (point.getPos() == null) {
        throw new DeprecatedGeometrySpecificationException(
                "Geen post list voor ring gespecificeerd");
    }
    if (values.size() != dimension) {
        throw new InvalidGeometryException(GeometryValidationErrorType.POINT_INVALID_NUMBER_OF_ORDINATES, null);
    }

    CoordinateArraySequence sequence = translateOrdinates(values, dimension);
    return geometryFactory.createPoint(sequence);
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:23,代码来源:GML321ToPointConvertor.java


示例9: translateLinearRingType

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
private LinearRing translateLinearRingType(LinearRingType ring) throws GeometryException {
    if (ring.getPosList() == null) {
        throw new DeprecatedGeometrySpecificationException("Geen post list voor ring gespecificeerd");
    }
    CoordinateArraySequence sequence = gmlToPointConvertor.translateOrdinates(ring.getPosList());
    int length = sequence.size();
    Coordinate firstCoordinate = length == 0 ? null : sequence.getCoordinate(0);

    if (length < NUMBER_OF_COORDINATES_NEEDED_FOR_RING) {
        throw new InvalidGeometryException(GeometryValidationErrorType.TOO_FEW_POINTS, firstCoordinate);
    }

    if (!isClosed(sequence)) {
        throw new InvalidGeometryException(GeometryValidationErrorType.RING_NOT_CLOSED, firstCoordinate);
    }

    return geometryFactory.createLinearRing(sequence);
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:19,代码来源:GML321ToLineConvertor.java


示例10: calculate

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
public double calculate(Polygon polygon, Coordinate coordinate, double precisionKilometers, GeometryFactory geometryFactory) {
  Point point = new Point(new CoordinateArraySequence(new Coordinate[]{coordinate}), geometryFactory);
  if (polygon.contains(point)) {
    // todo distance to border? well if that should be the case then factor this method out of this class!
    return 0;
  }

  double smallestDistance = Double.MAX_VALUE;
  Coordinate[] coordinates = polygon.getCoordinates();
  for (int i = 1; i < coordinates.length; i++) {
    for (Coordinate interpolated : new LineInterpolation().interpolate(precisionKilometers, coordinates[i - 1], coordinates[i])) {
      double distance = calculate(interpolated, coordinate);
      if (distance < smallestDistance) {
        smallestDistance = distance;
      }
    }
  }
  return smallestDistance;
}
 
开发者ID:kodapan,项目名称:osm-common,代码行数:20,代码来源:JtsArcDistance.java


示例11: lngLatToMeters

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * Converts geometry from lat/lon (EPSG:4326)) to Spherical Mercator
 * (EPSG:3857)
 *
 * @param geometry the geometry to convert
 * @return the geometry transformed to EPSG:3857
 */
public Geometry lngLatToMeters(Geometry geometry) {
    GeometryTransformer transformer = new GeometryTransformer() {
        @Override
        protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geometry parent) {
            Coordinate[] newCoords = new Coordinate[coords.size()];
            for (int i = 0; i < coords.size(); ++i) {
                Coordinate coord = coords.getCoordinate(i);
                newCoords[i] = lngLatToMeters(coord);
            }
            return new CoordinateArraySequence(newCoords);
        }
    };
    Geometry result = transformer.transform(geometry);
    return result;
}
 
开发者ID:scaleset,项目名称:scaleset-geo,代码行数:23,代码来源:GoogleMapsTileMath.java


示例12: metersToLngLat

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * Converts geometry from Spherical Mercator
 * (EPSG:3857) to lat/lon (EPSG:4326))
 *
 * @param geometry the geometry to convert
 * @return the geometry transformed to EPSG:4326
 */
public Geometry metersToLngLat(Geometry geometry) {
    GeometryTransformer transformer = new GeometryTransformer() {
        @Override
        protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geometry parent) {
            Coordinate[] newCoords = new Coordinate[coords.size()];
            for (int i = 0; i < coords.size(); ++i) {
                Coordinate coord = coords.getCoordinate(i);
                newCoords[i] = metersToLngLat(coord);
            }
            return new CoordinateArraySequence(newCoords);
        }
    };
    Geometry result = transformer.transform(geometry);
    return result;
}
 
开发者ID:scaleset,项目名称:scaleset-geo,代码行数:23,代码来源:GoogleMapsTileMath.java


示例13: transformIntoPointGeometryCollection

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * Transform into GeometryCollection.
 *
 * @param geom input geometry
 * @return a geometry collection
 */
private static GeometryCollection transformIntoPointGeometryCollection(Geometry geom) {
    UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
    geom.apply(filter);
    Coordinate[] coord = filter.getCoordinates();

    Geometry[] geometries = new Geometry[coord.length];
    for (int i = 0; i < coord.length; i++) {
        Coordinate[] c = new Coordinate[]{coord[i]};
        CoordinateArraySequence cs = new CoordinateArraySequence(c);
        geometries[i] = new Point(cs, geom.getFactory());
    }

    return new GeometryCollection(geometries, geom.getFactory());
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:21,代码来源:ConcaveHull.java


示例14: transformIntoPointGeometryCollection

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * Transform into GeometryCollection.
 *
 * @param geom
 * 		input geometry
 * @return
 * 		a geometry collection
 */
private static GeometryCollection transformIntoPointGeometryCollection(Geometry geom) {
  UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
  geom.apply(filter);
  Coordinate[] coord = filter.getCoordinates();

  Geometry[] geometries = new Geometry[coord.length];
  for (int i = 0 ; i < coord.length ; i++) {
    Coordinate[] c = new Coordinate[] { coord[i] };
    CoordinateArraySequence cs = new CoordinateArraySequence(c);
    geometries[i] = new Point(cs, geom.getFactory());
  }

  return new GeometryCollection(geometries, geom.getFactory());
}
 
开发者ID:fiskurgit,项目名称:KortidTol,代码行数:23,代码来源:GrossoConcaveHull.java


示例15: checkRobustInCircle

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * Checks if the computed value for isInCircle is correct, using
 * double-double precision arithmetic.
 *
 * @param a a vertex of the triangle
 * @param b a vertex of the triangle
 * @param c a vertex of the triangle
 * @param p the point to test
 */
private static void checkRobustInCircle(Coordinate a, Coordinate b, Coordinate c,
                                        Coordinate p) {
    boolean nonRobustInCircle = isInCircleNonRobust(a, b, c, p);
    boolean isInCircleDD = TrianglePredicate.isInCircleDDSlow(a, b, c, p);
    boolean isInCircleCC = TrianglePredicate.isInCircleCC(a, b, c, p);

    Coordinate circumCentre = Triangle.circumcentre(a, b, c);
    System.out.println("p radius diff a = "
            + Math.abs(p.distance(circumCentre) - a.distance(circumCentre))
            / a.distance(circumCentre));

    if (nonRobustInCircle != isInCircleDD || nonRobustInCircle != isInCircleCC) {
        System.out.println("inCircle robustness failure (double result = "
                + nonRobustInCircle
                + ", DD result = " + isInCircleDD
                + ", CC result = " + isInCircleCC + ")");
        System.out.println(WKTWriter.toLineString(new CoordinateArraySequence(
                new Coordinate[] { a, b, c, p })));
        System.out.println("Circumcentre = " + WKTWriter.toPoint(circumCentre)
                + " radius = " + a.distance(circumCentre));
        System.out.println("p radius diff a = "
                + Math.abs(p.distance(circumCentre) / a.distance(circumCentre) - 1));
        System.out.println("p radius diff b = "
                + Math.abs(p.distance(circumCentre) / b.distance(circumCentre) - 1));
        System.out.println("p radius diff c = "
                + Math.abs(p.distance(circumCentre) / c.distance(circumCentre) - 1));
        System.out.println();
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:39,代码来源:TrianglePredicate.java


示例16: affinite

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
public static Polygon affinite(Polygon geom, Coordinate c, double angle,
    double coef) {
  // pivote le polygone
  Polygon rot = CommonAlgorithms.rotation(geom, c, -1.0 * angle);

  GeometryFactory gf = new GeometryFactory();

  // le contour externe
  Coordinate[] coord = rot.getExteriorRing().getCoordinates();
  Coordinate[] coord_ = new Coordinate[coord.length];
  for (int i = 0; i < coord.length; i++) {
    coord_[i] = new Coordinate(c.x + coef * (coord[i].x - c.x), coord[i].y);
  }
  LinearRing lr = new LinearRing(new CoordinateArraySequence(coord_), gf);

  // les trous
  LinearRing[] trous = new LinearRing[rot.getNumInteriorRing()];
  for (int j = 0; j < rot.getNumInteriorRing(); j++) {
    Coordinate[] hole_coord = rot.getInteriorRingN(j).getCoordinates();
    Coordinate[] hole_coord_ = new Coordinate[hole_coord.length];
    for (int i = 0; i < hole_coord.length; i++) {
      hole_coord_[i] = new Coordinate(c.x + coef * (hole_coord[i].x - c.x),
          coord[i].y);
    }
    trous[j] = new LinearRing(new CoordinateArraySequence(hole_coord_), gf);
  }
  return CommonAlgorithms.rotation(new Polygon(lr, trous, gf), c, angle);
}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:29,代码来源:CommonAlgorithms.java


示例17: createRing

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * <p>createRing.</p>
 *
 * @param factory a {@link com.vividsolutions.jts.geom.GeometryFactory} object.
 * @param segments a {@link com.vividsolutions.jts.geom.LineString} object.
 * @return a {@link nl.pdok.gml3.impl.geometry.extended.Ring} object.
 */
public static Ring createRing(GeometryFactory factory, LineString... segments) {
	Set<Coordinate> coordinates = new LinkedHashSet<>();
	for (LineString segment : segments) {
	  coordinates.addAll(Arrays.asList(segment.getCoordinates()));
	}

	List<Coordinate> coordsWithoutDuplicates = new ArrayList<>(coordinates);
	coordsWithoutDuplicates.add(coordsWithoutDuplicates.get(0));

	CoordinateSequence coordinateSequence =
		new CoordinateArraySequence(coordsWithoutDuplicates.toArray(new Coordinate[] {}));
	return new Ring(coordinateSequence, factory, segments);
	
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:22,代码来源:Ring.java


示例18: densify

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * <p>densify.</p>
 *
 * @param coordinates an array of {@link com.vividsolutions.jts.geom.Coordinate} objects.
 * @param factory a {@link com.vividsolutions.jts.geom.GeometryFactory} object.
 * @return a {@link com.vividsolutions.jts.geom.CoordinateSequence} object.
 */
public static CoordinateSequence densify(Coordinate[] coordinates, GeometryFactory factory) {
	double tolerance = ExtendedGeometryFactory.DEFAULT_MAXIMUM_ARC_APPROXIMATION_ERROR;
	if(factory instanceof ExtendedGeometryFactory) {
		tolerance = ((ExtendedGeometryFactory) factory).getMaximumArcApproximationError();
	}
	
	LineString ls = factory.createLineString(coordinates);
	Envelope envelope = ls.getEnvelopeInternal();
	// bbox bepalen
	double threshold = tolerance * 3;
	if(envelope.getHeight() <= threshold || envelope.getWidth() <= threshold) {
		// do nothing with small arc, to prevent floating point shizzle
           return new CoordinateArraySequence(coordinates);
	}
	
	// make sure the original coordinates are not changed
	Coordinate[] orderedCoordinates = orderCoordinates(coordinates, factory);
	Coordinate[] result = SmallCircle.linearizeArc(
               orderedCoordinates[0].x, orderedCoordinates[0].y,
               orderedCoordinates[1].x, orderedCoordinates[1].y,
               orderedCoordinates[2].x, orderedCoordinates[2].y, tolerance);
	CoordinateSequence out = new CoordinateArraySequence(result);
	// if the points were reversed, the densified line needs to be reversed again
	if(!orderedCoordinates[0].equals(coordinates[0])) {
		CoordinateSequences.reverse(out);
	}
	
	return out;
	
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:38,代码来源:ArcUtils.java


示例19: translateCurveTypeToSegments

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
/**
 * <p>translateCurveTypeToSegments.</p>
 *
 * @param curve a {@link net.opengis.gml.v_3_1_1.CurveType} object.
 * @return a {@link java.util.List} object.
 * @throws nl.pdok.gml3.exceptions.GeometryException if any.
 */
public List<LineString> translateCurveTypeToSegments(CurveType curve) throws GeometryException {
	List<LineString> list = new ArrayList<LineString>();
	CurveSegmentArrayPropertyType array = curve.getSegments();
	valideerSegmentArray(array);
	int size =  array.getCurveSegment().size();
	
	for (int i = 0; i < size; i++) {
		AbstractCurveSegmentType curveProperty = array.getCurveSegment().get(i).getValue();
		
		if (curveProperty instanceof LineStringSegmentType) {
			LineStringSegmentType line = (LineStringSegmentType) curveProperty;
			if (line.getPosList() == null) {
				throw new DeprecatedGeometrySpecificationException(
						"Geen poslist voor linestringsegment binnen curve gespecificeerd");
			}
			
			CoordinateArraySequence sequence = gmlToPointConvertor.translateOrdinates(line.getPosList());
			LineString lineString = new LineString(sequence, geometryFactory);
			list.add(lineString);
		} 
		else if (curveProperty instanceof ArcType && !(curveProperty instanceof CircleType)) {
			ArcType arc = (ArcType) curveProperty;
			list.add(translateArc(arc));
		} 
		else {
			throw new UnsupportedGeometrySpecificationException(
					"Only arc and linestring are supported within a Curve segment");
		}

	}
	return list;
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:40,代码来源:GMLToLineConvertor.java


示例20: translateArc

import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; //导入依赖的package包/类
private ArcLineString translateArc(ArcType arc) throws GeometryException {
	if (CurveInterpolationType.CIRCULAR_ARC_3_POINTS != ArcStringType.INTERPOLATION) {
		throw new UnsupportedGeometrySpecificationException(
				"Het arc attribuut interpolation moet circularArc3Points zijn");
	}
       CoordinateArraySequence sequence = getCoordinatesForArc(arc);
       validateArcHasThreeCoordinates(sequence);
       validateArcIsNotAStraightLine(sequence);
       return new ArcLineString(sequence, geometryFactory);
}
 
开发者ID:PDOK,项目名称:gml3-jts,代码行数:11,代码来源:GMLToLineConvertor.java



注:本文中的com.vividsolutions.jts.geom.impl.CoordinateArraySequence类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Docx4J类代码示例发布时间:2022-05-21
下一篇:
Java JSONException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap