((FeatureTypeType) eObject).setDefaultSRS(crs); } else if ("Keywords".equals(property)) { if (value instanceof String) { kwd.getKeyword().add(kw); ((FeatureTypeType) eObject).getKeywords().add(kwd); return;
@Override public String getDescription() { return eType.getAbstract(); }
@Override public String getDefaultSRS() { return eType.getDefaultSRS(); }
@Override public FeatureTypeType translateTypeInfo(FeatureTypeType typeInfo) { if ("wfs".equals(typeInfo.getName().getPrefix()) || "http://www.opengis.net/wfs".equals(typeInfo.getName().getNamespaceURI())) { QName newName = new QName( "http://mapserver.gis.umn.edu/mapserver", typeInfo.getName().getLocalPart(), "ms"); typeInfo.setName(newName); } return typeInfo; }
@Override public URI getSchema() { String namespaceURI = eType.getName().getNamespaceURI(); try { return XMLConstants.NULL_NS_URI.equals(namespaceURI) ? null : new URI(namespaceURI); } catch (URISyntaxException e) { return null; } }
/** * @see WFSProtocol#getSupportedCRSIdentifiers(String) */ public Set<String> getSupportedCRSIdentifiers(String typeName) { FeatureTypeType featureTypeInfo = getFeatureTypeInfo(typeName); // TODO: another wrong emf mapping: getOtherSRS():String? should be a list String defaultSRS = featureTypeInfo.getDefaultSRS(); List<String> otherSRS = featureTypeInfo.getOtherSRS(); Set<String> ftypeCrss = new HashSet<String>(); ftypeCrss.add(defaultSRS); ftypeCrss.addAll(otherSRS); return ftypeCrss; }
@Override public Set<String> getKeywords() { @SuppressWarnings("unchecked") List<KeywordsType> keywords = eType.getKeywords(); Set<String> ret; if (keywords == null) { ret = Collections.emptySet(); } else { ret = new HashSet<String>(); for (KeywordsType k : keywords) { ret.addAll(k.getKeyword()); } ret.remove(null); } return ret; }
@Override public Set<String> getOutputFormats() { final OutputFormatListType outputFormats = eType.getOutputFormats(); if (null == outputFormats) { return Collections.emptySet(); } @SuppressWarnings("unchecked") List<String> ftypeDeclaredFormats = outputFormats.getFormat(); if (null == ftypeDeclaredFormats || ftypeDeclaredFormats.isEmpty()) { return Collections.emptySet(); } return new HashSet<String>(ftypeDeclaredFormats); }
@Override public String getTitle() { return eType.getTitle(); }
@Override public ReferencedEnvelope getWGS84BoundingBox() { @SuppressWarnings("unchecked") List<WGS84BoundingBoxType> bboxList = eType.getWGS84BoundingBox(); if (bboxList != null && bboxList.size() > 0) { WGS84BoundingBoxType bboxType = bboxList.get(0); @SuppressWarnings("unchecked") List<Double> lowerCorner = bboxType.getLowerCorner(); @SuppressWarnings("unchecked") List<Double> upperCorner = bboxType.getUpperCorner(); double minLon = (Double) lowerCorner.get(0); double minLat = (Double) lowerCorner.get(1); double maxLon = (Double) upperCorner.get(0); double maxLat = (Double) upperCorner.get(1); ReferencedEnvelope latLonBounds = new ReferencedEnvelope( minLon, maxLon, minLat, maxLat, DefaultGeographicCRS.WGS84); return latLonBounds; } return null; }
@SuppressWarnings("unchecked") @Override public List<String> getOtherSRS() { return eType.getOtherSRS(); }
/** * Sets ith "FeatureType" element */ public void setFeatureTypeArray(int i, net.opengis.wfs.FeatureTypeType featureType) { synchronized (monitor()) { check_orphaned(); net.opengis.wfs.FeatureTypeType target = null; target = (net.opengis.wfs.FeatureTypeType)get_store().find_element_user(FEATURETYPE$2, i); if (target == null) { throw new IndexOutOfBoundsException(); } target.set(featureType); } }
@Override public String getName() { return config.localTypeName(eType.getName()); }
@Override public Set<String> getKeywords() { @SuppressWarnings("unchecked") List<KeywordsType> keywords = eType.getKeywords(); Set<String> ret; if (keywords == null) { ret = Collections.emptySet(); } else { ret = new HashSet<String>(); for (KeywordsType k : keywords) { ret.addAll(k.getKeyword()); } ret.remove(null); } return ret; }
@Override public FeatureTypeType translateTypeInfo(FeatureTypeType typeInfo) { if ("wfs".equals(typeInfo.getName().getPrefix()) || "http://www.opengis.net/wfs".equals(typeInfo.getName().getNamespaceURI())) { QName newName = new QName( "http://mapserver.gis.umn.edu/mapserver", typeInfo.getName().getLocalPart(), "ms"); typeInfo.setName(newName); } return typeInfo; }
@Override public Set<String> getOutputFormats() { final OutputFormatListType outputFormats = eType.getOutputFormats(); if (null == outputFormats) { return Collections.emptySet(); } @SuppressWarnings("unchecked") List<String> ftypeDeclaredFormats = outputFormats.getFormat(); if (null == ftypeDeclaredFormats || ftypeDeclaredFormats.isEmpty()) { return Collections.emptySet(); } return new HashSet<String>(ftypeDeclaredFormats); }
@Override public String getTitle() { return eType.getTitle(); }
@Override public ReferencedEnvelope getWGS84BoundingBox() { @SuppressWarnings("unchecked") List<WGS84BoundingBoxType> bboxList = eType.getWGS84BoundingBox(); if (bboxList != null && bboxList.size() > 0) { WGS84BoundingBoxType bboxType = bboxList.get(0); @SuppressWarnings("unchecked") List<Double> lowerCorner = bboxType.getLowerCorner(); @SuppressWarnings("unchecked") List<Double> upperCorner = bboxType.getUpperCorner(); double minLon = (Double) lowerCorner.get(0); double minLat = (Double) lowerCorner.get(1); double maxLon = (Double) upperCorner.get(0); double maxLat = (Double) upperCorner.get(1); ReferencedEnvelope latLonBounds = new ReferencedEnvelope( minLon, maxLon, minLat, maxLat, DefaultGeographicCRS.WGS84); return latLonBounds; } return null; }
@SuppressWarnings("unchecked") @Override public List<String> getOtherSRS() { return eType.getOtherSRS(); }
@Override public void setCapabilities(WFSGetCapabilities capabilities) { WFSCapabilitiesType caps = (WFSCapabilitiesType) capabilities.getParsedCapabilities(); this.capabilities = caps; String version = caps.getVersion(); try { this.serviceVersion = Versions.find(version); } catch (IllegalArgumentException e) { LOGGER.warning( "Capabilities document didn't advertise a supported version (" + version + "). Defaulting to " + this.serviceVersion); } typeInfos.clear(); FeatureTypeListType featureTypeList = this.capabilities.getFeatureTypeList(); if (featureTypeList == null || featureTypeList.getFeatureType().isEmpty()) { Loggers.MODULE.info( "WFS Server contains no FeatureTypes: " + getOperationURI(GET_CAPABILITIES, GET)); return; } @SuppressWarnings("unchecked") List<FeatureTypeType> featureTypes = featureTypeList.getFeatureType(); for (FeatureTypeType typeInfo : featureTypes) { FeatureTypeType transTypeInfo = translateTypeInfo(typeInfo); QName name = transTypeInfo.getName(); typeInfos.put(name, transTypeInfo); } }