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


Java Property类代码示例

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


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

示例1: fromSimpleFeature

import org.opengis.feature.Property; //导入依赖的package包/类
public static GeoInfo fromSimpleFeature(SimpleFeature feature) {
    GeoInfo that = new GeoInfo();
    for (Property p: feature.getProperties()) {
        if (p.getName().toString().equals("NAME"))
            that.name = p.getValue().toString();
        if (p.getName().toString().equals("STATE"))
            that.state = p.getValue().toString();

        if (p.getName().toString().equals("COUNTY"))
            that.county = p.getValue().toString();

        if (p.getName().toString().equals("CITY"))
            that.city = p.getValue().toString();
    }

    that.multiPolygon = (MultiPolygon) feature.getDefaultGeometry();
    return that;
}
 
开发者ID:confluentinc,项目名称:strata-tutorials,代码行数:19,代码来源:GeoInfo.java

示例2: printResults

import org.opengis.feature.Property; //导入依赖的package包/类
/**
 * Iterates through the given iterator and prints out the properties (attributes) for each entry.
 *
 * @param iterator
 */
private static void printResults(FeatureIterator iterator, String... attributes) {

    if (iterator.hasNext()) {
        System.out.println("Results:");
    } else {
        System.out.println("No results");
    }
    int n = 0;
    while (iterator.hasNext()) {
        Feature feature = iterator.next();
        StringBuilder result = new StringBuilder();
        result.append(++n);

        for (String attribute : attributes) {
            Property property = feature.getProperty(attribute);
            result.append("|")
                  .append(property.getName())
                  .append('=')
                  .append(property.getValue());
        }
        System.out.println(result.toString());
    }
    System.out.println();
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:30,代码来源:GeoServerAuthorizationsTutorial.java

示例3: GamaGisGeometry

import org.opengis.feature.Property; //导入依赖的package包/类
public GamaGisGeometry(final Geometry g, final Feature feature) {
	super(g);
	if (feature != null) {
		// We filter out the geometries (already loaded before)
		for (final Property p : feature.getProperties()) {
			if (!(p.getType() instanceof GeometryType)) {
				final String type = p.getDescriptor().getType().getBinding().getSimpleName();
				if ("String".equals(type)) {
					String val = (String) p.getValue();
					if (val != null && ((val.startsWith("'") && val.endsWith("'")) || (val.startsWith("\"") && val.endsWith("\""))))
						val = val.substring(1, val.length() - 1);
					setAttribute(p.getName().getLocalPart(), val);

				} else
					setAttribute(p.getName().getLocalPart(), p.getValue());
			}
		}
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:20,代码来源:GamaGisGeometry.java

示例4: getValueAt

import org.opengis.feature.Property; //导入依赖的package包/类
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
    if (columnIndex == 0) {
        return rowIndex + 1;
    } else if (columnIndex == 1) {
        return computedDatas[rowIndex].x;
    } else if (columnIndex == 2) {
        return computedDatas[rowIndex].y;
    } else if (columnIndex == 3) {
        return computedDatas[rowIndex].lat;
    } else if (columnIndex == 4) {
        return computedDatas[rowIndex].lon;
    } else if (columnIndex == 5) {
        return computedDatas[rowIndex].rasterMean;
    } else if (columnIndex == 6) {
        return computedDatas[rowIndex].rasterSigma;
    } else if (columnIndex == 7) {
        return computedDatas[rowIndex].correlativeData;
    } else if (columnIndex < getColumnCount()) {
        final Collection<Property> propColl = computedDatas[rowIndex].featureProperties;
        final Property[] properties = propColl.toArray(new Property[propColl.size()]);
        final Integer propertyIndex = propertyIndices.get(columnIndex);
        return properties[propertyIndex].getValue();
    }
    return null;
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:27,代码来源:ScatterPlotTableModel.java

示例5: getPropertyRaw

import org.opengis.feature.Property; //导入依赖的package包/类
/** get a raw property */
public Object getPropertyRaw (String key) {
	if (extraFields != null) {
		String ret = extraFields.get(key);
		if (ret != null) {
			return ret;
		}
	}

	Property prop = feat.getProperty(key);
	if (prop == null) {
		return null;
	}
	Object val = prop.getValue();
	return val;
}
 
开发者ID:conveyal,项目名称:geom2gtfs,代码行数:17,代码来源:ExtendedFeature.java

示例6: shouldSha1Property

import org.opengis.feature.Property; //导入依赖的package包/类
private boolean shouldSha1Property(Property p) {
	String localName = p.getName().getLocalPart();

	if (m_attributesToInclude.contains(localName)) {
		return true;
	}
	if (m_attributesToInclude.contains("-" + localName)) {
		return false;
	}
	if (m_attributesToInclude.contains("-all")) { // deprecated
		return true;
	}
	if (m_attributesToInclude.contains("*")) {
		return true;
	}
	LOGGER.log(Level.FINER, "Skipping: {0}", localName);
	return false;
}
 
开发者ID:xandris,项目名称:geoserver-sync,代码行数:19,代码来源:FeatureSha1.java

示例7: visitItem

import org.opengis.feature.Property; //导入依赖的package包/类
@Override
public void visitItem(final Object o)
{
    final PreparedFeature preparedFeature = (PreparedFeature) o;
    if (preparedFeature.preparedGeometry.contains(m_point))
    {
        m_found = true;
        for (final ColumnInterface column : m_columnList)
        {
            final Property property = preparedFeature.feature.getProperty(column.getQualifier());
            if (property != null)
            {
                column.setWeight(column.toDouble(property.getValue()));
            }
        }
    }
}
 
开发者ID:mraad,项目名称:GeoEnrichment,代码行数:18,代码来源:SearchShapefileIndexPolygon.java

示例8: readParameters

import org.opengis.feature.Property; //导入依赖的package包/类
private static void readParameters(Map<String, ShapeFileParameter> params,
		SimpleFeature feature) {
	for (Property property : feature.getProperties()) {
		if (!(property.getValue() instanceof Number))
			continue;
		if (property.getName() == null)
			continue;
		String name = property.getName().toString();
		double value = ((Number) property.getValue()).doubleValue();
		ShapeFileParameter param = params.get(name);
		if (param == null) {
			param = new ShapeFileParameter();
			param.name = name;
			param.max = value;
			param.min = value;
			params.put(name, param);
		} else {
			param.max = Math.max(param.max, value);
			param.min = Math.min(param.min, value);
		}
	}
}
 
开发者ID:GreenDelta,项目名称:olca-modules,代码行数:23,代码来源:ShapeFileFolder.java

示例9: printFeature

import org.opengis.feature.Property; //导入依赖的package包/类
public static void printFeature(SimpleFeature f) {
    Iterator<Property> props = f.getProperties().iterator();
    int propCount = f.getAttributeCount();
    System.out.print("fid:" + f.getID());
    for (int i = 0; i < propCount; i++) {
        Name propName = props.next().getName();
        System.out.print(" | " + propName + ":" + f.getAttribute(propName));
    }
    System.out.println();
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:11,代码来源:KafkaLoadTester.java

示例10: appendResult

import org.opengis.feature.Property; //导入依赖的package包/类
/**
 * Append the property to the result
 *
 * @param string
 * @param property
 */
private static void appendResult(StringBuilder string, Property property) {
    if (property != null) {
        string.append("|")
              .append(property.getName())
              .append('=')
              .append(property.getValue());
    }
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:15,代码来源:QueryTutorial.java

示例11: addFeaturesToEncoder

import org.opengis.feature.Property; //导入依赖的package包/类
/**
 * Adds all features to the encoder and prepares it before. So geometries are removed from the attribute map and
 * the geometry is transformed to the target tile local system
 *
 * @param featureCollectionStyleMap the feature collection map to be encoded and its refering style
 */
private void addFeaturesToEncoder(Map<FeatureCollection,Style> featureCollectionStyleMap, double scaleDenominator) {
    for (FeatureCollection featureCollection : featureCollectionStyleMap.keySet()) {
        String layerName = featureCollection.getSchema().getName().getLocalPart();
        Style featureStyle = featureCollectionStyleMap.get(featureCollection);
        try (FeatureIterator<SimpleFeature> it = featureCollection.features()) {
            while (it.hasNext()) {
                SimpleFeature feature = null;
                try {
                    feature = it.next();
                    Collection<Property> propertiesList = feature.getProperties();
                    Map<String, Object> attributeMap = new HashMap<>();
                    for (Property property : propertiesList) {
                        if (!(property.getValue() instanceof Geometry)) {
                            attributeMap.put(property.getName().toString(), property.getValue());
                        }
                    }
                    //Process GeometryTransformations in Symbolizers. It is possible to render the same geometry
                    //with more than one symbolizer. Therefore a list is returned.
                    List<Geometry> geometryList = processSymbolizers(featureStyle, feature, scaleDenominator);
                    for (Geometry geometry : geometryList) {
                        geometry = transFormGeometry(geometry);
                        this.vectorTileEncoder.addFeature(layerName, attributeMap, geometry);
                    }
                } catch (IllegalStateException ex) {
                    LOGGER.warning(ex.getMessage());
                }
            }
        }
    }
}
 
开发者ID:stefan0722,项目名称:gs-mvt,代码行数:37,代码来源:MVTWriter.java

示例12: report

import org.opengis.feature.Property; //导入依赖的package包/类
/**
 * Write the feature attribute names and values to a {@code JTextReporter}
 *
 * @param layerName
 *            name of the map layer that contains this feature
 * @param feature
 *            the feature to report on
 */
private void report(final String layerName, final Feature feature) {
	createReporter();

	final Collection<Property> props = feature.getProperties();
	String valueStr = null;

	final StringBuilder sb = new StringBuilder();
	sb.append(layerName);
	sb.append("\n");

	for (final Property prop : props) {
		String name = prop.getName().getLocalPart();
		final Object value = prop.getValue();

		if (value instanceof Geometry) {
			name = "  Geometry";
			valueStr = value.getClass().getSimpleName();
		} else {
			valueStr = value.toString();
		}
		sb.append(name);
		sb.append(":");
		sb.append(valueStr);
		sb.append("\n\n");
	}
	reporter.append(sb.toString());
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:36,代码来源:InfoTool.java

示例13: testLoadDbfFile

import org.opengis.feature.Property; //导入依赖的package包/类
/**
 * Test correctness of .dbf parser
 * @throws IOException
 */
@Test
public void testLoadDbfFile() throws IOException{
    String inputLocation = getShapeFilePath("dbf");
    // load shape with geotool.shapefile
    FeatureCollection<SimpleFeatureType, SimpleFeature> collection = loadFeatures(inputLocation);
    FeatureIterator<SimpleFeature> features = collection.features();
    ArrayList<String> featureTexts = new ArrayList<String>();
    while(features.hasNext()){
        SimpleFeature feature = features.next();
        String attr = "";
        int i = 0;
        for (Property property : feature.getProperties()) {
            if(i == 0){
                i++;
                continue;
            }
            if(i > 1) attr += "\t";
            attr += String.valueOf(property.getValue());
            i++;
        }
        featureTexts.add(attr);
    }
    final Iterator<String> featureIterator = featureTexts.iterator();

    for (Geometry geometry : ShapefileReader.readToGeometryRDD(sc, inputLocation).collect()) {
        Assert.assertEquals(featureIterator.next(), geometry.getUserData());
    }
}
 
开发者ID:DataSystemsLab,项目名称:GeoSpark,代码行数:33,代码来源:ShapefileReaderTest.java

示例14: getHTMLDescription

import org.opengis.feature.Property; //导入依赖的package包/类
private String getHTMLDescription(SimpleFeature simpleFeature) {

		StringBuilder str = new StringBuilder();
		for (Property property : simpleFeature.getProperties()) {
			if (property.getName().toString() != GEOM) {
				str.append("<b>" + property.getName() + "</b>: ");
				if (property.getValue() != null)
					str.append(property.getValue().toString() + " <br />");
				else
					str.append(" <br />");
			}
		}
		return str.toString();
	}
 
开发者ID:therelaxist,项目名称:spring-usc,代码行数:15,代码来源:WorksheetToFeatureCollection.java

示例15: parseField

import org.opengis.feature.Property; //导入依赖的package包/类
private static double parseField(String diss_fld, Feature diss)
		throws Exception {
	double mag;
	if(diss_fld.equals("::area::")){
		mag = ((Geometry)diss.getDefaultGeometryProperty().getValue()).getArea();
	} else {
		Property magProp = diss.getProperty(diss_fld);
		
		if(magProp==null){
			String propStrings = "";
			Collection<Property> props = diss.getProperties();
			for( Property prop : props ){
				propStrings += " "+prop.getName();
			}
			throw new Exception("Property '"+diss_fld+"' not found. Options are:"+propStrings+"." );
		}
		
		Class<?> cls = magProp.getType().getBinding();
		
		Object propVal = diss.getProperty( diss_fld ).getValue();
		if(propVal==null){
			return 0;
		}
		
		if(cls.equals(Long.class)){
			mag = (Long)propVal;
		} else if(cls.equals(Integer.class)){
			mag = (Integer)propVal;
		} else if(cls.equals(Double.class)){
			mag = (Double)propVal;
		} else if(cls.equals(Float.class)){
			mag = (Float)propVal;
		} else {
			throw new Exception( "Diss property has unkown type "+cls );
		}
	}
	return mag;
}
 
开发者ID:conveyal,项目名称:aggregate-disser,代码行数:39,代码来源:Disser.java


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