我有一些地理邊界,我have a GeoJSON endpoint for。加入GeoJSON到另一個GeoJSON
我也有一些變量存儲在一個單獨的GeoJSON endpoint,它沒有座標,但確實有一個變量,我想稍後以D3爲主題設計一個地圖。這是每週更新一次。
這兩個響應中都有一個公用標識,名爲lga_name(本地政府區域名稱),我試圖加入該標識。似乎有很多關於如何使用CSV加入GeoJSON的示例,但GeoJSON與GeoJSON不兼容。
我曾試圖嘗試put together an app,但仍然掙扎着加入。
// Load LGAs from ArcGIS Online (The GeoJSON with geoms)
d3.json("the url to the Geoms", function(error, data) {
// Load Crash Stats from ArcGIS Online (the total persons involved, summarised down to LGA names)
d3.json("the url to the table", function(error, data2) {
var lga = data.features;
var crashStats = data2.features;
// Not working
var joined = lga.forEach(function(item) {
item.properties.LGA_NAME = crashStats[item.properties.lga_name];
});
任何人都可以給我一些指導,幫助讓我感動嗎?只是想了解更多關於D3和Javascript的更多信息。
非常感謝。這應該讓我在路上。這更像是一個自學的工作,我可能會找到兩個更清晰的數據源。 – Simon