我正在使用逻辑应用程序在存储之前转换我的数据。为此,我使用 json 到 json 内置转换器,它使用液体。这是我的原始输入,
{
"type":"FeatureCollection",
"metadata":{
"generated":1539147197000,
"url":"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2018-10-09T04:53:16.6743076Z",
"title":"USGS Earthquakes",
"status":200,
"api":"1.5.8",
"count":245
},
"features":[
{
"type":"Feature",
"properties":{
"mag":1.9,
"place":"118km NNW of Arctic Village, Alaska",
"time":1539146474786,
"updated":1539146692433,
"tz":-540,
"url":"https://earthquake.usgs.gov/earthquakes/eventpage/ak20275217",
"detail":"https://earthquake.usgs.gov/fdsnws/event/1/query?eventid=ak20275217&format=geojson",
"felt":null,
"cdi":null,
"mmi":null,
"alert":null,
"status":"automatic",
"tsunami":0,
"sig":56,
"net":"ak",
"code":"20275217",
"ids":",ak20275217,",
"sources":",ak,",
"types":",geoserve,origin,",
"nst":null,
"dmin":null,
"rms":1.17,
"gap":null,
"magType":"ml",
"type":"earthquake",
"title":"M 1.9 - 118km NNW of Arctic Village, Alaska"
},
"geometry":{
"type":"Point",
"coordinates":[
-146.6925,
69.1011,
0
]
},
"id":"ak20275217"
},
...(list continues)
这是我在逻辑应用程序中映射的液体文件,
{
"Data": [
{% for f in content.features %}
{
"type": "{{f.properties.type}}",
"mag": {{f.properties.mag}},
"place": "{{f.properties.place}}",
"time": "{{f.properties.time}}",
"tsunami": {{f.properties.tsunami}},
"code": "{{f.properties.code}}",
"ids": "{{f.properties.ids}}",
"magType": "{{f.properties.magType}}",
"source": "{{f.properties.sources}}",
"longitude": {{f.geometry.coordinates[0]}},
"latitude": {{f.geometry.coordinates[1]}}
},
{% endfor %}
]
}
它实际上提供了所需的输出,但对于时间字段,它只是给出了一个错误,如下所示,
"time": "液体错误:值对于 Int32 来说太大或太小。",
我尝试使用本指南将此字段转换为字符串,
但是似乎没有任何效果,并且它给出了类型转换错误。我只想将时间值按原样(甚至作为字符串)保存在原始输入文件中,这是一个 Unix 纪元时间戳。
谢谢