geojson转shp

第一种方式:

https://mapshaper.org/

直接导入geojson ,最后导出shp 但导出的shp中 字段中有中文值得乱码

 

第二种方式:将GeoJSON 转换为EsriJSON,通过ArcMap中工具JSONToFeatures将JSON转换为shp

第一步:将EsriJSON的头替换GeoJSON 的 "type": "FeatureCollection",即用以下代码,替换 "type": "FeatureCollection"

"displayFieldName": "",
    "fieldAliases": {
        "FID": "FID",
        "UserID": "UserID",
        "height": "height",
        "id": "id",
        "name": "name"
    },
    "geometryType": "esriGeometryPolygon",
    "spatialReference": {
        "wkt": "GEOGCS[\"WGS84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"degree\",0.0174532925199433]]"
    },
    "fields": [
        {
            "name": "FID",
            "type": "esriFieldTypeOID",
            "alias": "FID"
        },
        {
            "name": "UserID",
            "type": "esriFieldTypeSmallInteger",
            "alias": "UserID"
        },
        {
            "name": "height",
            "type": "esriFieldTypeSmallInteger",
            "alias": "height"
        },
        {
            "name": "id",
            "type": "esriFieldTypeSmallInteger",
            "alias": "id"
        },
        {
            "name": "name",
            "type": "esriFieldTypeString",
            "alias": "name",
            "length": 78
        }
    ]

第二步:将geojson中的属性“coordinates”替换为“rings”

第三步:将geojson中的属性“properties”替换为“attributes”

第四步:将geojson转换为EsriJSON后,用notepad++打开,启用ANSI编码

 

第五步:使用ArcMap(10.2及以上版本)中工具JSONToFeatures

 

点击JSONToFeatures弹出窗口,选中你处理好的json,选择保存位置,点击ok即可

 

最后结果如下(结果集可以右键导出为shp):

 

PS:

1、以下一个标准的EsriJSON

{
    "displayFieldName": "",
    "fieldAliases": {
        "FID": "FID",
        "UserID": "UserID",
        "height": "height",
        "id": "id",
        "name": "name"
    },
    "geometryType": "esriGeometryPolygon",
    "spatialReference": {
        "wkt": "GEOGCS[\"WGS84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"degree\",0.0174532925199433]]"
    },
    "fields": [
        {
            "name": "FID",
            "type": "esriFieldTypeOID",
            "alias": "FID"
        },
        {
            "name": "UserID",
            "type": "esriFieldTypeSmallInteger",
            "alias": "UserID"
        },
        {
            "name": "height",
            "type": "esriFieldTypeSmallInteger",
            "alias": "height"
        },
        {
            "name": "id",
            "type": "esriFieldTypeSmallInteger",
            "alias": "id"
        },
        {
            "name": "name",
            "type": "esriFieldTypeString",
            "alias": "name",
            "length": 78
        }
    ],
    "features": [
        {
            "attributes": {
                "FID": 1,
                "UserID": 0,
                "height": 26,
                "id": 1,
                "name": "东方银座"
            },
            "geometry": {
                "rings": [
                    [
                        [
                            116.4296391258555,
                            39.938547050529
                        ],
                        [
                            116.4296390613181,
                            39.93892545530012
                        ],
                        [
                            116.4293486753082,
                            39.93892492181583
                        ],
                        [
                            116.4293486823351,
                            39.93888379087441
                        ],
                        [
                            116.4292196218916,
                            39.93888355377568
                        ],
                        [
                            116.4289830420634,
                            39.93870214301881
                        ],
                        [
                            116.4289830575557,
                            39.93861165498078
                        ],
                        [
                            116.4289292823856,
                            39.93861155620433
                        ],
                        [
                            116.4289293232417,
                            39.93837299684417
                        ],
                        [
                            116.4293810317527,
                            39.93839027883599
                        ],
                        [
                            116.42938106126,
                            39.93821752887639
                        ],
                        [
                            116.4289293500095,
                            39.93821669933233
                        ],
                        [
                            116.4289293598713,
                            39.93815911603849
                        ],
                        [
                            116.4287142592885,
                            39.93815872103016
                        ],
                        [
                            116.4287141549038,
                            39.93876745857678
                        ],
                        [
                            116.428778685118,
                            39.93876757711857
                        ],
                        [
                            116.4287786752475,
                            39.93882516040372
                        ],
                        [
                            116.4288754705743,
                            39.93882533822202
                        ],
                        [
                            116.4288969778287,
                            39.93884183010633
                        ],
                        [
                            116.4288539506355,
                            39.93888288199632
                        ],
                        [
                            116.4289614869192,
                            39.9389653414294
                        ],
                        [
                            116.4290045141116,
                            39.93892428953856
                        ],
                        [
                            116.4290260199623,
                            39.93894900761276
                        ],
                        [
                            116.429026008698,
                            39.93901481709778
                        ],
                        [
                            116.4291012939665,
                            39.93901495541522
                        ],
                        [
                            116.4291012855221,
                            39.93906431253271
                        ],
                        [
                            116.4293809165335,
                            39.93906482629721
                        ],
                        [
                            116.4293808954568,
                            39.93918821912546
                        ],
                        [
                            116.4296390164226,
                            39.93918869340175
                        ],
                        [
                            116.4296390374674,
                            39.93906530054161
                        ],
                        [
                            116.4298971584015,
                            39.93906577478625
                        ],
                        [
                            116.4298971864187,
                            39.93890125093023
                        ],
                        [
                            116.4298219011586,
                            39.93890111262125
                        ],
                        [
                            116.4298219614223,
                            39.93854738635743
                        ],
                        [
                            116.4296391258555,
                            39.938547050529
                        ]
                    ]
                ]
            }
        }
    ]
}

2、北京奥林匹克体育场geojson

 

 

详细内容请查看我的微信公众号:

后续小编的主要精力放到GIS理论开发知识的大众化的道路了,通过浅显易懂的语言,结合多年行业应用开发,通过微信订阅号传播(每周更新三篇文章及相关GIS编码知识),为GIS的发展尽微博之力。终极目标是让GIS不再专业,让GIS更加大众,使得GIS深入各行业应用,让每位GISER都有一股自豪感!以下是我的微信订阅号二维码,感兴趣的可以交流沟通!

一位更懂IT的GISER,一位更懂GIS的IT
 

 

 

  • 12
    点赞
  • 46
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dinxin横刀一笑

意思不意思那是你的意思

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值