当前位置: 首页>>代码示例>>Java>>正文


Java FeatureTypeInfo类代码示例

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


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


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