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


Java SchemaException类代码示例

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


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

示例1: createSimpleFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
static SimpleFeatureType createSimpleFeatureType(String simpleFeatureTypeName)
        throws SchemaException {

    // list the attributes that constitute the feature type
    List<String> attributes = Lists.newArrayList(
            "Who:String:index=full",
            "What:java.lang.Long",     // some types require full qualification (see DataUtilities docs)
            "When:Date",               // a date-time field is optional, but can be indexed
            "*Where:Point:srid=4326",  // the "*" denotes the default geometry (used for indexing)
            "Why:String"               // you may have as many other attributes as you like...
    );

    // create the bare simple-feature type
    String simpleFeatureTypeSchema = Joiner.on(",").join(attributes);
    SimpleFeatureType simpleFeatureType =
            SimpleFeatureTypes.createType(simpleFeatureTypeName, simpleFeatureTypeSchema);

    return simpleFeatureType;
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:20,代码来源:AvroExample.java

示例2: createSimpleFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
static SimpleFeatureType createSimpleFeatureType(String simpleFeatureTypeName)
        throws SchemaException {

    // list the attributes that constitute the feature type
    List<String> attributes = Lists.newArrayList(
            "Who:String:index=full",
            "What:java.lang.Long",     // some types require full qualification (see DataUtilities docs)
            "When:Date",               // a date-time field is optional, but can be indexed
            "*Where:Point:srid=4326",  // the "*" denotes the default geometry (used for indexing)
            "Why:String",              // you may have as many other attributes as you like...
            "Visibility:String"
    );

    // create the bare simple-feature type
    String simpleFeatureTypeSchema = Joiner.on(",").join(attributes);
    SimpleFeatureType simpleFeatureType =
            SimpleFeatureTypes.createType(simpleFeatureTypeName, simpleFeatureTypeSchema);

    // use the user-data (hints) to specify which date-time field is meant to be indexed;
    // if you skip this step, your data will still be stored, it simply won't be indexed
    simpleFeatureType.getUserData().put(SimpleFeatureTypes.DEFAULT_DATE_KEY, "When");

    return simpleFeatureType;
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:25,代码来源:FeatureLevelVisibility.java

示例3: buildGdeltFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
/**
 * Builds the feature type for the GDELT data set
 *
 * @param featureName
 * @return
 * @throws SchemaException
 */
public static SimpleFeatureType buildGdeltFeatureType(String featureName) throws SchemaException {

    List<String> attributes = new ArrayList<String>();
    for (Attributes attribute : Attributes.values()) {
        if (attribute == Attributes.geom) {
            // set geom to be the default geometry for geomesa by adding a *
            attributes.add("*geom:Point:srid=4326");
        } else {
            attributes.add(attribute.name() + ":" + attribute.getType());
        }
    }

    String spec = Joiner.on(",").join(attributes);

    SimpleFeatureType featureType = DataUtilities.createType(featureName, spec);
    //This tells GeoMesa to use this Attribute as the Start Time index
    featureType.getUserData().put(SimpleFeatureTypes.DEFAULT_DATE_KEY, Attributes.SQLDATE.name());
    return featureType;
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:27,代码来源:GdeltFeature.java

示例4: createSimpleFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
static SimpleFeatureType createSimpleFeatureType(String simpleFeatureTypeName)
        throws SchemaException {

    // list the attributes that constitute the feature type
    List<String> attributes = Lists.newArrayList(
            "Who:String:index=full",
            "What:java.lang.Long",     // some types require full qualification (see DataUtilities docs)
            "When:Date",               // a date-time field is optional, but can be indexed
            "*Where:Point:srid=4326",  // the "*" denotes the default geometry (used for indexing)
            "Why:String"               // you may have as many other attributes as you like...
    );

    // create the bare simple-feature type
    String simpleFeatureTypeSchema = Joiner.on(",").join(attributes);
    SimpleFeatureType simpleFeatureType =
            SimpleFeatureTypes.createType(simpleFeatureTypeName, simpleFeatureTypeSchema);

    // use the user-data (hints) to specify which date-time field is meant to be indexed;
    // if you skip this step, your data will still be stored, it simply won't be indexed
    simpleFeatureType.getUserData().put(SimpleFeatureTypes.DEFAULT_DATE_KEY, "When");

    return simpleFeatureType;
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:24,代码来源:AccumuloQuickStart.java

示例5: createSimpleFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
static SimpleFeatureType createSimpleFeatureType(String simpleFeatureTypeName)
        throws SchemaException {

    // list the attributes that constitute the feature type
    List<String> attributes = Lists.newArrayList(
            "Who:String",
            "What:java.lang.Long",     // some types require full qualification (see DataUtilities docs)
            "When:Date",               // a date-time field is optional, but can be indexed
            "*Where:Point:srid=4326",  // the "*" denotes the default geometry (used for indexing)
            "Why:String"               // you may have as many other attributes as you like...
    );

    // create the bare simple-feature type
    String simpleFeatureTypeSchema = Joiner.on(",").join(attributes);
    SimpleFeatureType simpleFeatureType =
            DataUtilities.createType(simpleFeatureTypeName, simpleFeatureTypeSchema);

    return simpleFeatureType;
}
 
开发者ID:geomesa,项目名称:geomesa-tutorials,代码行数:20,代码来源:HBaseQuickStart.java

示例6: getStatementFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
private static SimpleFeatureType getStatementFeatureType(final DataStore dataStore) throws IOException, SchemaException {
    SimpleFeatureType featureType;

    final String[] datastoreFeatures = dataStore.getTypeNames();
    if (Arrays.asList(datastoreFeatures).contains(FEATURE_NAME)) {
        featureType = dataStore.getSchema(FEATURE_NAME);
    } else {
        featureType = DataUtilities.createType(FEATURE_NAME,
            SUBJECT_ATTRIBUTE + ":String," +
            PREDICATE_ATTRIBUTE + ":String," +
            OBJECT_ATTRIBUTE + ":String," +
            CONTEXT_ATTRIBUTE + ":String," +
            GEOMETRY_ATTRIBUTE + ":Geometry:srid=4326," +
            GEO_ID_ATTRIBUTE + ":String");

        dataStore.createSchema(featureType);
    }
    return featureType;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:20,代码来源:GeoWaveGeoIndexer.java

示例7: initInternal

import org.geotools.feature.SchemaException; //导入依赖的package包/类
private void initInternal() throws IOException {
    validPredicates = ConfigUtils.getGeoPredicates(conf);

    final DataStore dataStore = createDataStore(conf);

    try {
        featureType = getStatementFeatureType(dataStore);
    } catch (final IOException | SchemaException e) {
        throw new IOException(e);
    }

    featureSource = dataStore.getFeatureSource(featureType.getName());
    if (!(featureSource instanceof FeatureStore)) {
        throw new IllegalStateException("Could not retrieve feature store");
    }
    featureStore = (FeatureStore<SimpleFeatureType, SimpleFeature>) featureSource;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:18,代码来源:GeoMesaGeoIndexer.java

示例8: getStatementFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
private static SimpleFeatureType getStatementFeatureType(final DataStore dataStore) throws IOException, SchemaException {
    SimpleFeatureType featureType;

    final String[] datastoreFeatures = dataStore.getTypeNames();
    if (Arrays.asList(datastoreFeatures).contains(FEATURE_NAME)) {
        featureType = dataStore.getSchema(FEATURE_NAME);
    } else {
        final String featureSchema = SUBJECT_ATTRIBUTE + ":String," //
                + PREDICATE_ATTRIBUTE + ":String," //
                + OBJECT_ATTRIBUTE + ":String," //
                + CONTEXT_ATTRIBUTE + ":String," //
                + GEOMETRY_ATTRIBUTE + ":Geometry:srid=4326;geomesa.mixed.geometries='true'";
        featureType = SimpleFeatureTypes.createType(FEATURE_NAME, featureSchema);
        dataStore.createSchema(featureType);
    }
    return featureType;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:18,代码来源:GeoMesaGeoIndexer.java

示例9: initType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
private synchronized void initType() {
	if (featureType == null
			|| !featureType.getName().getLocalPart()
					.equals(dataStoreTypeName)) {
		try {
			featureType = DataUtilities
					.createType(
							dataStoreTypeName,
							"envelope:com.vividsolutions.jts.geom.Polygon,id:java.lang.Long,queryString:String,path:String,startTime:Date,"
									+ "endTime:Date,totalTime:java.lang.Long,BodyAsString:String,BodyContentLength:java.lang.Long,"
									+ "Host:String,ErrorMessage:String,HttpMethod:String,HttpReferer:String,InternalHost:String,"
									+ "Operation:String,OwsVersion:String,QueryString:String,RemoteAddr:String,RemoteCity:String,"
									+ "RemoteCountry:String,RemoteHost:String,RemoteLat:double,"
									+ "RemoteLon:double,RemoteUser:String,RemoteUserAgent:String,Resources:String,"
									+ "ResponseContentType:String,ResponseLength:java.lang.Long,ResponseStatus:int,"
									+ "Service:String,SubOperation:String,Status:String,Category:String");
		} catch (SchemaException e) {
			LOGGER.log(Level.SEVERE, "Failed to initialized feature type",
					e);
		}
	}
}
 
开发者ID:joaomartins27396,项目名称:GSOC2015-gsmonitoext,代码行数:23,代码来源:FeatureMonitorDAO.java

示例10: createCollection

import org.geotools.feature.SchemaException; //导入依赖的package包/类
/**
 * Create a SimpleFeatureCollection with a Geometry
 * 
 * @param all
 * @return
 * @throws SchemaException
 */
public static SimpleFeatureCollection createCollection(Geometry g) throws SchemaException {

  SimpleFeatureCollection collection = FeatureCollections.newCollection();
  SimpleFeatureType TYPE = DataUtilities.createType("MBB", "location:Polygon:srid=4326"); // 4326
                                                                                          // =
                                                                                          // srid
                                                                                          // of
                                                                                          // wgs84
  SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE);

  featureBuilder.add(g);
  SimpleFeature feature = featureBuilder.buildFeature(null);
  collection.add(feature);

  return collection;
}
 
开发者ID:esarbanis,项目名称:strabon,代码行数:24,代码来源:GeonamesParser.java

示例11: createSimpleFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
static SimpleFeatureType createSimpleFeatureType(String simpleFeatureTypeName)
  throws SchemaException {

  // list the attributes that constitute the feature type
  List<String> attributes = Lists.newArrayList(
    "Who:String:index=full",
    "What:java.lang.Long",     // some types require full qualification (see DataUtilities docs)
    "When:Date",               // a date-time field is optional, but can be indexed
    "*Where:Point:srid=4326",  // the "*" denotes the default geometry (used for indexing)
    "Why:String"               // you may have as many other attributes as you like...
  );

  // create the bare simple-feature type
  String simpleFeatureTypeSchema = Joiner.on(",").join(attributes);
  SimpleFeatureType simpleFeatureType =
    SimpleFeatureTypes$.MODULE$.createType(simpleFeatureTypeName, simpleFeatureTypeSchema);

  // use the user-data (hints) to specify which date-time field is meant to be indexed;
  // if you skip this step, your data will still be stored, it simply won't be indexed
  simpleFeatureType.getUserData().put(Constants.SF_PROPERTY_START_TIME, "When");

  return simpleFeatureType;
}
 
开发者ID:geomesa,项目名称:geomesa-quickstart,代码行数:24,代码来源:QuickStart.java

示例12: Abstract

import org.geotools.feature.SchemaException; //导入依赖的package包/类
public Abstract(final String typeName, final URI namespace,
		final Collection types, final Collection superTypes,
		final GeometryAttributeType defaultGeom) throws SchemaException {
	super(typeName, namespace, types, superTypes, defaultGeom);

	final Iterator st = superTypes.iterator();

	while (st.hasNext()) {
		final FeatureType ft = (FeatureType) st.next();

		if (!ft.isAbstract()) {
			throw new SchemaException(
					"Abstract type cannot descend from no abstract type : "
							+ ft);
		}
	}
}
 
开发者ID:52North,项目名称:uDig-SOS-plugin,代码行数:18,代码来源:SOSFeatureType.java

示例13: createFeatureType

import org.geotools.feature.SchemaException; //导入依赖的package包/类
private SimpleFeatureType createFeatureType(GeometryType geometryType) throws Exception {

		String schema = null;

		switch(geometryType) {
		case POINT:
			schema = "the_geom:Point:srid=4326," + dataSchema;
			break;
		case MULTIPOLYGON:
			schema = "the_geom:MultiPolygon:srid=4326," + dataSchema;
			break;
		}

		try {
			return DataUtilities.createType(geometryType.name().toLowerCase(), schema);
		} catch (SchemaException e) {
			throw new Exception("Failed to create feature types for shapefile export", e);
		}
	}
 
开发者ID:dainst,项目名称:gazetteer,代码行数:20,代码来源:ShapefileCreator.java

示例14: setup

import org.geotools.feature.SchemaException; //导入依赖的package包/类
@Before
public void setup()
		throws SchemaException,
		CQLException,
		IOException,
		GeoWavePluginException {
	dataStore = createDataStore();
	type = DataUtilities.createType(
			"geostuff",
			"geometry:Geometry:srid=4326,pop:java.lang.Long,pid:String,when:Date");

	type.getDescriptor(
			"when").getUserData().put(
			"time",
			false);
	dataStore.createSchema(type);

}
 
开发者ID:locationtech,项目名称:geowave,代码行数:19,代码来源:WFSBoundedSpatialQueryTest.java

示例15: setup

import org.geotools.feature.SchemaException; //导入依赖的package包/类
@Before
public void setup()
		throws SchemaException,
		CQLException,
		IOException,
		GeoWavePluginException {
	dataStore = createDataStore();
	type = DataUtilities.createType(
			"geostuff",
			"geometry:Geometry:srid=4326,pop:java.lang.Long,when:Date,pid:String");

	dataStore.createSchema(type);
	query = new Query(
			"geostuff",
			CQL
					.toFilter("BBOX(geometry,27.20,41.30,27.30,41.20) and when during 2005-05-19T20:32:56Z/2005-05-19T21:32:56Z"),
			new String[] {
				"geometry",
				"pid"
			});
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:22,代码来源:WFSSpatialTest.java


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