Examples of Feature


Examples of org.geomajas.layer.feature.Feature

    if (max > features.size()) {
      max = features.size();
    }
    Feature[] maxList = new Feature[max];
    for (int i = 0; i < max; i++) {
      Feature feature = converter.toDto(features.get(i));
      feature.setCrs(crs);
      maxList[i] = feature;
    }
    response.setFeatures(maxList);
  }
View Full Code Here

Examples of org.geomajas.puregwt.client.map.feature.Feature

      lineStyle = mapInfo.getLineSelectStyle();
      ringStyle = mapInfo.getPolygonSelectStyle();
    }

    public void onFeatureSelected(FeatureSelectedEvent event) {
      Feature feature = event.getFeature();
      if (feature.getLayer().isShowing()) {
        render(feature);
      }
    }
View Full Code Here

Examples of org.geoscript.js.feature.Feature

        } else if (value instanceof com.vividsolutions.jts.geom.Geometry) {
            value = GeometryWrapper.wrap(scope, (com.vividsolutions.jts.geom.Geometry) value);
        } else if (value instanceof ReferencedEnvelope) {
            value = new Bounds(scope, (ReferencedEnvelope) value);
        } else if (value instanceof SimpleFeature) {
            value = new Feature(scope, (SimpleFeature) value);
        } else if (value instanceof SimpleFeatureType) {
            value = new Schema(scope, (SimpleFeatureType) value);
        } else if (value instanceof SimpleFeatureCollection) {
            value = new FeatureCollection(scope, (SimpleFeatureCollection) value);
        }
View Full Code Here

