• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FeatureTypeInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.geoserver.catalog.FeatureTypeInfo的典型用法代码示例。如果您正苦于以下问题:Java FeatureTypeInfo类的具体用法?Java FeatureTypeInfo怎么用?Java FeatureTypeInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FeatureTypeInfo类属于org.geoserver.catalog包,在下文中一共展示了FeatureTypeInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: afterTransactionInternal

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
private void afterTransactionInternal(final TransactionType transaction, boolean committed) {
    log.fine("Detected change to data, updating bounds of affected featuer types and layer groups");
    
    final Map<Name, Collection<ReferencedEnvelope>> byLayerDirtyRegions = getByLayerDirtyRegions(transaction);
    if (byLayerDirtyRegions.isEmpty()) {
        return;
    }
    byLayerDirtyRegions.entrySet().stream().forEach(e->{
        FeatureTypeInfo fti = catalog.getFeatureTypeByName(e.getKey());
        try{
            merge(fti.getNativeBoundingBox(), e.getValue()).ifPresent(dirtyRegion->{
                // Update the feature type
                updateFeatureType(fti, dirtyRegion);
                // Update all the layer groups that use it, directly or indirectly
                StreamSupport.stream(getLayerGroupsFor(fti).spliterator(), false)
                    .forEach(lgi->updateLayerGroup(lgi, dirtyRegion));
            });
        } catch (Exception ex) {
            log.log(Level.WARNING, ex.getMessage(), ex);
            return;
        }
    });
 
}
 
开发者ID:MapStory,项目名称:ms-gs-plugins,代码行数:25,代码来源:BoundsUpdateTransactionListener.java


示例2: addGeometryProperties

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
protected List<PropertyName> addGeometryProperties (FeatureTypeInfo meta, List<PropertyName> oldProperties) throws IOException {
    List<AttributeTypeInfo> atts = meta.attributes();
    Iterator ii = atts.iterator();
    
    List<PropertyName> properties = new ArrayList<PropertyName>(oldProperties);

    while (ii.hasNext()) {
        AttributeTypeInfo ati = (AttributeTypeInfo) ii.next();
        PropertyName propName = filterFactory.property (ati.getName());
        
        if(meta.getFeatureType().getDescriptor(ati.getName()) instanceof GeometryDescriptor
                && !properties.contains(propName) ) {
            properties.add(propName);
        }
    }
    
    return properties;
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:19,代码来源:GetFeature3D.java


示例3: write

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
protected void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
    Operation describeFeatureType) throws IOException {
    WFSInfo wfs = getInfo();
    
    //generates response, using general function
    String xmlResponse = generateTypes(featureTypeInfos, (DescribeFeatureTypeType) describeFeatureType.getParameters()[0]);

    if (!wfs.getGeoServer().getSettings().isVerbose()) {
        //strip out the formatting.  This is pretty much the only way we
        //can do this, as the user files are going to have newline
        //characters and whatnot, unless we can get rid of formatting
        //when we read the file, which could be worth looking into if
        //this slows things down.
        xmlResponse = xmlResponse.replaceAll(">\n[ \\t\\n]*", ">");
        xmlResponse = xmlResponse.replaceAll("\n[ \\t\\n]*", " ");
    }

    Writer writer = new OutputStreamWriter(output, wfs.getGeoServer().getSettings().getCharset());
    writer.write(xmlResponse);
    writer.flush();
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:22,代码来源:XmlSchemaEncoder_ISO.java


示例4: allSameType

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
/**
 * Checks that the collection of featureTypeNames all have the same prefix.
 * Used to determine if their schemas are all in the same namespace or if
 * imports need to be done.
 *
 * @param  infos list of feature type info objects..
 *
 * @return true if all the types in the collection have the same prefix.
 *
 */
public boolean allSameType(FeatureTypeInfo[] infos) {
    boolean sameType = true;

    if (infos.length == 0) {
        return false;
    }

    FeatureTypeInfo first = infos[0];

    for (int i = 0; i < infos.length; i++) {
        FeatureTypeInfo ftInfo = infos[i];

        if (!first.getNamespace().equals(ftInfo.getNamespace())) {
            return false;
        }
    }

    return sameType;
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:30,代码来源:XmlSchemaEncoder_ISO.java


示例5: 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();
     }
 }
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:26,代码来源:ISOFeatureTypeSchemaBuilder.java


