用于描述地理空间信息的数据格式,语法是基于 JSON 格式的。每一个 GeoJSON 对象都有一个 type 属性:Point:点MultiPoint:多点LineString:线MultiLineString:多线Polygon:面MultiPolygon:多面GeometryCollection:几何体集合Feature:特征FeatureCollection:特征集合分类type:Point、MultiPoint、LineString、MultiLineString、Polygon、MultiPolygon则该对象必须有属性 coordinates,这类对象称为几何对象。// 点对象{ ’type’: ‘Point’, ‘coordinates’: [-105, 39]}// 线对象{ ’type’: ‘LineString’, ‘coordinates’: [[-105, 39], [-107, 38]]}// 面对象{ ’type’: ‘Polygon’, ‘coordinates’: [ [[30, 0], [31, 0], [31, 5], [30, 5], [30, 0]] ]}type:GeometryCollection则该对象必须有属性 geometries,其值是一个数组,每一项都是一个 GeoJSON 的几何对象。{ ’type’: ‘GeometryCollection’, ‘geometries’: [ { ’type’: ‘Point’, ‘coordinates’: [100, 40] }, { ’type’: ‘LineString’, ‘coordinates’: [[100, 30], [100, 35]] } ]}type:Feature则该对象必须有属性 geometry,其值为一个几何对象;此外还有一个属性 properties,可以是任意 JSON 或 null{ ’type’: ‘Feature’, ‘properties’: { ’name’: ‘北京’ }, ‘geometry’: { ’type’: ‘Point’, ‘coordinates’: [116.3671875, 39.977120098439634] }}type:FeatureCollection则该对象必须有属性 features,其值为一个数组,每一项都是一个 Feature 对象。{ ’type’: ‘FeatureCollection’, ‘features’: [ { ’type’: …, ‘properties’: …, ‘geometry’: … }, … ]}参考《精通D3.js:交互式数据可视化高级编程》