【问题标题】:TileMill and Geojson; Datasource could not be loadedTileMill 和 Geojson;无法加载数据源
【发布时间】:2011-07-15 15:32:38
【问题描述】:

我正在关注这篇文章,以使用 Google Refine 从 excel 中获取 geojson 文件。 http://support.mapbox.com/kb/tilemill/converting-addresses-in-spreadsheets-to-custom-maps-in-tilemill

现在我遇到了一个奇怪的问题,即我有时会收到无法加载数据源的错误消息,而我每次都使用完全相同的模板。唯一不同的似乎是我正在加载的数据。 此外,如果我比较 2 个 geojson 文件(1 个有效,1 个无效),我看不出有什么区别。

有人知道问题出在哪里吗? ..是使用空格/中断还是其他什么??

这个正在工作:

    {
        "type": "FeatureCollection",
        "features": [
        { 
          "type": "Feature",
          "id": 25.019909,
          "geometry": { "type": "Point", "coordinates": [121.365599, 25.019909] }, 
          "properties":


      {
          "Users" : 1
        }
    },
        { 
          "type": "Feature",
          "id": 24.446706,
          "geometry": { "type": "Point", "coordinates": [117.818197, 24.446706] }, 
          "properties":


      {
          "Users" : 1
        }
    },
        { 
          "type": "Feature",
          "id": 25.100632,
          "geometry": { "type": "Point", "coordinates": [117.03403, 25.100632] }, 
          "properties":


      {
          "Users" : 1
        }
    },
        { 
          "type": "Feature",
          "id": 47.354348,
          "geometry": { "type": "Point", "coordinates": [123.918186, 47.354348] }, 
          "properties":


      {
          "Users" : 1
        }
    },
        { 
          "type": "Feature",
          "id": 30.199652,
          "geometry": { "type": "Point", "coordinates": [115.03852, 30.199652] }, 
          "properties":


      {
          "Users" : 3
        }
    },
...
...
...

}
  ]
}

虽然这个给了我错误;

{
    "type": "FeatureCollection",
    "features": [    { 
      "type": "Feature",
      "id": 25.019909,
      "geometry": { "type": "Point", "coordinates": [121.365599, 25.019909] }, 
      "properties":


  {
      "Users" : 1
    }
},
    { 
      "type": "Feature",
      "id": 24.446706,
      "geometry": { "type": "Point", "coordinates": [117.818197, 24.446706] }, 
      "properties":


  {
      "Users" : 1
    }
},
    { 
      "type": "Feature",
      "id": 25.100632,
      "geometry": { "type": "Point", "coordinates": [117.03403, 25.100632] }, 
      "properties":


  {
      "Users" : 1
    }
},
...
...
...
}
  ]
}

【问题讨论】:

    标签: json excel csv geojson


    【解决方案1】:

    您在第二个中多了一个“}”。但是,当然,这可能只是因为您在添加 ... 时删除的内容,所以不可能说,除非您发布整个不起作用的内容。

    提示:找到一个突出匹配大括号的文本编辑器 - 如果您告诉编辑器您正在查看 javascript 或 json 代码,大多数人应该这样做。

    【讨论】:

      【解决方案2】:

      我很抱歉.. 它毕竟是数据中的东西 :( .. tilemill 对它接受的内容和显然不接受的内容非常严格..

      【讨论】:

      • {EAV_BLOG_VER:0730e27ffd9748e5}
      猜你喜欢
      • 2017-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-09
      • 1970-01-01
      相关资源
      最近更新 更多