示例6: write

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
protected void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
    Operation describeFeatureType) throws IOException {
    
    //hack for SOAP request, when encoding as SOAP response the schema is actually required
    // to be encoded in base64
    if (Dispatcher.REQUEST.get() != null && Dispatcher.REQUEST.get().isSOAP()) {
        
        
        output.write(("<wfs:DescribeFeatureTypeResponse xmlns:wfs='" 
            + getWFSNamespaceURI() + "'>").getBytes());
        
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        doWrite(featureTypeInfos, bout, describeFeatureType);
        output.write(Base64.encodeBase64(bout.toByteArray()));
        
        output.write("</wfs:DescribeFeatureTypeResponse>".getBytes());
    }
    else {
        //normal write
        doWrite(featureTypeInfos, output, describeFeatureType);
    }
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:23,代码来源:XmlSchemaEncoder_ISO.java


示例7: testImportBuildings

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
/**
 * Try to re-import buildings as another layer (different name, different projection)
 */
@Test
public void testImportBuildings() throws Exception {
    FeatureTypeInfo ti = getCatalog()
            .getFeatureTypeByName(getLayerId(SystemTestData.BUILDINGS));
    SimpleFeatureCollection rawSource = (SimpleFeatureCollection) ti.getFeatureSource(null,
            null).getFeatures();
    ForceCoordinateSystemFeatureResults forced = new ForceCoordinateSystemFeatureResults(
            rawSource, CRS.decode("EPSG:4326"));

    ImportProcess importer = new ImportProcess(getCatalog());
    String result = importer.execute(forced, null, SystemTestData.CITE_PREFIX,
            SystemTestData.CITE_PREFIX, "Buildings2", null, null, null);

    checkBuildings2(result);
}
 
开发者ID:geosolutions-it,项目名称:soil_sealing,代码行数:19,代码来源:ImportProcessTest.java


示例8: dataStoreChangeInternal

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
private void dataStoreChangeInternal(final TransactionEvent event) {
    final Object source = event.getSource();
    if (!(source instanceof InsertElementType || source instanceof UpdateElementType)) {
        // We only care about operations that potentially the bounds.
        return;
    }
    
    final EObject originatingTransactionRequest = (EObject) source;
    Objects.requireNonNull(originatingTransactionRequest, "No original transaction request exists");
    final TransactionEventType type = event.getType();
    if (TransactionEventType.POST_INSERT.equals(type)) {
        // no need to compute the bounds, they're the same as for PRE_INSERT
        return;
    }
    
    final Name featureTypeName = new NameImpl(event.getLayerName());
    final FeatureTypeInfo fti = catalog.getFeatureTypeByName(featureTypeName);
    if(Objects.isNull(fti)) {
        return;
    }
    
    final SimpleFeatureCollection affectedFeatures = event.getAffectedFeatures();
    final ReferencedEnvelope affectedBounds = affectedFeatures.getBounds();
    
    final TransactionType transaction = event.getRequest();
    
    addDirtyRegion(transaction, featureTypeName, affectedBounds);
}
 
开发者ID:MapStory,项目名称:ms-gs-plugins,代码行数:29,代码来源:BoundsUpdateTransactionListener.java


示例9: updateFeatureType

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
void updateFeatureType(FeatureTypeInfo fti, ReferencedEnvelope dirtyRegion) {
    log.fine(()->"Updating bounds of "+fti.prefixedName()+" in response to data change");
    ReferencedEnvelope bounds = fti.getNativeBoundingBox();
    bounds.expandToInclude(dirtyRegion); // CRSes should already match
    fti.setNativeBoundingBox(bounds);
    catalog.save(fti);
}
 
开发者ID:MapStory,项目名称:ms-gs-plugins,代码行数:8,代码来源:BoundsUpdateTransactionListener.java


示例10: getLayerGroupsFor

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
private Iterable<LayerGroupInfo> getLayerGroupsFor(final FeatureTypeInfo featureType) {
    List<LayerGroupInfo> layerGroups = new ArrayList<LayerGroupInfo>();
    
    // get the layers whose default style is that style, they might be in layer groups
    // using their default style
    Iterable<LayerInfo> layers = catalog.getLayers(featureType);

    // build a query retrieving the first list of candidates
    List<Filter> filters = new ArrayList<>();
    for (LayerInfo layer : layers) {
        filters.add(ff.equal(ff.property("layers.id"), ff.literal(layer.getId()), true, MatchAction.ANY));
        filters.add(ff.equal(ff.property("rootLayer.id"), ff.literal(layer.getId()), true));
    }
    Or groupFilter = ff.or(filters);
    
    try(CloseableIterator<LayerGroupInfo> it = catalog.list(LayerGroupInfo.class, groupFilter)) {
        while(it.hasNext()) {
            LayerGroupInfo lg = it.next();
            layerGroups.add(lg);
        }
    } catch (Exception e) {
        log.log(Level.SEVERE, "Failed to load groups associated with feature type " + featureType.prefixedName(), e);
    }
    
    loadGroupParents(layerGroups); 
    
    return layerGroups;
}
 
开发者ID:MapStory,项目名称:ms-gs-plugins,代码行数:29,代码来源:BoundsUpdateTransactionListener.java


示例11: setUp

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    catalog = EasyMock.createMock("catalog", Catalog.class);
    featureType1 = EasyMock.createMock("featureType1", FeatureTypeInfo.class);
    featureType2 = EasyMock.createMock("featureType2", FeatureTypeInfo.class);
    
    listener = new BoundsUpdateTransactionListener(catalog);
}
 
