public void checkValidity(EObject element, Map featureTypeInfos) throws WFSTransactionException { // let's check we can perfom inserts, updates and deletes if ((wfs.getServiceLevel() & WFS.SERVICE_INSERT) == 0) { throw new WFSException("Transaction INSERT support is not enabled " + "(required for rollback)"); } if ((wfs.getServiceLevel() & WFS.SERVICE_UPDATE) == 0) { throw new WFSException("Transaction UPDATE support is not enabled " + "(required for rollback)"); } if ((wfs.getServiceLevel() & WFS.SERVICE_DELETE) == 0) { throw new WFSException("Transaction DELETE support is not enabled " + "(required for rollback)"); } // then, make sure we're hitting a versioning datastore RollbackType rollback = (RollbackType) element; FeatureTypeInfo info = (FeatureTypeInfo) featureTypeInfos.get(rollback.getTypeName()); try { if (!(info.getFeatureSource() instanceof VersioningFeatureSource)) { throw new WFSTransactionException("Cannot perform a rollback on " + info.getTypeName() + " since the backing data store is not versioning", "", rollback.getHandle()); } } catch (IOException e) { throw new WFSTransactionException("Cannot get the feature source for feature type " + info.getTypeName(), e, rollback.getHandle()); } // TODO: we should check the user attribute, but for the moment // we don't have an authentication subsystem }
qatts.addAttribute("", "queryable", "queryable", "", "1"); start("Layer", qatts); element("Name", ftype.getName()); element("Title", ftype.getTitle()); element("Abstract", ftype.getAbstract()); handleKeywordList(ftype.getKeywords()); element("SRS", EPSG + ftype.getSRS()); CoordinateReferenceSystem crs = CRS.decode(EPSG + ftype.getSRS()); String desc = "WKT definition of this CRS:\n" + crs; comment(desc); bbox = ftype.getBoundingBox(); llbbox = ftype.getLatLongBoundingBox(); } catch (IOException ex) { throw new RuntimeException("Can't obtain latLongBBox of " + ftype.getName() + ": " + ex.getMessage(), ex); handleBBox(bbox, EPSG + ftype.getSRS()); handleMetadataList(ftype.getMetadataLinks()); Style ftStyle = ftype.getDefaultStyle(); element("Name", ftStyle.getName()); element("Title", ftStyle.getTitle()); final ArrayList styles = ftype.getStyles();
userRequestedFilter = requestFilters.get(i); if (layer.getType() != MapLayerInfo.TYPE_RASTER) { layerDefinitionFilter = layer.getFeature().getDefinitionQuery();
@Override protected void checkAttribute(WMSMapContext con, SimpleFeatureType ft) { // find out which attribute we're going to use Map options = con.getRequest().getFormatOptions(); attribute = (String) options.get("regionateAttr"); if (attribute == null) { attribute = typeInfo.getRegionateAttribute(); } if (attribute == null) { LOGGER.log(Level.INFO, "No attribute specified, falling " + "back on geometry attribute"); attribute = ft.getGeometryDescriptor().getLocalName(); } else { // Make sure the attribute is actually there AttributeType attributeType = ft.getType(attribute); if (attributeType == null) { throw new WmsException("Could not find regionating attribute " + attribute + " in layer " + typeInfo.getName()); } } // geometry size is a double h2Type = "DOUBLE"; }
StyledLayer[] styledLayers) throws WmsException { Style style = null; String layerName = layer.getName(); StyledLayer sl; style = layer.getDefaultStyle(); type = layer.getFeatureType(); } catch (IOException ioe) { throw new RuntimeException(
featuresPerTile = typeInfo.getRegionateFeatureLimit(); if (featuresPerTile <= 1) featuresPerTile = 64; if (typeInfo.isGeometryless()) throw new WmsException(typeInfo.getName() + " is geometryless, cannot generate KML!"); LOGGER.log(Level.FINE, "Requested tile: {0}", requestedEnvelope); dataEnvelope = new ReferencedEnvelope(typeInfo .getLatLongBoundingBox(), WGS84);
if (requestedLayers[i].getType() == org.vfny.geoserver.global.Data.TYPE_VECTOR.intValue()) { FeatureTypeInfo finfo = requestedLayers[i].getFeature(); CoordinateReferenceSystem dataCRS = finfo.getFeatureType().getCoordinateReferenceSystem(); getFInfoFilter = filterFac.intersects(filterFac.property(finfo.getFeatureType().getGeometryDescriptor().getLocalName()), filterFac.literal(pixelRect)); } catch (IllegalFilterException e) { throw new WmsException(null, "Internal error : " + e.getMessage()); Query q = new DefaultQuery(finfo.getTypeName(), null, getFInfoFilter, request.getFeatureCount(), Query.ALL_NAMES, null); FeatureCollection<SimpleFeatureType, SimpleFeature> match = finfo.getFeatureSource().getFeatures(q);
if(layer instanceof FeatureTypeInfo){ vectorLayer = (FeatureTypeInfo) layer; if(!vectorLayer.isEnabled()){ continue; layerBbox = vectorLayer.getLatLongBoundingBox(); } catch (IOException e) { throw new RuntimeException("Can't obtain latLonBBox of " + vectorLayer.getName() + ": " + e.getMessage(), e);
} else if (layers[i].getType() == MapLayerInfo.TYPE_VECTOR) { if (cachingPossible) { if (layers[i].getFeature().isCachingEnabled()) { int nma = Integer.parseInt(layers[i].getFeature().getCacheMaxAge()); source = layers[i].getFeature().getFeatureSource(true);
public boolean canHandle(Object object) { try { if (!(object instanceof Feature) || object instanceof FeatureCollection) return false; Feature f = (Feature) object; FeatureTypeInfo info = catalog.getFeatureTypeInfo(f .getFeatureType().getTypeName(), f.getFeatureType() .getNamespace().toString()); return info != null && info.getFeatureSource() instanceof VersioningFeatureSource; } catch (Exception e) { LOGGER .log( Level.FINE, "Error occurred trying to determine versioning status of a feature type", e); return false; } }
legend = ((FeatureTypeInfo) layer).getLegendURL(); layerName = ((FeatureTypeInfo) layer).getName(); } else if (layer instanceof CoverageInfo) { layerName = ((CoverageInfo) layer).getName();
protected String typeSchemaLocation(WFS wfs, FeatureTypeInfo meta, String baseUrl) { final String proxifiedBase = RequestUtils.proxifiedBaseURL(baseUrl, wfs.getGeoServer().getProxyBaseUrl()); return ResponseUtils.appendQueryString(proxifiedBase + "wfs", "service=WFSV&version=1.0.0&request=DescribeVersionedFeatureType&typeName=" + meta.getName()); }
if (layers[i] != null) { if(layers[i].getFeature() != null) { useNativeBounds = layers[i].getFeature().getSRS().equalsIgnoreCase(reqSRS); } else if(layers[i].getCoverage() != null) { useNativeBounds = layers[i].getCoverage().getSrsName().equalsIgnoreCase(reqSRS); curbbox = curFTI.getLatLongBoundingBox(); } else { curbbox = curFTI.getBoundingBox();
styles.add(layers[i].getFeature().getDefaultStyle()); } else if (layers[i].getType() == MapLayerInfo.TYPE_RASTER) { styles.add(layers[i].getCoverage().getDefaultStyle()); currStyle = currLayer.getFeature().getDefaultStyle(); } else { currStyle = findStyle(request, currStyleName); .getFeatureType()); } catch (IOException e) { throw new WmsException(
FeatureTypeInfo ftype = findFeatureLayer(request, catalogLayerName); String wmsPath = ftype.getWmsPath(); rawStyles = ((rawStyles.length() > 0) ? (rawStyles + ",") : rawStyles) + ftype.getDefaultStyle().getName();
schema = layers[i].getFeatureType();
protected void checkAttribute(WMSMapContext con, SimpleFeatureType ft) { // find out which attribute we're going to use Map options = con.getRequest().getFormatOptions(); attribute = (String) options.get("regionateAttr"); if (attribute == null) attribute = typeInfo.getRegionateAttribute(); if (attribute == null) throw new WmsException( "Regionating attribute has not been specified"); // Make sure the attribute is actually there AttributeDescriptor ad = ft.getDescriptor(attribute); if (ad == null) { throw new WmsException("Could not find regionating attribute " + attribute + " in layer " + typeInfo.getName()); } // Make sure we know how to turn that attribute into a H2 type h2Type = getH2DataType(ad); if (h2Type == null) throw new WmsException("Attribute type " + ad.getType() + " is not " + "supported for external sorting on " + typeInfo.getName() + "#" + attribute); }
DifferenceQueryType query = (DifferenceQueryType) queries.get(i); FeatureTypeInfo meta = featureTypeInfo((QName) query.getTypeName()); FeatureSource source = meta.getFeatureSource();
typeNames.append(meta.getName());
final SimpleFeatureType featureType = currLayer.getFeature().getFeatureType(); matches = FeatureTypes.isDecendedFrom(featureType, null, ftc_name) || featureType.getTypeName().equalsIgnoreCase(ftc_name);