public Polygon createPolygon(SurfaceBoundary boundary) throws MismatchedReferenceSystemException, MismatchedDimensionException { return getGeometryFactory().createPolygon(boundary); }
public Polygon createPolygon(SurfaceBoundary boundary, Surface spanSurface) throws MismatchedReferenceSystemException, MismatchedDimensionException { return getGeometryFactory().createPolygon(boundary, spanSurface); }
/** * {@inheritDoc } */ @Override public Surface createSurface(final SurfaceBoundary boundary) { // For now, our implementation has to assume that the boundary is a // polygon. Surface result = new JTSSurface(crs); Polygon poly = geomFact.createPolygon(boundary); // PENDING(jdc): the following line is 1.5 specific. // the result.getPatches() list is a generic list with a type of "? extends SurfacePatch" // we can compile without the generic if we cast down to List, but why do we need the cast? // Polygon extends SurfacePatch, so in theory this should work... //((List<SurfacePatch>) result.getPatches()).add(poly); ((List)result.getPatches()).add(poly); return result; }
/** * @inheritDoc * @see org.opengis.geometry.primitive.PrimitiveFactory#createSurface(org.opengis.geometry.primitive.SurfaceBoundary) */ public Surface createSurface(final SurfaceBoundary boundary) { // For now, our implementation has to assume that the boundary is a // polygon. Surface result = new SurfaceImpl(crs); Polygon poly = geomFact.createPolygon(boundary); // PENDING(jdc): the following line is 1.5 specific. // the result.getPatches() list is a generic list with a type of "? extends SurfacePatch" // we can compile without the generic if we cast down to List, but why do we need the cast? // Polygon extends SurfacePatch, so in theory this should work... //((List<SurfacePatch>) result.getPatches()).add(poly); ((List)result.getPatches()).add(poly); return result; }
/** * @inheritDoc * @see org.opengis.geometry.primitive.PrimitiveFactory#createSurface(org.opengis.geometry.primitive.SurfaceBoundary) */ public Surface createSurface(final SurfaceBoundary boundary) { // For now, our implementation has to assume that the boundary is a // polygon. Surface result = new SurfaceImpl(crs); Polygon poly = geomFact.createPolygon(boundary); // PENDING(jdc): the following line is 1.5 specific. // the result.getPatches() list is a generic list with a type of "? extends SurfacePatch" // we can compile without the generic if we cast down to List, but why do we need the cast? // Polygon extends SurfacePatch, so in theory this should work... //((List<SurfacePatch>) result.getPatches()).add(poly); ((List)result.getPatches()).add(poly); return result; }
public static Polygon createPolygon( final DirectPosition[] exteriorRingPoints, final DirectPosition[][] interiorRingsPoints) { final CoordinateReferenceSystem crs = exteriorRingPoints[0].getCoordinateReferenceSystem(); final GeometryFactory geometryFactory = new JTSGeometryFactory(crs); final PrimitiveFactory primitiveFactory = new JTSPrimitiveFactory(crs); final Ring exteriorRing = createRing(primitiveFactory, exteriorRingPoints); List interiorRingList = interiorRingsPoints.length == 0 ? Collections.EMPTY_LIST : new ArrayList(interiorRingsPoints.length); for (int i = 0; i < interiorRingsPoints.length; i++) { final DirectPosition[] interiorRingPoints = interiorRingsPoints[i]; interiorRingList.add(createRing(primitiveFactory,interiorRingPoints)); } final SurfaceBoundary surfaceBoundary = primitiveFactory.createSurfaceBoundary(exteriorRing, interiorRingList); return geometryFactory.createPolygon(surfaceBoundary); }
public static Polygon createPolygon( final DirectPosition[] exteriorRingPoints, final DirectPosition[][] interiorRingsPoints) { final CoordinateReferenceSystem crs = exteriorRingPoints[0].getCoordinateReferenceSystem(); final CommonFactory commonFactory = BasicFactories.getDefault(); final GeometryFactory geometryFactory = commonFactory.getGeometryFactory(crs); final PrimitiveFactory primitiveFactory = commonFactory.getPrimitiveFactory(crs); final Ring exteriorRing = createRing(primitiveFactory, exteriorRingPoints); List interiorRingList = interiorRingsPoints.length == 0 ? Collections.EMPTY_LIST : new ArrayList(interiorRingsPoints.length); for (int i = 0; i < interiorRingsPoints.length; i++) { final DirectPosition[] interiorRingPoints = interiorRingsPoints[i]; interiorRingList.add(createRing(primitiveFactory,interiorRingPoints)); } final SurfaceBoundary surfaceBoundary = primitiveFactory.createSurfaceBoundary(exteriorRing, interiorRingList); return geometryFactory.createPolygon(surfaceBoundary); }
public static Polygon createPolygon( final DirectPosition[] exteriorRingPoints, final DirectPosition[][] interiorRingsPoints) { final CoordinateReferenceSystem crs = exteriorRingPoints[0].getCoordinateReferenceSystem(); final BasicFactories commonFactory = BasicFactories.getDefault(); final GeometryFactory geometryFactory = commonFactory.getGeometryFactory(crs); final PrimitiveFactory primitiveFactory = commonFactory.getPrimitiveFactory(crs); final Ring exteriorRing = createRing(primitiveFactory, exteriorRingPoints); List interiorRingList = interiorRingsPoints.length == 0 ? Collections.EMPTY_LIST : new ArrayList(interiorRingsPoints.length); for (int i = 0; i < interiorRingsPoints.length; i++) { final DirectPosition[] interiorRingPoints = interiorRingsPoints[i]; interiorRingList.add(createRing(primitiveFactory,interiorRingPoints)); } final SurfaceBoundary surfaceBoundary = primitiveFactory.createSurfaceBoundary(exteriorRing, interiorRingList); return geometryFactory.createPolygon(surfaceBoundary); }
Polygon polygon = gf.createPolygon(boundary); ArrayList patches = new ArrayList(); patches.add(polygon);
Polygon polygon = gf.createPolygon(boundary); ArrayList patches = new ArrayList(); patches.add(polygon);
Polygon polygon = gf.createPolygon(boundary); return (JTSPolygon) polygon;