GeoMesa命令行工具----创建命令

创建Simple Feature Types

一、可通过以下方式定义Simple Feature Types:
1、已经存在classpath中的SimpleFeatureType 的名
2、规定的字符串

3、配置(不常用)
4、包括规定的字符串或配置的文件的文件名(不常用)

二、加载Classpath 中的Simple Feature Types

geomesa会默认加载reference.conf 和 application.conf文件,在conf目录下
可通过这些配置文件定义自己的SimpleFeatureTypes 。默认情况下,SimpleFeatureTypes应该定义为路径geomesa.sfts下的对象。

SimpleFeatureType对象包括以下keys:

1、type-name:类型名称字符串。
2、attributes :(必填)-字段数组,包括name和type
3、user-data :在SimpleFeatureType中添加数据(键值对)

只要在calsspath中定义了SimpleFeatureType ,就可以通过他的名字使用他

例:

geomesa = {
  sfts = {
     # other SFTs
     # ...
    example = {
      attributes = [
        { name = "name", type = "String", index = true                  }
        { name = "age",  type = "Integer"                               }
        { name = "dtg",  type = "Date",   default = true,  index = true }
        { name = "geom", type = "Point",  default = true , srid = 4326  }
      ]
    }
  }
}

三、规定的字符串

SimpleFeatureType可以通过字符串定义。每个属性的格式是name:type:foo=bar,其中name是属性名,type是类型,foo=bar是可选的数据。多个数据用冒号分隔,多个属性用逗号分隔默认的几何图形是用*指定的。

例:

name:String:index=true,age:Integer,dtg:Date:index=true:default=true,*geom:Point:srid=4326

创建 Simple Feature 转换器

转换器定义输入数据与SimpleFeatureType之间的映射。

一、转换器定义方式:
1、已经存在classpath中的转换器的名
2、在配置文件中定义

3、通过配置字符串定义

二、加载classpath中的转换器

默认加载conf目录中的 reference.conf和application.conf文件

可以修改这些文件来定义自己的转换器。默认情况下,转换器应该定义为路径geomesa.converters下的对象。

一旦在类路径上定义了转换器,就可以通过其名称引用它

猜你喜欢

转载自blog.csdn.net/qq_21705851/article/details/93391139
今日推荐