参考文献:https://www.jianshu.com/p/d78fff321005
数据存储格式:WKT VS GeoJSON
WKT是什么?
WKT(well-know text)是开放地理空间联盟OGC制定的一种文本标记语言,用于表示矢量几何对象、空间参照系统及空间参照系统之间的转换。
WKB是什么?
WKB(well-know binary)是WKT的二进制表现形式,解决WKT表达冗余的问题,便于传输和存储在数据库中。
GeoJSON是什么?
以JSON的格式输出空间数据,便于被javascript等脚本调用。
WKT与GeoJSON
- WKT与GeoJSON分为点、线、面、几何集合四种:
| 点 | 线 | 面 | 组合 |
|---|---|---|---|
| Point MultiPoint | LineString MultiLineString | Polygon MultiPolygon | GeometryCollection |
| 类型 | WKT | GeoJSON |
|---|---|---|
| Point | POINT(10 10) | { “type”: “Point”, “coordinates”: [10, 10] } |
| LineString | LINESTRING(10 10, 20 30) | { “type”: “Point”, “coordinates”:[ [10, 10], [20, 30] ] } |
| Polygon | POLYGON(10 10, 15 16, 22 10, 30 32) | { “type”: “Polygon”, “coordinates”: [ [ [10, 10], [10, 10], [10, 10], [10, 10] ] ] } |
| MultiPoint | MULTIPOINT(*) | { “type”: “MultiPoint”, “coordinates”: [*] } |
| MultiLineString | MULTILINESTRING (*) | { “type”: “MultiLineString”, “coordinates”: [*] } |
| MultiPolygon | MULTIPOLYGON (*) | { “type”: “MultiPolygon”, “coordinates”: [*] } |
| GEOMETRYCOLLECTION | GEOMETRYCOLLECTION(POINT(2 3),LINESTRING(2 3,3 4)) | - |
- WKT与GeoJSON的区别 WKT是用来单独表示空间点、线、面数据,GeoJSON还可以用来表示空间数据和属性数据的集合 (crs、bbox属性)。
使用GeoPandas 读取 wkt字符串数据
获取山东省地图土地轮廓并使用GeoPandas加载展示
- 通过百度地图api获取数据信息
- 将形状字符串转换为MultiPolygon类型数据
- 通过GeoPandas加载数据
|
|