コード例 #1
0
ファイル: TestGISBase.java プロジェクト: jgibson/giscore
 /**
  * Create a feature with a number of data elements in the extended data. This method will not use
  * a schema.
  *
  * @param geoclass the class of the geometry objects to create
  * @param schema the schema
  * @param valuemap the valuemap, not <code>null</code>
  * @return the new instance
  */
 protected Feature createFeature(
     Class<? extends Geometry> geoclass, Schema schema, Map<String, Object> valuemap) {
   if (schema == null) {
     throw new IllegalArgumentException("schema should never be null");
   }
   if (valuemap == null) {
     throw new IllegalArgumentException("valuemap should never be null");
   }
   Feature f = createBasicFeature(geoclass);
   f.setSchema(schema.getId());
   for (String key : schema.getKeys()) {
     SimpleField field = schema.get(key);
     Object value = valuemap.get(key);
     f.putData(field, value != null ? value : ObjectUtils.NULL);
   }
   return f;
 }