Examples of org.geotools.feature.Feature

        FeatureTypeInfo meta = null;
        NameSpaceInfo namespace;
        Query query;

        FeatureSource source;
        Feature feature;
        String fid;
        FilterFactory filterFactory = FilterFactoryFinder.createFilterFactory();
        FidFilter fidFilter;

        try {
            for (Iterator it = request.getQueries().iterator(); it.hasNext();) {
                query = (Query) it.next();

                // the feature type name used in the content disposition response will match
                // the first feature type
                if (featureTypeName == null) {
                    featureTypeName = query.getTypeName();
                }

                meta = catalog.getFeatureTypeInfo(query.getTypeName());
                namespace = meta.getDataStoreInfo().getNameSpace();
                source = meta.getFeatureSource();

                List attrs = meta.getAttributes();

                List propNames = query.getPropertyNames(); // REAL LIST: be careful here :)
                List attributeNames = meta.getAttributeNames();

                for (Iterator iter = propNames.iterator(); iter.hasNext();) {
                    String propName = (String) iter.next();

                    if (!attributeNames.contains(propName)) {
                        String mesg = "Requested property: " + propName + " is "
                            + "not available for " + query.getTypeName() + ".  "
                            + "The possible propertyName values are: " + attributeNames;
                        throw new WfsException(mesg);
                    }
                   
                   
                }

                List extraGeometries = new ArrayList();
                List properties = new ArrayList();
                if (propNames.size() != 0) {
                    Iterator ii = attrs.iterator();
                   

                    while (ii.hasNext()) {
                        AttributeTypeInfo ati = (AttributeTypeInfo) ii.next();

                        //String attName = (String) ii.next();
                        LOGGER.finer("checking to see if " + propNames + " contains" + ati);

                        if (((ati.getMinOccurs() > 0) && (ati.getMaxOccurs() != 0))
                                || propNames.contains(ati.getName())) {
                            properties.add(ati.getName());
                        }
                       
                        //if(wfs.isFeatureBounding() && meta.getFeatureType().getAttributeType(ati.getName()) instanceof GeometryAttributeType
                        //        && !properties.contains(ati.getName())) {
                        //    properties.add(ati.getName());
                        //    extraGeometries.add(ati.getName());
                        //}
                        if(meta.getFeatureType().getAttributeType(ati.getName()) instanceof GeometryAttributeType
                                && !properties.contains(ati.getName())) {
                            properties.add(ati.getName());
                            extraGeometries.add(ati.getName());
                        }
                    }

                    query.setPropertyNames(properties);
                }
               
                // Add range to filter
                AttributeExpression geomAttb = filterFactory.createAttributeExpression(meta.getFeatureType(), meta.getFeatureType().getDefaultGeometry().getName());
                LiteralExpression pointExpr = filterFactory.createLiteralExpression(request.getPoint());
                DWithin dWithin = filterFactory.dwithin(geomAttb, pointExpr, request.getMaxRange(), request.getUnits());
                if (query.getFilter() == null) {
                    query.addFilter((Filter)dWithin);
                   
                } else {
                    And andFilter = filterFactory.and(Arrays.asList(new Filter[] { (Filter)dWithin, query.getFilter() }));
                    query.addFilter((Filter)andFilter);
                }
               
                LOGGER.fine("Query is " + query + "\n To gt2: " + query.toDataQuery(Integer.MAX_VALUE));

                //DJB: note if maxFeatures gets to 0 the while loop above takes care of this! (this is a subtle situation)
                FeatureCollection featuresCheck = source.getFeatures(query.toDataQuery(Integer.MAX_VALUE));
               
                // find nearest feature
                Unit fromUnit = SI.METER;
                Unit toUnit = UnitFormat.getInstance().parseUnit(request.getUnits());
                Converter unitConvert = fromUnit.getConverterTo(toUnit);
                Feature nearestFeature = null;
                double nearestDistance = 9e9;
                double nearestBearing = 0;
                for (Iterator sItr = featuresCheck.iterator(); sItr.hasNext();) {
                    Feature f = (Feature)sItr.next();
                    if (f.getDefaultGeometry() == null) continue;
                    DistanceOp op = new DistanceOp(request.getPoint(), f.getDefaultGeometry());
                    Coordinate[] co = op.closestPoints();
                    Measure m = DefaultGeographicCRS.WGS84.distance(new double[] { co[0].x, co[0].y, }, new double[] { co[1].x, co[1].y, });
                    if (m.doubleValue() > nearestDistance) continue;
                    nearestFeature = f;
                    nearestDistance = m.doubleValue();
View Full Code Here

Examples of org.jabber.protocol.disco_info.Feature

        answer.setType(type);
        return answer;
    }

    protected Feature createFeature(String var) {
        Feature feature = new Feature();
        feature.setVar(var);
        return feature;
    }
View Full Code Here

Examples of org.jamesii.perfdb.jdbc.Feature

    SimulationProblem sp = (new SimProblemTest()).getConnectedEntity();
    sp.create();
    FeatureType f = (new FeatureTest()).getConnectedEntity();
    f.create();
    return new Feature(sp, f, null);
  }
View Full Code Here

Examples of org.jboss.arquillian.persistence.data.dbunit.configuration.annotations.Feature

      try
      {
         for (Field feature : features)
         {
            String featurePrefix = FEATURE_PREFIX;
            final Feature featureAnnotation = feature.getAnnotation(Feature.class);
            if (!Strings.isEmpty(featureAnnotation.value()))
            {
               featurePrefix += featureAnnotation.value() + "/";
            }
            final String key = featurePrefix + feature.getName();
            final Object value = feature.get(configuration);
            if (value != null)
            {
View Full Code Here

Examples of org.jboss.arquillian.persistence.dbunit.configuration.annotations.Feature

      try
      {
         for (Field feature : features)
         {
            String featurePrefix = FEATURE_PREFIX;
            final Feature featureAnnotation = feature.getAnnotation(Feature.class);
            if (!Strings.isEmpty(featureAnnotation.value()))
            {
               featurePrefix += featureAnnotation.value() + "/";
            }
            final String key = featurePrefix + feature.getName();
            final Object value = feature.get(configuration);
            if (value != null)
            {
View Full Code Here

Examples of org.jboss.wsf.spi.metadata.config.Feature

                    endpointConfig.setProperty(key, model.get(Constants.PROPERTY).get(key).asString());
                }
            }
            if (model.hasDefined(Constants.FEATURE)) {
                for (String key : model.get(Constants.FEATURE).keys()) {
                    endpointConfig.setFeature(new Feature(key), true);
                }
            }
            config.addEndpointConfig(endpointConfig);
        }
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.structure.Feature

public class Feature_isExecutableTest {

    @Test
    public void should_be_true_if_there_are_scenarios_in_the_feature() {
        final Feature feature = featureWith(successScenario());
        assertTrue(feature.isExecutable(Filter.EMPTY_FILTER));
    }
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.