无法将geoJSON数据导入Kepler.gl

问题描述 投票:1回答:1

我正在尝试使用kepler.gl可视化工具创建交通动画,但是我遇到的问题是,当我尝试导入geoJSON数据网站崩溃时。

我正在使用的GeoJSON代码示例如下:

{
  "type": "FeatureCollection",
  "features": [
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/1"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467500], [18.481958,54.384292,0,1430469360]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/2"}, "geometry": {"type": "LineString", "coordinates": [[18.481958,54.384292,0,1430467501], [18.583399,54.35955,0,1430498460]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/3"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467502], [18.581945,54.405786,0,1430469300]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/4"}, "geometry": {"type": "LineString", "coordinates": [[18.581945,54.405786,0,1430467503], [18.583399,54.35955,0,1430488200]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/5"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467504], [18.605414,54.380423,0,1430466420]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/6"}, "geometry": {"type": "LineString", "coordinates": [[18.605414,54.380423,0,1430467505], [18.583399,54.35955,0,1430498700]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/7"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467506], [18.581945,54.405786,0,1430463060]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/8"}, "geometry": {"type": "LineString", "coordinates": [[18.581945,54.405786,0,1430467507], [18.583399,54.35955,0,1430496900]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/9"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467508], [18.641927,54.380242,0,1430460660]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/10"}, "geometry": {"type": "LineString", "coordinates": [[18.641927,54.380242,0,1430467509], [18.583399,54.35955,0,1430500260]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/11"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467510], [18.556138,54.324371,0,1430464800]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/12"}, "geometry": {"type": "LineString", "coordinates": [[18.553211,54.334392,0,1430467511], [18.583399,54.35955,0,1430490600]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/13"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467512], [18.632491,54.357703,0,1430463600]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/14"}, "geometry": {"type": "LineString", "coordinates": [[18.632491,54.357703,0,1430467513], [18.583399,54.35955,0,1430493720]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/15"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467514], [18.052585,53.131291,0,1430475600]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/16"}, "geometry": {"type": "LineString", "coordinates": [[18.052585,53.131291,0,1430467515], [18.773438,53.472181,0,1430490600]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/17"}, "geometry": {"type": "LineString", "coordinates": [[18.773438,53.472181,0,1430467516], [18.658774,54.268903,0,1430501700]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/18"}, "geometry": {"type": "LineString", "coordinates": [[18.658774,54.268903,0,1430467517], [18.583399,54.35955,0,1430508000]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/19"}, "geometry": {"type": "LineString", "coordinates": [[18.583399,54.35955,0,1430467518], [18.556698,54.344727,0,1430467200]]}},
    {"type": "Feature", "properties": {"ID":"GD_1001/2113/1/1/20"}, "geometry": {"type": "LineString", "coordinates": [[18.556698,54.344727,0,1430467519], [18.583399,54.35955,0,1430499900]]}}

  ]
}

您有什么主意吗?我已经验证了代码,看起来除了坐标元素的数量之外,其他一切都很好(但这是开普勒的要求,示例格式如下):

              {
                "type": "FeatureCollection",
                "features": [
                  {
                    "type": "Feature",
                    "properties": { "vendor":  "A",
                    "vol":20},
                    "geometry": {
                      "type": "LineString",
                      "coordinates": [
                        [-74.20986, 40.81773, 0, 1564184363],
                        [-74.20987, 40.81765, 0, 1564184396],
                        [-74.20998, 40.81746, 0, 1564184409]
                      ]
                    }
                  }
                ]
              }

任何帮助表示感谢

json gis visualization geojson kepler.gl
1个回答
0
投票

您至少需要3个坐标/ ts对才能在开普勒中可视化它们-我已经复制了下面的第二组:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/1"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467500],
          [18.481958, 54.384292, 0, 1430469360],
          [18.481958, 54.384292, 0, 1430469360]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/2"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.481958, 54.384292, 0, 1430467501],
          [18.583399, 54.35955, 0, 1430498460],
          [18.583399, 54.35955, 0, 1430498460]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/3"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467502],
          [18.581945, 54.405786, 0, 1430469300],
          [18.581945, 54.405786, 0, 1430469300]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/4"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.581945, 54.405786, 0, 1430467503],
          [18.583399, 54.35955, 0, 1430488200],
          [18.583399, 54.35955, 0, 1430488200]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/5"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467504],
          [18.605414, 54.380423, 0, 1430466420],
          [18.605414, 54.380423, 0, 1430466420]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/6"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.605414, 54.380423, 0, 1430467505],
          [18.583399, 54.35955, 0, 1430498700],
          [18.583399, 54.35955, 0, 1430498700]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/7"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467506],
          [18.581945, 54.405786, 0, 1430463060],
          [18.581945, 54.405786, 0, 1430463060]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/8"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.581945, 54.405786, 0, 1430467507],
          [18.583399, 54.35955, 0, 1430496900],
          [18.583399, 54.35955, 0, 1430496900]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/9"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467508],
          [18.641927, 54.380242, 0, 1430460660],
          [18.641927, 54.380242, 0, 1430460660]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/10"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.641927, 54.380242, 0, 1430467509],
          [18.583399, 54.35955, 0, 1430500260],
          [18.583399, 54.35955, 0, 1430500260]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/11"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467510],
          [18.556138, 54.324371, 0, 1430464800],
          [18.556138, 54.324371, 0, 1430464800]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/12"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.553211, 54.334392, 0, 1430467511],
          [18.583399, 54.35955, 0, 1430490600],
          [18.583399, 54.35955, 0, 1430490600]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/13"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467512],
          [18.632491, 54.357703, 0, 1430463600],
          [18.632491, 54.357703, 0, 1430463600]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/14"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.632491, 54.357703, 0, 1430467513],
          [18.583399, 54.35955, 0, 1430493720],
          [18.583399, 54.35955, 0, 1430493720]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/15"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467514],
          [18.052585, 53.131291, 0, 1430475600],
          [18.052585, 53.131291, 0, 1430475600]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/16"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.052585, 53.131291, 0, 1430467515],
          [18.773438, 53.472181, 0, 1430490600],
          [18.773438, 53.472181, 0, 1430490600]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/17"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.773438, 53.472181, 0, 1430467516],
          [18.658774, 54.268903, 0, 1430501700],
          [18.658774, 54.268903, 0, 1430501700]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/18"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.658774, 54.268903, 0, 1430467517],
          [18.583399, 54.35955, 0, 1430508000],
          [18.583399, 54.35955, 0, 1430508000]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/19"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.583399, 54.35955, 0, 1430467518],
          [18.556698, 54.344727, 0, 1430467200],
          [18.556698, 54.344727, 0, 1430467200]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "ID": "GD_1001/2113/1/1/20"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [18.556698, 54.344727, 0, 1430467519],
          [18.583399, 54.35955, 0, 1430499900],
          [18.583399, 54.35955, 0, 1430499900]
        ]
      }
    }
  ]
}

BTW我也认为遍历行字符串时,时间戳记应该增加。我看到了一些不满足此条件的功能。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.