public CanvasPath(Geometry geometry) { this.geometry = geometry; bounds = GeometryService.getBounds(geometry); }
@Override public GeometryValidationState validate(Geometry geometry, GeometryIndex index) { if (GeometryService.getNumPoints(geometry) > 7) { rollBack = true; return GeometryValidationState.INVALID_COORDINATE; } rollBack = false; return GeometryValidationState.VALID; }
public Geometry transform(Geometry geometry, Matrix matrix) { Geometry copy = GeometryService.clone(geometry); transformInplace(copy, matrix); return copy; }
public void execute(Bbox worldBounds) { mapPresenter.getFeatureService().search(GeometryService.toPolygon(worldBounds), 0, QueryType.INTERSECTS, searchLayerType, intersectionRatio, new SelectionCallback(shift, true)); }
@Override public boolean isEmpty(Geometry geometry) { return org.geomajas.geometry.service.GeometryService.isEmpty(geometry); }
@Override public double getArea(Geometry geometry) { return org.geomajas.geometry.service.GeometryService.getArea(geometry); }
@Override public void getSnappingSources(final GeometryArrayFunction callback) { if (fetch) { final VectorServerLayer layer = (VectorServerLayer) mapPresenter.getLayersModel().getLayer(1); GeomajasServerExtension .getInstance() .getServerFeatureService() .search(mapPresenter.getViewPort().getCrs(), layer, GeometryService.toPolygon(mapBounds), 0.0, new FeatureMapFunction() { @Override public void execute(Map<FeaturesSupported, List<Feature>> featureMap) { List<Feature> features = featureMap.get(layer); Geometry[] geometries = new Geometry[features.size()]; for (int i = 0; i < features.size(); i++) { geometries[i] = features.get(i).getGeometry(); } callback.execute(geometries); } }); } }
if (GeometryService.isEmpty(geometry)) { jts = createEmpty(factory, geometryType); } else if (Geometry.POINT.equals(geometryType)) {
public CanvasPath(Geometry geometry) { this.geometry = geometry; bounds = GeometryService.getBounds(geometry); }
@Override public double getNumPoints(Geometry geometry) { return org.geomajas.geometry.service.GeometryService.getNumPoints(geometry); }
/** * {@inheritDoc} */ public Geometry transform(Geometry geometry, RenderSpace from, RenderSpace to) { switch (from) { case SCREEN: switch (to) { case SCREEN: return GeometryService.clone(geometry); case WORLD: return screenToWorld(geometry); } case WORLD: switch (to) { case SCREEN: return worldToScreen(geometry); case WORLD: return GeometryService.clone(geometry); } } return geometry; }
/** * Calculate max bounds based on the map's max bounds, combined with the layer's bounds. * @return Polygon based on the max bounds bbox. */ private Geometry getMaxBoundsAsGeometry() { ClientMapInfo mapModel = territoryMap.getMapModel().getMapInfo(); Bbox result = mapModel.getMaxBounds(); for (ClientLayerInfo layer : mapModel.getLayers()) { result = BboxService.union(result, layer.getMaxExtent()); } if (result == null || result.getHeight() == 0 || result.getWidth() == 0) { result = new Bbox(); result.setX(Double.MIN_VALUE); result.setY(Double.MIN_VALUE); result.setMaxX(Double.MAX_VALUE); result.setMaxY(Double.MAX_VALUE); } return GeometryService.toPolygon(result); }
public Bbox getBounds() { if (bounds == null && !features.isEmpty()) { for (Feature feature : features) { org.geomajas.geometry.Geometry geom = feature.getGeometry(); if (geom != null) { Bbox b = GeometryService.getBounds(geom); if (bounds == null) { bounds = b; } else { bounds = BboxService.union(bounds, b); } } } } return bounds; }
public VectorObject toShape(Geometry geometry) { if (geometry != null) { if (GeometryService.getNumPoints(geometry) == 0) { return null; } if (Geometry.POINT.equals(geometry.getGeometryType())) { return toShapePoint(geometry); } else if (Geometry.MULTI_POINT.equals(geometry.getGeometryType())) { return toShapeMultiPoint(geometry); } else { return new GeometryPath(geometry); } } return null; }
@Override public Geometry transform(Geometry geometry, RenderSpace from, RenderSpace to) { switch (from) { case SCREEN: switch (to) { case SCREEN: return GeometryService.clone(geometry); case WORLD: return screenToWorld(geometry); } case WORLD: switch (to) { case SCREEN: return worldToScreen(geometry); case WORLD: return GeometryService.clone(geometry); } } return geometry; }
private void zoomToGeometry() { if (getGeometryStatus().equals(GeometryStatus.ONE)) { Bbox geometryBounds = GeometryService.getBounds(geometryOfCurrentGroup); zoomToRectangleController.performSelection(geometryBounds); } else { Window.alert(MESSAGES.securityGroupWarningCantZoomToGeometry()); } }
@Override public VectorObject toShape(Geometry geometry) { if (geometry != null) { if (GeometryService.getNumPoints(geometry) == 0) { return null; } if (Geometry.POINT.equals(geometry.getGeometryType())) { return toShapePoint(geometry); } else if (Geometry.MULTI_POINT.equals(geometry.getGeometryType())) { return toShapeMultiPoint(geometry); } else { return new GeometryPath(geometry); } } return null; }
Bbox bounds = GeometryService.getBounds(convertorService .toDto(geodesk.getOwner().getGeometry())); mainMap.setMaxBounds(bounds); Territory territory = ((DeskmanagerSecurityContext) securityContext).getTerritory(); if (territory != null) { Bbox bounds = GeometryService.getBounds(convertorService .toDto(territory.getGeometry())); mainMap.setMaxBounds(bounds);
Bbox bounds = GeometryService.getBounds(convertorService .toDto(geodesk.getOwner().getGeometry())); mainMap.setMaxBounds(bounds); Territory territory = ((DeskmanagerSecurityContext) securityContext).getTerritory(); if (territory != null) { Bbox bounds = GeometryService.getBounds(convertorService .toDto(territory.getGeometry())); mainMap.setMaxBounds(bounds);