开发者ID:MapStory,项目名称:ms-gs-plugins,代码行数:9,代码来源:BoundsUpdateTransactionListenerTest.java


示例12: featureTypeInfo

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
FeatureTypeInfo featureTypeInfo(QName name, GetFeatureRequest3D request) throws WFSException, IOException {
    FeatureTypeInfo meta = catalog.getFeatureTypeByName(name.getNamespaceURI(), name.getLocalPart());

    if (meta == null) {
        String msg = "Could not locate " + name + " in catalog.";
        throw new WFSException(request, msg, "InvalidParameterValue").locator("typeName");
    }

    return meta;
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:11,代码来源:GetFeature3D.java


示例13: 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");
        }
    }
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:12,代码来源:GetFeature3D.java


示例14: 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));
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:32,代码来源:WFSXmlUtils_ISO.java


示例15: build

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
public XSDSchema build(FeatureTypeInfo[] featureTypeInfos, String baseUrl, 
    boolean resolveAppSchemaImports, boolean scheduleSchemaCleanup) throws IOException {
    // build the schema and make sure to schedule it for destruction at the end of the request
    XSDSchema schema = buildSchemaInternal(featureTypeInfos, baseUrl, resolveAppSchemaImports);
    if(schema != null && scheduleSchemaCleanup) {
        SchemaCleanerCallback.addSchema(schema);
    }
    return schema;
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:10,代码来源:ISOFeatureTypeSchemaBuilder.java


示例16: addApplicationTypes

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
/**
 * Adds types defined in the catalog to the provided schema.
 */
public XSDSchema addApplicationTypes( XSDSchema wfsSchema ) throws IOException {
    //incorporate application schemas into the wfs schema
    Collection<FeatureTypeInfo> featureTypeInfos = catalog.getFeatureTypes();

    for (Iterator<FeatureTypeInfo> i = featureTypeInfos.iterator(); i.hasNext();) {
        FeatureTypeInfo meta = i.next();
        
        // don't build schemas for disabled feature types
        if(!meta.enabled())
            continue;

        //build the schema for the types in the single namespace (and don't clean them, they are not dynamic)
        XSDSchema schema = buildSchemaInternal(new FeatureTypeInfo[] { meta }, null, false);

        //declare the namespace
        String prefix = meta.getNamespace().getPrefix();
        String namespaceURI = meta.getNamespace().getURI();
        wfsSchema.getQNamePrefixToNamespaceMap().put(prefix, namespaceURI);

        //add the types + elements to the wfs schema
        for (Iterator<XSDTypeDefinition> t = schema.getTypeDefinitions().iterator(); t.hasNext();) {
            wfsSchema.getTypeDefinitions().add(t.next());
        }

        for (Iterator<XSDElementDeclaration> e = schema.getElementDeclarations().iterator(); e.hasNext();) {
            wfsSchema.getElementDeclarations().add(e.next());
        }
        
        // add secondary namespaces from catalog
        for (Map.Entry<String, String> entry : schema.getQNamePrefixToNamespaceMap()
                .entrySet()) {
            if (!wfsSchema.getQNamePrefixToNamespaceMap().containsKey(entry.getKey())) {
                wfsSchema.getQNamePrefixToNamespaceMap().put(entry.getKey(), entry.getValue());
            }
        }
    }

    return wfsSchema;
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:43,代码来源:ISOFeatureTypeSchemaBuilder.java


示例17: doWrite

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
protected void doWrite(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
        Operation describeFeatureType) throws IOException {

    //create the schema
    Object request = describeFeatureType.getParameters()[0];
    DescribeFeatureTypeRequest req = DescribeFeatureTypeRequest.adapt(request);
    
    XSDSchema schema = schemaBuilder.build(featureTypeInfos, req.getBaseURL());

    //serialize
    schema.updateElement();
    final String encoding = gs.getSettings().getCharset();
    XSDResourceImpl.serialize(output, schema.getElement(), encoding);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:15,代码来源:XmlSchemaEncoder_ISO.java


示例18: canHandle

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
@Override
public boolean canHandle(FeatureTypeInfo info,
        DataAccess<? extends FeatureType, ? extends Feature> dataAccess) {
    if (dataAccess instanceof ElasticDataStore) {
        return true;
    } else {
        return false;
    }
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:10,代码来源:ElasticFeatureTypeCallback.java


示例19: initialize

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
@Override
public boolean initialize(FeatureTypeInfo info,
        DataAccess<? extends FeatureType, ? extends Feature> dataAccess, Name temporaryName)
                throws IOException {

    ElasticLayerConfiguration layerConfig;
    layerConfig = (ElasticLayerConfiguration) info.getMetadata().get(KEY);
    if (layerConfig == null) {
        layerConfig = new ElasticLayerConfiguration(info.getName());
    }

    ((ElasticDataStore) dataAccess).setLayerConfiguration(layerConfig);

    return false;
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:16,代码来源:ElasticFeatureTypeCallback.java


示例20: dispose

import org.geoserver.catalog.FeatureTypeInfo; //导入依赖的package包/类
@Override
public void dispose(FeatureTypeInfo info,
        DataAccess<? extends FeatureType, ? extends Feature> dataAccess, Name temporaryName)
                throws IOException {
    ElasticLayerConfiguration layerConfig;
    layerConfig = (ElasticLayerConfiguration) info.getMetadata().get(KEY);
    if (layerConfig != null) {
        layerConfig.getAttributes().remove(info.getName());
        ((ElasticDataStore) dataAccess).getDocTypes().remove(info.getQualifiedName());
    }
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:12,代码来源:ElasticFeatureTypeCallback.java



注:本文中的org.geoserver.catalog.FeatureTypeInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GestureDescription类代码示例发布时间:2022-05-22
下一篇:
Java ListColumnVector类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap