WKT、WKB、ArcGIS Geometry Object、GeoJson、PostGIS Geometry

Outline

This paper is mainly used to organize knowledge in GIS development and Geometry relevant, written in relatively simple, pro bigwigs spray.

Basic concepts

WKT

Wikipedia: Portal

WKT (Well-known text) is a markup language for representing vector geometry , spatial reference system , and switching between the spatial reference system .

WKT representation of geometric objects may include: 线, 多边形, TIN(不规则三角网)及多面体, . Geometric objects may be represented by different dimensions of the set of geometrically.
Here Insert Picture Description
Here Insert Picture Description

WKB

WKT binary representation, i.e. WKB (well-known binary) rather than the transmission in a database and store the same information. The format developed by the Open Geospatial Consortium (OGC). This article does not specifically say, details see above Wikipedia.

ArcGIS Geometry json

Official description: Portal
examples in this article only following several formats, please refer to the specific use of official help.

  • Point

    {"x" : <x>, "y" : <y>, "z" : <z>, "m" : <m>, "spatialReference" : {<spatialReference>}}
    
  • MultiPoint

    {
      "hasM" : true | false,
      "hasZ" : true | false,
      "points" : [[ <x1>, <y1>, <z1>, <m1> ] , [ <x2>, <y2>, <z2>, <m2> ], ... ], 
      "spatialReference" : {<spatialReference>}
    }
    
  • Polyline

    {
      "hasZ" : true | false,
      "hasM" : true | false,
      "paths" : [[[<x11>, <y11>, <z11>, <m11>],...,[<x1N>, <y1N>, <z1N>, <m1N>]],
                 ,...,[[<xk1>, <yk1>, <zk1>, <mk1>],...,[<xkM>, <ykM>, <zkM>, <mkM>]]],
      "spatialReference" : {<spatialReference>}
    }
    
  • Polygon

    {
      "hasZ" : true | false,
      "hasM" : true | false,
      "rings" : [[[<x11>, <y11>, <z11>, <m11>],...,[<x1N>, <y1N>, <z1N>, <m1N>]],
                 ,...,[[<xk1>, <yk1>, <zk1>, <mk1>],...,[<xkM>, <ykM>, <zkM>, <mkM>]]],
      "spatialReference" : {<spatialReference>}
    }
    
  • Envelope

    {
      "xmin" : <xmin>, "ymin" : <ymin>, 
      "xmax" : <xmax>, "ymax" : <ymax>,
      "zmin" : <zmin>, "zmax" : <zmax>,
      "mmin" : <mmin>, "mmax" : <mmax>,
      "spatialReference" : {<spatialReference>}
    }
    

GeoJson

GeoJson official description: Portal
GeoJson specification Chinese Description: Portal

TopoJson

TopoJson specification: Portal

PostGIS Geometry

Official description: Portal
Here Insert Picture Description
manipulation functions Geometry object, official data:

Change

The following is the JavaScript / Node.js conversion process used in several libraries:

  • Use terraformerlibrary conversion, Portal
    • Supports conversion between geojson, wkt, ArcGIS Geometry
  • Use wkxlibraries, portal
    • WKT / WKB / EWKT / EWKB / TWKB / GeoJSON parsing and serializing
  • Use wellknownlibraries, portal
    • Support wkt conversion and geojson
Published 96 original articles · won praise 95 · views 390 000 +

Guess you like

Origin blog.csdn.net/yh0503/article/details/95048757