首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法将geoJSON数据导入Kepler.gl

无法将geoJSON数据导入Kepler.gl
EN

Stack Overflow用户
提问于 2019-12-11 15:19:31
回答 1查看 384关注 0票数 1

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

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

代码语言:javascript
复制
{
  "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]]}}

  ]
}

你知道原因是什么吗?我已经验证了代码,除了坐标的元素数量之外,看起来一切都很好(但这是kepplers的要求,示例格式如下所示):

代码语言:javascript
复制
              {
                "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]
                      ]
                    }
                  }
                ]
              }

真的很感谢你的帮助

EN

回答 1

Stack Overflow用户

发布于 2020-06-14 17:42:16

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

代码语言:javascript
复制
{
  "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]
        ]
      }
    }
  ]
}

顺便说一句,我还认为在遍历字符串时,时间戳应该增加。我看到了一些不满足这个条件的特性。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59280610

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档