GeoJson标准格式基本介绍

geojson格式:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [102.0, 0.5]
            },
            "properties": {
                "prop0": "value0"
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "LineString",
                "coordinates": [
                    [102.0, 0.0],
                    [103.0, 1.0],
                    [104.0, 0.0],
                    [105.0, 1.0]
                ]
            },
            "properties": {
                "prop0": "value0",
                "prop1": 0.0
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [100.0, 0.0],
                        [101.0, 0.0],
                        [101.0, 1.0],
                        [100.0, 1.0],
                        [100.0, 0.0]
                    ]
                ]
            },
            "properties": {
                "prop0": "value0",
                "prop1": {
                    "this": "that"
                }
            }
        }
    ]
}

点要素Point

{
    "type": "Feature",
    "properties": {},
    "geometry": {
        "type": "Point",
        "coordinates": [
            105.38,
            31.57
        ]
    }
}

多点要素MultiPoint

{
    "type": "Feature",
    "properties": {},
    "geometry": {
        "type": "MultiPoint",
        "coordinates": [
            [
                105.380859375,
                31.57853542647338
            ],
            [
                105.580859375,
                31.52853542647338
            ]
        ]
    }
}

线要素LineString

{
    "type": "Feature",
    "properties": {},
    "geometry": {
        "type": "LineString",
        "coordinates": [
            [
                105.6005859375,
                30.65681556429287
            ],
            [
                107.95166015624999,
                31.98944183792288
            ]
        ]
    }
}

多线MultiLineString

{
    "type": "Feature",
    "properties": {},
    "geometry": {
        "type": "MultiLineString",
        "coordinates": [
            [
                [
                    109.3798828125,
                    30.031055426540206
                ],
                [
                    107.1978515625,
                    31.235895213372444
                ]
            ],
            [
                [
                    105.6005859375,
                    30.65681556429287
                ],
                [
                    109.3798828125,
                    30.031055426540206
                ],
                [
                    107.7978515625,
                    29.935895213372444
                ]
            ]
        ]
    }
}

面Polygon

{
    "type": "Feature",
    "properties": {},
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    106,
                    33
                ],
                [
                    108.03955078125,
                    32.2313896627376
                ],
                [
                    108.25927734375,
                    33.15594830078649
                ],
                [
                    106,
                    33
                ]
            ]
        ]
    }
}

多面MultiPolygon

{
    "type": "Feature",
    "properties": {},
    "geometry": {
        "type": "MultiPolygon",
        "coordinates":
            [ 
                [
                    [
                        [109.2041015625,30.088107753367257],
                        [115.02685546875,30.088107753367257],
                        [115.02685546875,32.7872745269555],
                        [109.2041015625,32.7872745269555],
                        [109.2041015625,30.088107753367257]
                    
                    
                    ]
                ],
                [
                    [
                        [112.9833984375,26.82407078047018],
                        [116.69677734375,26.82407078047018],
                        [116.69677734375,29.036960648558267],
                        [112.9833984375,29.036960648558267],
                        [112.9833984375,26.82407078047018]
                    ]
                ]
            ]
    }
}

地理要素集GeometryCollection

{
    "type": "GeometryCollection",
    "geometries": [
        {
            "type": "Point",
            "coordinates": [
                108.62,
                31.02819
            ]
        },
        {
            "type": "LineString",
            "coordinates": [
                [
                    108.896484375,
                    30.1071178870
                ],
                [
                    108.2184375,
                    30.91717870
                ],
                [
                    109.5184375,
                    31.2175780
                ]
            ]
        }
    ]
}

你可能感兴趣的:(openlayers,其他)