我正在尝试像这样提取geojson文件:
{
"type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
"features": [
{
"type": "Feature",
"properties": {
"id_trip": 1547,
"starttime": "2017-09-18 04:16:58UTC",
"endtime": "2017-09-18 04:26:26UTC"
},
"geometry": {
"type": "MultiLineString",
"coordinates": [
[
[
-73.651166,
45.544501
],
[
-73.651227,
45.544519
],
.....
我添加了一个简单的功能类型:
"trajet"={attributes=[{ name = "id_trip", type = "String" }{ name = "starttime", type = "Date" }{ name = "endtime", type = "Date" }{ name = "geom", type = "MultiLineString" }]}
因为geomesa无法猜测转换器,所以我定义了以下转换器:
geomesa.converters.geoconv = {
type = "geojson"
id-field = "$id_trip"
feature-path = "$.Features[*]"
fields = [
{ name = "id_trip", json-type = "integer", path = "$.id_trip", transform = "toString($0)" }
{ name = "starttime", json-type = "date", path = "$.starttime", }
{ name = "endtime", json-type = "date", path = "$.endtime", }
{ name = "geom", json-type = "geometry", path = "$.geom", transform = "multilinestring($0)" }
]
}
我收到一个致命错误,0%完成0摄取0 0在00:00:00失败
感谢您的建议。
编辑: 实际上,我实际上是使用SHP文件代替的,我不知道为什么,但是它被摄取时没有任何错误。