本文整理汇总了Java中org.geoserver.catalog.FeatureTypeInfo.getFeatureType方法的典型用法代码示例。如果您正苦于以下问题:Java FeatureTypeInfo.getFeatureType方法的具体用法?Java FeatureTypeInfo.getFeatureType怎么用?Java FeatureTypeInfo.getFeatureType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geoserver.catalog.FeatureTypeInfo
的用法示例。
在下文中一共展示了FeatureTypeInfo.getFeatureType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSchemaContent
import org.geoserver.catalog.FeatureTypeInfo; //导入方法依赖的package包/类
private void buildSchemaContent(FeatureTypeInfo featureTypeMeta, XSDSchema schema,
XSDFactory factory, String baseUrl)
throws IOException {
if (!findTypeInSchema(featureTypeMeta, schema, factory)) {
// build the type manually
FeatureType featureType = featureTypeMeta.getFeatureType();
if(featureTypeMeta.isCircularArcPresent() && this.getClass().equals(GML3.class)) {
featureType = new CurveTypeWrapper(featureType);
}
XSDComplexTypeDefinition xsdComplexType = buildComplexSchemaContent(featureType, schema, factory);
XSDElementDeclaration element = factory.createXSDElementDeclaration();
element.setName(featureTypeMeta.getName());
element.setTargetNamespace(featureTypeMeta.getNamespace().getURI());
synchronized(Schemas.class) {
// this call changes the global schemas too, need to be synchronized
element.setSubstitutionGroupAffiliation(getFeatureElement());
}
element.setTypeDefinition(xsdComplexType);
schema.getContents().add(element);
schema.updateElement();
}
}
示例2: validateSortBy
import org.geoserver.catalog.FeatureTypeInfo; //导入方法依赖的package包/类
void validateSortBy(List<SortBy> sortBys, FeatureTypeInfo meta, final GetFeatureRequest3D request)
throws IOException {
FeatureType featureType = meta.getFeatureType();
for (SortBy sortBy : sortBys) {
PropertyName name = sortBy.getPropertyName();
if (name.evaluate(featureType) == null) {
throw new WFSException(request, "Illegal property name: " + name.getPropertyName()
+ " for feature type " + meta.prefixedName(), "InvalidParameterValue");
}
}
}
示例3: initWfsConfiguration
import org.geoserver.catalog.FeatureTypeInfo; //导入方法依赖的package包/类
public static void initWfsConfiguration(
Configuration config, GeoServer gs, ISOFeatureTypeSchemaBuilder schemaBuilder) {
MutablePicoContainer context = config.getContext();
//seed the cache with entries from the catalog
FeatureTypeCache featureTypeCache = new FeatureTypeCache();
Collection featureTypes = gs.getCatalog().getFeatureTypes();
for (Iterator f = featureTypes.iterator(); f.hasNext();) {
FeatureTypeInfo meta = (FeatureTypeInfo) f.next();
if ( !meta.enabled() ) {
continue;
}
FeatureType featureType = null;
try {
featureType = meta.getFeatureType();
}
catch(Exception e) {
throw new RuntimeException(e);
}
featureTypeCache.put(featureType);
}
//add the wfs handler factory to handle feature elements
context.registerComponentInstance(featureTypeCache);
context.registerComponentInstance(new ISOWFSHandlerFactory(gs.getCatalog(), schemaBuilder));
}
示例4: generateSpecifiedTypes
import org.geoserver.catalog.FeatureTypeInfo; //导入方法依赖的package包/类
/**
* Internal method to print just the requested types. They should all be
* in the same namespace, that handling should be done before. This will
* not do any namespace handling, just prints up either what's in the
* schema file, or if it's not there then generates the types from their
* FeatureTypes. Also appends the global element so that the types can
* substitute as features.
*
* @param requestedTypes The requested table names.
* @param gs DOCUMENT ME!
*
* @return A string of the types printed.
*
* @throws WFSException DOCUMENT ME!
*
* @task REVISIT: We need a way to make sure the extension bases are
* correct. should likely add a field to the info.xml in the
* featureTypes folder, that optionally references an extension base
* (should it be same namespace? we could also probably just do an
* import on the extension base). This function then would see if
* the typeInfo has an extension base, and would add or import the
* file appropriately, and put the correct substitution group in
* this function.
*/
private String generateSpecifiedTypes(FeatureTypeInfo[] infos) {
//TypeRepository repository = TypeRepository.getInstance();
String tempResponse = new String();
String generatedType = new String();
Set validTypes = new HashSet();
// Loop through requested tables to add element types
for (int i = 0; i < infos.length; i++) {
FeatureTypeInfo ftInfo = (FeatureTypeInfo) infos[i];
if (!validTypes.contains(ftInfo)) {
//TODO: ressurect this
File schemaFile = null; /*ftInfo.getSchemaFile();*/
try {
//Hack here, schemaFile should not be null, but it is
//when a fType is first created, since we only add the
//schemaFile param to dto on a load. This should be
//fixed, maybe even have the schema file persist, or at
//the very least be present right after creation.
if ((schemaFile != null) && schemaFile.exists() && schemaFile.canRead()) {
generatedType = writeFile(schemaFile);
} else {
FeatureType ft = ftInfo.getFeatureType();
String gType = generateFromSchema(ft);
if ((gType != null) && (gType != "")) {
generatedType = gType;
}
}
} catch (IOException e) {
generatedType = "";
}
if (!generatedType.equals("")) {
tempResponse = tempResponse + generatedType;
validTypes.add(ftInfo);
}
}
}
// Loop through requested tables again to add elements
// NOT VERY EFFICIENT - PERHAPS THE MYSQL ABSTRACTION CAN FIX THIS;
// STORE IN HASH?
for (Iterator i = validTypes.iterator(); i.hasNext();) {
// Print element representation of table
tempResponse = tempResponse + printElement((FeatureTypeInfo) i.next());
}
tempResponse = tempResponse + "\n\n";
return tempResponse;
}
示例5: parse
import org.geoserver.catalog.FeatureTypeInfo; //导入方法依赖的package包/类
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
//pre process parsee tree to make sure types match up
FeatureTypeInfo meta = catalog.getFeatureTypeByName(instance.getNamespace(), instance.getName());
if (meta != null) {
FeatureType featureType = meta.getFeatureType();
//go through each attribute, performing various hacks to make make sure things
// cocher
for (PropertyDescriptor pd : featureType.getDescriptors()) {
if (pd instanceof AttributeDescriptor) {
AttributeDescriptor attributeType = (AttributeDescriptor) pd;
String name = attributeType.getLocalName();
Class type = attributeType.getType().getBinding();
if ("boundedBy".equals(name)) {
Node boundedByNode = node.getChild("boundedBy");
//hack 1: if boundedBy is in the parse tree has a bounding box and the attribute
// needs a polygon, convert
if (boundedByNode.getValue() instanceof Envelope) {
Envelope bounds = (Envelope) boundedByNode.getValue();
/*if (type.isAssignableFrom(Surface.class)) {
Polygon polygon = polygon(bounds);
boundedByNode.setValue(polygon);
} else if (type.isAssignableFrom(MultiPolygon.class)) {
MultiPolygon multiPolygon = geometryFactory.createMultiPolygon(new Polygon[] {
polygon(bounds)
});
boundedByNode.setValue(multiPolygon);
}*/
}
}
}
}
}
return super.parse(instance, node, value);
}