使用geojson文件在d3.js中绘制气泡图

时间:2016-01-12 11:57:07

标签: javascript html d3.js geojson

myfile.geojson -

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },

"features": [
{ "type": "Feature", "properties": { "NAME_2": "East Godavari", "NAME_3": "Kottapeta", "profit": 326, "npa": 174.000000 }, "geometry": { "type": "MultiPolygon", "coordinates":  [ [ [ 81.719329833984432, 16.927410125732479 ], [ 81.723800659179801, 16.961441040039119 ], [ 81.732490539550838, 16.990680694580135 ], [ 81.723800659179972, 16.961441040039119 ], [ 81.719329833984432, 16.927410125732479 ] ] ], 

{ "type": "Feature", "properties": { "NAME_2": "East Godavari", "NAME_3": "Rajahmundry", "profit": 1762, "npa": 1683.000000 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ 81.717170715332031, 17.060630798339901 ], [ 81.722846984863565, 17.047969818115348 ], [ 81.731689453125, 17.009309768676758 ], [ 81.729316711425895, 17.024909973144531 ], [ 81.727096557617188, 17.035369873046875 ] ] ] 
} } ] }

现在,我需要添加“myfile.geojson”并使用“myfile.geojson”中的数据绘制气泡图。

我需要根据myfile.geojson中给出的“利润”值进行绘图  请帮忙..

在以下链接中 http://bl.ocks.org/mbostock/4063269

请建议泡泡图“index.html”中的修改,这些修改是添加“myfile.geojson”代替“flare.json”所必需的,在上面的链接中给出了基于的气泡图输出“myfile.geojson”的“利润”值。 请建议修改。 提前谢谢。

0 个答案:

没有答案