/** Construct <code>LabelCacheItem</code>. */ public LabelCacheItem( String layerId, TextStyle2D textStyle, LiteShape2 shape, String label, TextSymbolizer symbolizer) { this.textStyle = textStyle; this.geoms.add(shape.getGeometry()); this.label = label; this.layerIds.add(layerId); this.symbolizer = symbolizer; }
/** * Filling multipolygons might result in holes where two polygons overlap. In this method we * work around that by drawing each polygon as a separate shape * * @param g * @param shape */ void fillLiteShape(Graphics2D g, LiteShape2 shape) { if (shape.getGeometry() instanceof MultiPolygon && shape.getGeometry().getNumGeometries() > 1) { MultiPolygon mp = (MultiPolygon) shape.getGeometry(); for (int i = 0; i < mp.getNumGeometries(); i++) { Polygon p = (Polygon) mp.getGeometryN(i); try { g.fill(new LiteShape2(p, null, null, false, false)); } catch (Exception e) { // should not really happen, but anyways throw new RuntimeException( "Unexpected error occurred while rendering a multipolygon", e); } } } else { g.fill(shape); } }
groupItem.getGeoms().add(shape.getGeometry());
env.expandBy(clipBuffer); final GeometryClipper clipper = new GeometryClipper(env); Geometry source = shape.getGeometry(); || source instanceof MultiPolygon); Geometry g = clipper.clipSafe(shape.getGeometry(), preserveTopology, 1);
/** * Construct <code>LabelCacheItem</code>. */ public LabelCacheItem(String layerId, TextStyle2D textStyle, LiteShape2 shape, String label) { this.textStyle = textStyle; this.geoms.add(shape.getGeometry()); this.label = label; this.layerIds.add(layerId); }
/** * Construct <code>LabelCacheItem</code>. */ public LabelCacheItem(String layerId, TextStyle2D textStyle, LiteShape2 shape, String label) { this.textStyle=textStyle; this.geoms.add(shape.getGeometry()); this.label = label; this.layerIds.add(layerId); }
JTS.transform(first.getGeometry(), sa.xform.inverse()); return getTransformedShape(RendererUtilities.getCentroid(tx), sa); } else {
/** * Extracts a ath iterator from the shape * @param shape * @return */ private PathIterator getPathIterator(final LiteShape2 shape) { // DJB: changed this to handle multi* geometries and line and // polygon geometries better GeometryCollection gc; if (shape.getGeometry() instanceof GeometryCollection) gc = (GeometryCollection) shape.getGeometry(); else { Geometry[] gs = new Geometry[1]; gs[0] = shape.getGeometry(); gc = shape.getGeometry().getFactory().createGeometryCollection( gs); // make a Point,Line, or Poly into a GC } GeomCollectionIterator citer = new GeomCollectionIterator(gc, IDENTITY_TRANSFORM, false, 1.0); return citer; }
/** * Extracts a ath iterator from the shape * @param shape * @return */ private GeomCollectionIterator getPathIterator(final LiteShape2 shape) { // DJB: changed this to handle multi* geometries and line and // polygon geometries better GeometryCollection gc; if (shape.getGeometry() instanceof GeometryCollection) gc = (GeometryCollection) shape.getGeometry(); else { Geometry[] gs = new Geometry[1]; gs[0] = shape.getGeometry(); gc = shape.getGeometry().getFactory().createGeometryCollection( gs); // make a Point,Line, or Poly into a GC } GeomCollectionIterator citer = new GeomCollectionIterator(gc, IDENTITY_TRANSFORM, false, 1.0); return citer; }
/** * Filling multipolygons might result in holes where two polygons overlap. In this method we * work around that by drawing each polygon as a separate shape * @param g * @param shape */ void fillLiteShape(Graphics2D g, LiteShape2 shape) { if(shape.getGeometry() instanceof MultiPolygon && shape.getGeometry().getNumGeometries() > 1) { MultiPolygon mp = (MultiPolygon) shape.getGeometry(); for (int i = 0; i < mp.getNumGeometries(); i++) { Polygon p = (Polygon) mp.getGeometryN(i); try { g.fill(new LiteShape2(p, null, null, false, false)); } catch(Exception e) { // should not really happen, but anyways throw new RuntimeException("Unexpected error occurred while rendering a multipolygon", e); } } } else { g.fill(shape); } }
lci.getGeoms().add(shape.getGeometry());
if (shape.getGeometry() instanceof GeometryCollection) gc = (GeometryCollection) shape.getGeometry(); else { Geometry[] gs = new Geometry[1]; gs[0] = shape.getGeometry(); gc = shape.getGeometry().getFactory().createGeometryCollection(
lci.getGeoms().add(shape.getGeometry());
env.expandBy(size); final GeometryClipper clipper = new GeometryClipper(env); Geometry g = clipper.clip(shape.getGeometry(), false); if(g != shape.getGeometry()) { shape = new LiteShape2(g, null, null, false);
Geometry tx = JTS.transform(first.getGeometry(), sa.xform.inverse()); return getTransformedShape(RendererUtilities.getCentroid(tx), sa); } else {