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
                ]
            ]
        }
    ]
}

  • 0
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
JSON和GeoJSON都是用于存储地理空间数据的格式。JSON是一种常用的数据交换格式,而GeoJSON则是JSON的一种扩展,专门用于表示地理要素和地理几何体。 JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,易于阅读和编写,并且易于在不同编程语言之间进行解析和生成。它由键值对组成,可以包含对象、数组、字符串、数字等类型的数据。 GeoJSON是JSON的一个子集,用于表示地理要素和地理几何体,例如点、线、面等。GeoJSON规范定义了一组标准的属性和几何体类型,使得地理数据可以以统一的格式进行存储和交换。GeoJSON对象可以包含一个或多个地理要素,每个地理要素都包含属性和几何体。 为了将JSON转换为GeoJSON,可以使用特定的库或函数来实现。例如,可以使用j2gConvert函数将指定的JSON对象转换为具有指定属性的基本GeoJSON对象。这个函数可以用于向GeoJSON对象添加更多属性。 另外,还有一些工具可以将其他格式的地理数据(如GTFS、CSV、KML等)转换为SQLite3(Spatialite)数据库中的GeoJSON。例如,可以使用gtfs-sqlite工具将GTFS文件转换为SQLite3数据库中的GeoJSON格式。 总结起来,JSON是一种通用的数据交换格式,而GeoJSON是JSON的一种扩展,用于表示地理要素和地理几何体。可以使用特定的函数或工具将JSON转换为GeoJSON,也可以将其他地理数据格式转换为SQLite3数据库中的GeoJSON格式。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [json2geojson:将 JSON 转换为 GeoJSON 的快速函数](https://download.csdn.net/download/weixin_42116604/19323276)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [gtfs-sqlite:GTFS到SQLite3(+ Spatialite)(+ CSV JSON GeoJSON KML)](https://download.csdn.net/download/weixin_42128270/18301190)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值