/** * Adds the common coordinate bits back into a Geometry. * The coordinates of the Geometry are changed. * * @param geom the Geometry to which to add the common coordinate bits */ public void addCommonBits(Geometry geom) { Translater trans = new Translater(commonCoord); geom.apply(trans); geom.geometryChanged(); }
/** * Removes the common coordinate bits from a Geometry. * The coordinates of the Geometry are changed. * * @param geom the Geometry from which to remove the common coordinate bits * @return the shifted Geometry */ public Geometry removeCommonBits(Geometry geom) { if (commonCoord.x == 0.0 && commonCoord.y == 0.0) return geom; Coordinate invCoord = new Coordinate(commonCoord); invCoord.x = -invCoord.x; invCoord.y = -invCoord.y; Translater trans = new Translater(invCoord); geom.apply(trans); geom.geometryChanged(); return geom; }
public void geometryChanged() { geometry.geometryChanged(); }
/** * Adds the common coordinate bits back into a Geometry. * The coordinates of the Geometry are changed. * * @param geom the Geometry to which to add the common coordinate bits */ public void addCommonBits(Geometry geom) { Translater trans = new Translater(commonCoord); geom.apply(trans); geom.geometryChanged(); }
/** * Removes the common coordinate bits from a Geometry. * The coordinates of the Geometry are changed. * * @param geom the Geometry from which to remove the common coordinate bits * @return the shifted Geometry */ public Geometry removeCommonBits(Geometry geom) { if (commonCoord.x == 0.0 && commonCoord.y == 0.0) return geom; Coordinate invCoord = new Coordinate(commonCoord); invCoord.x = -invCoord.x; invCoord.y = -invCoord.y; Translater trans = new Translater(invCoord); geom.apply(trans); geom.geometryChanged(); return geom; }
/** * Extracts the * * @param sf * @param context * @return */ private Geometry getFeatureGeometry(SimpleFeature sf, final double height) { Geometry geom = (Geometry) sf.getDefaultGeometry(); if (!Double.isNaN(height) && height != 0) { geom.apply(new CoordinateFilter() { public void filter(Coordinate c) { c.setCoordinate(new Coordinate(c.x, c.y, height)); } }); geom.geometryChanged(); } return geom; }
private void dragGeometryNode(int mx, int my) { Coordinate mouseCoord = map2D.getRenderingStrategy().toMapCoord(mx, my); Geometry geo = geoms.get(0); Set<Geometry> set = editedNodes.keySet(); for (Iterator<Geometry> ite = set.iterator(); ite.hasNext();) { Geometry subgeo = ite.next(); Integer[] nodeIndexes = editedNodes.get(subgeo); for (int index : nodeIndexes) { subgeo.getCoordinates()[index].x = mouseCoord.x; subgeo.getCoordinates()[index].y = mouseCoord.y; } subgeo.geometryChanged(); } clearMemoryLayer(); setMemoryLayerGeometry(geoms); }
private void dragGeometryNode(int mx, int my) { Coordinate mouseCoord = map2D.getRenderingStrategy().toMapCoord(mx, my); Geometry geo = geoms.get(0); Set<Geometry> set = editedNodes.keySet(); for (Iterator<Geometry> ite = set.iterator(); ite.hasNext();) { Geometry subgeo = ite.next(); Integer[] nodeIndexes = editedNodes.get(subgeo); for (int index : nodeIndexes) { subgeo.getCoordinates()[index].x = mouseCoord.x; subgeo.getCoordinates()[index].y = mouseCoord.y; } subgeo.geometryChanged(); } clearMemoryLayer(); setMemoryLayerGeometry(geoms); }
private void dragGeometryNode(int mx, int my) { Coordinate mouseCoord = map2D.getRenderingStrategy().toMapCoord(mx, my); Geometry geo = geoms.get(0); Set<Geometry> set = editedNodes.keySet(); for (Iterator<Geometry> ite = set.iterator(); ite.hasNext();) { Geometry subgeo = ite.next(); Integer[] nodeIndexes = editedNodes.get(subgeo); for (int index : nodeIndexes) { subgeo.getCoordinates()[index].x = mouseCoord.x; subgeo.getCoordinates()[index].y = mouseCoord.y; } subgeo.geometryChanged(); } clearMemoryLayer(); setMemoryLayerGeometry(geoms); }
private void dragGeometryNode(int mx, int my) { Coordinate mouseCoord = map2D.getRenderingStrategy().toMapCoord(mx, my); Geometry geo = geoms.get(0); Set<Geometry> set = editedNodes.keySet(); for (Iterator<Geometry> ite = set.iterator(); ite.hasNext();) { Geometry subgeo = ite.next(); Integer[] nodeIndexes = editedNodes.get(subgeo); for (int index : nodeIndexes) { subgeo.getCoordinates()[index].x = mouseCoord.x; subgeo.getCoordinates()[index].y = mouseCoord.y; } subgeo.geometryChanged(); } clearMemoryLayer(); setMemoryLayerGeometry(geoms); }
/** * Switches the coordinates of a JTS Geometry. * * @param <G> * the geometry type * @param geometry * Geometry to switch coordinates. * @return Geometry with switched coordinates */ public static <G extends Geometry> G switchCoordinateAxisOrder(G geometry) { if (geometry == null) { return null; } @SuppressWarnings("unchecked") G geom = (G) geometry.clone(); geom.apply(COORDINATE_SWITCHING_FILTER); geom.geometryChanged(); return geom; }
private void dragGeometryNode(int mx, int my) { Coordinate mouseCoord = map2D.getRenderingStrategy().toMapCoord(mx, my); Geometry geo = geoms.get(0); Set<Geometry> set = editedNodes.keySet(); for (Iterator<Geometry> ite = set.iterator(); ite.hasNext();) { Geometry subgeo = ite.next(); Integer[] nodeIndexes = editedNodes.get(subgeo); for (int index : nodeIndexes) { subgeo.getCoordinates()[index].x = mouseCoord.x; subgeo.getCoordinates()[index].y = mouseCoord.y; } subgeo.geometryChanged(); } clearMemoryLayer(); setMemoryLayerGeometry(geoms); }
private void dragGeometryNode(int mx, int my) { Coordinate mouseCoord = map2D.getRenderingStrategy().toMapCoord(mx, my); Geometry geo = geoms.get(0); Set<Geometry> set = editedNodes.keySet(); for (Iterator<Geometry> ite = set.iterator(); ite.hasNext();) { Geometry subgeo = ite.next(); Integer[] nodeIndexes = editedNodes.get(subgeo); for (int index : nodeIndexes) { subgeo.getCoordinates()[index].x = mouseCoord.x; subgeo.getCoordinates()[index].y = mouseCoord.y; } subgeo.geometryChanged(); } clearMemoryLayer(); setMemoryLayerGeometry(geoms); }
private void dragGeometryNode(int mx, int my) { Coordinate mouseCoord = map2D.getRenderingStrategy().toMapCoord(mx, my); Geometry geo = geoms.get(0); Set<Geometry> set = editedNodes.keySet(); for (Iterator<Geometry> ite = set.iterator(); ite.hasNext();) { Geometry subgeo = ite.next(); Integer[] nodeIndexes = editedNodes.get(subgeo); for (int index : nodeIndexes) { subgeo.getCoordinates()[index].x = mouseCoord.x; subgeo.getCoordinates()[index].y = mouseCoord.y; } subgeo.geometryChanged(); } clearMemoryLayer(); setMemoryLayerGeometry(geoms); }
geom.geometryChanged();//applies to call component Geometries return crossings[0];
geom.geometryChanged();//applies to call component Geometries return crossings[0];
if (decimator != null) { decimator.decimateTransformGeneralize(this.geometry,this.mathTransform); this.geometry.geometryChanged(); } else { this.geometry.geometryChanged(); this.geometry.geometryChanged();
geom.geometryChanged(); geom.geometryChanged(); shape = new LiteShape2(geom, null, null, false, false);
representativeGeom.geometryChanged(); // djb -- jessie should