Examples of literal()


Examples of org.opengis.filter.FilterFactory2.literal()

            } catch (Exception e) {
                bbox = boundingBox;
            }
            String geom = getSchema().getGeometryDescriptor().getName().getLocalPart();
            Object bboxGeom = new GeometryFactory().toGeometry(bbox);
            bboxFilter = factory.intersects(factory.property(geom), factory.literal(bboxGeom));

        } catch (Exception e) {
            ProjectPlugin.getPlugin().log(e);
        }
        return bboxFilter;
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

                        continue;
                    }
                    String targetGeomName = targetType.getGeometryDescriptor().getLocalName();
   
                    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( GeoTools.getDefaultHints() );
                    Filter cut= ff.not( ff.within( ff.property( targetGeomName ), ff.literal(hole) ) );
                   
                    //put it on style blackboard
                    //Key:  ProjectBlackboardConstants    String LAYER__DATA_QUERY = "org.locationtech.udig.project.view"; //$NON-NLS-1$
                    IStyleBlackboard styleBlackboard = layer.getStyleBlackboard();
                    styleBlackboard.put(ProjectBlackboardConstants.LAYER__DATA_QUERY, cut);
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

        if( !bbox.getCoordinateReferenceSystem().equals( crs )) {
            bbox = bbox.transform(crs, true);
        }
        FilterFactory2 factory = (FilterFactory2) CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
        Geometry geom = new GeometryFactory().toGeometry(bbox);
        Intersects filter = factory.intersects(factory.property(type.getGeometryDescriptor().getName()), factory.literal(geom));
       
        layer.getQuery(false);
        final FeatureCollection<SimpleFeatureType, SimpleFeature>  results = source.getFeatures( filter );
//        if( results.getCount() == 0 ) {
//            return null; // no content!
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

        String cql = "#"+Integer.toHexString(c.getRGB() & 0x00ffffff);
        colorText.setText(cql);
        colorText.setEnabled(true);
       
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        Expression expression = ff.literal(cql);

        return expression;
    }
   
    /** Used to supply a filter for display or editing */
 
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

        }
        if( spinner.isEnabled() ){
            int number = spinner.getSelection();
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
           
            return ff.literal( ((double)number)/100.0);
        }
        return null;
    }

    @Override
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

    try {

      SimpleFeatureType schema = selectedLayer.getSchema();
      String typeName = schema.getGeometryDescriptor().getLocalName();

      intersectsFilter = ff.intersects(ff.property(typeName), ff.literal(trimmingLineInLayerCrs));
    } catch (IllegalFilterException e) {
      throw (RuntimeException) new RuntimeException().initCause(e);
    }

    if (Filter.EXCLUDE.equals(filter)) {
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

            assertNotNull(hotlinkDescriptor.getType() != null);
        }
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        SimpleFeatureCollection features = featureStore.getFeatures(ff.equals(ff.property("STATE"),
                ff.literal("Tasmania")));
        SimpleFeatureIterator iterator = features.features();
        assertTrue("Tasmania found", iterator.hasNext());
        SimpleFeature tasmania = iterator.next();

        List<IDocument> documents = hotlink.getDocuments(tasmania, new NullProgressMonitor());
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

  @SuppressWarnings("unchecked")
  private FeatureIterator<SimpleFeature> getAffectedFeatures(SimpleFeature feature) throws IOException {
    FilterFactory2 filterFactory = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
    String geomAttName = feature.getFeatureType().getGeometryDescriptor().getLocalName();
    PropertyName geomPropertyExpression = filterFactory.property(geomAttName);
    Literal literalGeomExpression = filterFactory.literal(feature.getDefaultGeometry());
    Touches filter = filterFactory.touches(geomPropertyExpression, literalGeomExpression);
   
    IProgressMonitor monitor =
      getContext().getActionBars().getStatusLineManager().getProgressMonitor();
    FeatureSource<SimpleFeatureType,SimpleFeature> resource =
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

    private org.opengis.filter.Filter createGeometryTypeFilter( String geomName, String type )
            throws IllegalFilterException {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        Function function = ff.function("geometryType", ff.property(geomName));
        return ff.equal(function, ff.literal(type)); //$NON-NLS-1$
    }

    private boolean writeToShapefile(SimpleFeatureCollection fc, SimpleFeatureType type, File file ) throws IOException {
       
        if (!canWrite(file)) {
View Full Code Here

Examples of org.opengis.filter.FilterFactory2.literal()

                   
                    Filter getFInfoFilter = null;
                    try {
                        GeometryDescriptor geometryDescriptor = schema.getGeometryDescriptor();
                        String localName = geometryDescriptor.getLocalName();
                        getFInfoFilter = ff.intersects(ff.property(localName), ff.literal(pixelRect));
                    } catch (IllegalFilterException e) {
                        e.printStackTrace();
                        throw new WmsException(null, "Internal error : " + e.getMessage());
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.