ellipsoid 2025.2.7
参考椭球体基础软件包，主要包括：Geometry-几何要素类；Topology-几何要素拓扑类；MapGrid-国际标准比例尺图幅分幅网格类；Projection-几何要素坐标投影变换类；ProjectionHelper-几何要素坐标投影助手类；Astronomy-天文寻星计算类
License: MIT
Requires Python: >=3.9
Keywords: geometry, geojson, gml, kml, topology, projection, mapgrid, astronomy

<table>
  <tr style="border-style: none;">
    <td style="border-style: none;">
    <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100" height="100" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" viewBox="0 0 2403 2403" xmlns:xlink="http://www.w3.org/1999/xlink">
        <g transform="translate(-40 -39)">
            <path d="M820 117 820 1663 117.61 1663 94.0303 1598.58C64.7684 1504.5 46.7549 1405.46 41.5634 1303.04L39.9999 1241.21 39.9999 1241.18 41.5634 1179.35C65.4449 708.223 360.635 308.675 774.008 133.833Z" fill="#ED7D31" fill-rule="evenodd"/>
            <path d="M1664 818 2365.17 818 2389.04 883.317C2424.11 996.222 2443 1116.26 2443 1240.72 2443 1738.56 2140.73 2165.71 1709.93 2348.17L1664 2365Z" fill="#2E75B6" fill-rule="evenodd"/>
            <path d="M1241.54 38.9998C1739.16 38.9998 2166.12 341.618 2348.5 772.902L2365 818 819 818 819 116.924 884.288 93.0228C997.144 57.9135 1117.13 38.9998 1241.54 38.9998Z" fill="#70AD47" fill-rule="evenodd"/>
            <path d="M118 1663 1664 1663 1664 2364.17 1598.73 2388.04C1504.7 2417.26 1405.72 2435.25 1303.36 2440.44L1241.56 2442 1241.54 2442 1179.74 2440.44C708.884 2416.59 309.565 2121.78 134.823 1708.93Z" fill="#FFC000" fill-rule="evenodd"/>
            <path d="M819.5 117.5 819.669 1662.72" stroke="#BF5711" stroke-width="6.875" stroke-miterlimit="8" fill="none" fill-rule="evenodd"/>
            <path d="M2366.03 819.119 820.5 816.5" stroke="#538034" stroke-width="6.875" stroke-miterlimit="8" fill="none" fill-rule="evenodd"/>
            <path d="M0 0 1547 2.021" stroke="#E2AC00" stroke-width="6.875" stroke-miterlimit="8" fill="none" fill-rule="evenodd" transform="matrix(-1 0 0 1 1665.5 1660.5)"/>
            <path d="M1663.5 818.5 1663.5 2364.93" stroke="#215483" stroke-width="6.875" stroke-miterlimit="8" fill="none" fill-rule="evenodd"/>
        </g>
    </svg>
    </td>
    <td style="border-style: none;color: #47709e; font-weight: bold; font-size: 36px;">
      geowheel.ellipsoid / Python
    </td>
  </tr>
</table>

***

参考椭球体基础软件包。主要包括：  
* **Geometry-几何要素类**  
    支持地学实体几何要素加载、编码、转换、变换与序列化，几何要素主体采用{Python-dict}类型存储并符合{GeoJson-geometry}格式要求。  
    支持的几何格式如下：    
    > + **GeoJSON** - A format for encoding a variety of geographic data structures. RFC 7946 was published in August 2016 and is the new standard specification of the GeoJSON format.
    > + **WKT** - ISO 19162:2015(E) - Well-known Text (WKT) offers a compact machine- and human-readable representation of geometric objects.
    > + **WKB** - The well-known binary (WKB) representation for OGC geometry provides a portable representation of a geometry value as a contiguous stream of bytes.
    > + **GML** - ISO 19136:2007 - The Geography Markup Language (GML) is an XML grammar for expressing geographical features.
    > + **KML** - An XML language focused on geographic visualization, including annotation of maps and images. Geographic visualization includes not only the presentation of graphical data on the globe, but also the control of the user’s navigation in the sense of where to go and where to look.
    > + **Shapely** - A Python package for set-theoretic analysis and manipulation of planar features using functions from the well known and widely deployed GEOS library.
    > + **GDAL/OGR** - A vector geospatial geometric data formats based on Geospatial Data Abstraction Library (GDAL/OGR).
    
    支持的几何类型如下：  
    > + **Point** - A geometry type that represents a single coordinate with x,y and possibly z,m values.
    > + **LineString** - A geometry type composed of one or more line segments.
    > + **Polygon** - A geometry type representing an area that is enclosed by a linear ring.
    > + **MultiPoint** - A collection of one or more Points.
    > + **MultiLineString** - A collection of one or more LineStrings.
    > + **MultiPolygon** - A collection of one or more Polygons.
    > + **GeometryCollection** - A collection of one or more geometries that may contain more than one type of geometry.
* **Topology-几何要素拓扑类**  
    > 支持拓扑创建、拓扑检查、面积与长度计算和诸多空间运算功能。  
* **MapGrid-国际标准比例尺图幅分幅网格与编号类**  
    > + 支持比例尺：1∶1000000、1∶500000、1∶250000、1∶200000（非国际标准）、1∶100000、1∶50000、1∶25000、1∶10000、1∶5000、1∶2000、1∶1000、1∶500。      
    > + 算法依据《中华人民共和国国家标准 GB/T 13989-2012 国家基本比例尺地形图分幅和编号》（2012-06-29发布 2012-10-01实施）  
* **Projection-几何要素坐标投影变换类**  
    > 支持高斯-克吕格、球体墨卡托、阿尔勃斯、兰伯特投影正反算。  
* **ProjectionHelper-几何要素坐标投影助手类**  
    > 支持高斯-克吕格、球体墨卡托、阿尔勃斯、兰伯特等投影正反算。  
    用法示例：  
  > ```python
  >   >>> import geowheel.ellipsoid as ellipsoid
  >   >>> print(
  >       ellipsoid.ProjectionHelper(
  >           targetProjection=ellipsoid.ProjectionHelper.definition(projection="GaussKruger", centralMeridian=99)
  >       ).project(
  >           {'type': 'Point', 'coordinates': [100, 36]}
  >       )
  >   )
  >   # {'type': 'Point', 'coordinates': [590165.115456953, 3986005.1900442634]}
  >   >>> print(
  >       ellipsoid.ProjectionHelper(
  >           targetProjection=ellipsoid.ProjectionHelper.definition(projection="GaussKruger", centralMeridian=99)
  >       ).project(
  >           {"type":"MultiPoint","coordinates":[[98.52, 19.61], [100.22, 20.74], [100.97, 21.46]]}
  >       )
  >   )
  >   # {'type': 'MultiPoint', 'coordinates': [[449646.39107651, 2169263.3152799467], [627069.4918831721, 2294770.010626876], [704217.241296021, 2375292.866543003]]}
  >   >>> print(
  >       ellipsoid.ProjectionHelper(
  >           targetProjection=ellipsoid.ProjectionHelper.definition(projection="GaussKruger", centralMeridian=99)
  >       ).project(
  >           {"type":"LineString","coordinates": [[98.919, 44.4074], [98.923, 44.4075]]}
  >       )
  >   )
  >  # {'type': 'LineString', 'coordinates': [[493547.9177849664, 4919094.308987056], [493866.54958314006, 4919105.113591565]]}
  >   >>> print(
  >       ellipsoid.ProjectionHelper(
  >           targetProjection=ellipsoid.ProjectionHelper.definition(projection="GaussKruger", centralMeridian=99)
  >       ).project(
  >           {"type": "GeometryCollection","geometries":[{"type": "Point", "coordinates": [98.81, 37.24]},{"type":"LineString","coordinates": [[98.919, 44.4074], [98.923, 44.4075]]},{"type":"Polygon","coordinates":[[[99.38, 57.322], [100.43, 19.15], [100.194, 20.28], [99.38, 57.322]]]}]}
  >       )
  >   )
  >   # {'type': 'GeometryCollection', 'geometries': [{'type': 'Point', 'coordinates': [483141.07726688863, 4123163.065100722]}, {'type': 'LineString', 'coordinates': [[493547.9177849664, 4919094.308987056], [493866.54958314006, 4919105.113591565]]}, {'type': 'Polygon', 'coordinates': [[[522893.54108479613, 6355836.594960719], [650444.4843643629, 2118888.025401517], [624733.1105818641, 2243814.468236219], [522893.54108479613, 6355836.594960719]]]}]}
  > ```   
* **Astronomy-天文寻星计算类**  
    > 支持太阳、月球和静止轨道地球同步卫星基于地球参照系的相位参数计算。  

## Installation  
> Install geowheel.ellipsoid project with pip
> 
> ### Windows
> ```bash
>   python -m pip install --upgrade ellipsoid 
> ```
> ### Linux
> ```bash
>   python3 -m pip install --upgrade ellipsoid
> ```
> ### MacOS
> ```bash
>   python3 -m pip install --upgrade ellipsoid
> ```

## Usage/Examples

```python
>>> import geowheel.ellipsoid as ellipsoid
>>> print(
    ellipsoid.Topology.check(
        [
            {
                "type": "Polygon",
                "coordinates": [[[0, 0], [10, 0], [10, 10], [10, 0], [0, 0]]]
            }
        ],
        0b1111
    )
)
# {'polygon': [{'flag': 'SelfIntersection', 'type': 'Point', 'coordinates': [10.0, 0.0]}]}
```

## API Reference

### Get help on module geowheel.ellipsoid

```python
>>> help(ellipsoid)
```

* ### Class Geometry(builtins.object) 

*****

***Geometry.dumps***
> ```python
> @classmethod
> def dumps(
>        cls,
>        geometry: dict | list | str,
>        format: str = 'json'
> ) -> str  
> ```
> 将【GeoJson-geometry】几何字典对象序列化转储为指定格式的字符串  
>
> | Parameter | Type          | Description|
> |:----------|:--------------|:-----------|
> | geometry  | dict list str | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组|
> | format    | str           | 指定的几何格式，支持："json/geojson"（默认）、"wkt/wkb"、"gml"、"kml"|
> 
> 返回符合指定格式要求的字符串。失败时抛出异常  

***Geometry.fromGml***
> ```python
> @classmethod
> def fromGml(
>         cls,
>         geometry: str | etree._Element
> ) -> dict
> ```
> 将GML-V3.2几何字符串转换为【GeoJson-geometry】几何字典类型 
>
> | Parameter | Type               | Description    |
> |:----------|:-------------------|:---------------|
> | geometry  | str etree._Element | GML-V3.2几何字符串  |
> 
> 返回【GeoJson-geometry】格式的字典类型对象。失败时抛出异常

***Geometry.fromKml***
> ```python
> @classmethod
> def fromKml(
>         cls,
>         geometry: str | etree._Element
> ) -> dict
> ```
> 将KML几何元素（支持：Point、LineString、Polygon、MultiGeometry、Track）字符串或者XML几何对象转换为【GeoJson-geometry】格式的字典类型对象
>
> | Parameter | Type               | Description    |
> |:----------|:-------------------|:---------------|
> | geometry  | str etree._Element | KML几何元素字符串或者XML几何对象  |
> 
> 返回【GeoJson-geometry】格式的字典类型对象。失败时抛出异常

***Geometry.fromOgr***
> ```python
> @classmethod
> def fromOgr(
>         cls,
>         geometry: ogr.Geometry
> ) -> dict
> ```
> 将【ogr.Geometry】几何对象转换为【GeoJson-geometry】格式的字典类型对象
>
> | Parameter | Type          | Description    |
> |:----------|:--------------|:---------------|
> | geometry  | ogr.Geometry  | 【ogr.Geometry】几何对象  |
> 
> 返回【GeoJson-geometry】格式的字典类型对象。失败时抛出异常

***Geometry.fromShapely***
> ```python
> @classmethod
> def fromShapely(
>         cls,
>         geometry: shapely.geometry
> ) -> dict
> ```
> 将shapely几何对象转换为【GeoJson-geometry】格式的字典类型对象
>
> | Parameter | Type               | Description              |
> |:----------|:-------------------|:-------------------------|
> | geometry  | shapely.geometry   | shapely格式几何（geometry）对象  |
> 
> 返回符合【GeoJson-geometry】格式的字典类型对象，字典中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组。失败时抛出异常

***Geometry.getXY***
> ```python
> @classmethod
> def getXY(
>         cls,
>         geometry: dict | list | str,
>         endpoint: bool = True  
> ) -> list
> ```
> 提取指定几何体的顶点（或端点）坐标并返回可哈希的坐标元组列表
>
> | Parameter | Type          | Description                                                                                                  |
> |:----------|:--------------|:-------------------------------------------------------------------------------------------------------------|
> | geometry  | dict list str | GeoJSON几何字符串或字典对象以及列表对象，还可支持[shapely.geometry]格式，几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组  |
> | endpoint | bool          | 是否仅提取端点？省略时取默认值：True。注：此选项仅针对线要素和面要素有效 |
> 
> 返回坐标元组列表。失败时抛出异常

***Geometry.loads***
> ```python
> @classmethod
> def loads(
>         cls,
>         coordinates: str | list | dict,
>         code: int | None = -1
> ) -> dict
> ```
> 由符合【WKT/WKB、GeoJson、自由/简约文本】格式的几何坐标串或者符合【GeoJson-geometry】格式的列表及字典对象乃至【shapely.geometry】对象反序列化转换为符合【GeoJson-geometry】格式的字典类型对象。  
> - 注1：针对线和面要素，将自动剔除相邻重复点，面要素的线环将自动封闭。  
> - 注2：针对顶点坐标，要求至少是二维，且前两个维度应为浮点数值，为提升普适度，不对浮点型[x y]的定义域进行约束。  
> - 注3：针对WKB十六进制文本类型与GeometryCollection集合要素格式，将按实际内容解码，无需指定[code]参数。  
> - 注4：如果GeoJson以文本方式输入，其中的对象名必须采用双引号封闭。  
>
> | Parameter   | Type          | Description                                                                                                                     |
> |:------------|:--------------|:--------------------------------------------------------------------------------------------------------------------------------|
> | coordinates | str list dict | 几何坐标参数（不多于4维[x y z m]且要求前2维[x y]为浮点型）。其中，GeoJson格式需具有[方括号]标识，WKT格式需具有(圆括号)标识，自由格式仅识别【单点/单线/单面】几何类型                              |
> | code        | int None      | 几何类型代码：-1=自识别（默认值）、0=单点/多点、1=单线/多线、2=单面或母子面/多面。注：此参数通常仅当输入的坐标为简约格式且期望格式为[多点/多线]时需指定为[0/1]，或者当输入的坐标为自由格式时也应指定为[0/1/2]，以便消除二义性问题  |
> 
> 返回符合【GeoJson-geometry】格式的字典类型对象，字典中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的浮点型几何坐标数组。失败时抛出异常
> 
> - coordinates 参数格式说明  
>  - 自由文本格式（仅支持2维）  
>     - Point：code参数可为[0]或者[-1]  
>              'x y'  
>              'x,y'  
>     - LineString：code参数可为[1]或者[-1]，若code指定为0，便视为多点[MultiPoint]  
>              'x y,x y,...'  
>              'x,y x,y ...'  
>     - Polygon：code参数必须指定为[2]方可视为单面[Polygon]，若code指定为0，便视为多点[MultiPoint]，若code指定为1，便视为单线[LineString]  
>              'x y,x y,x y,x y,...'  
>              'x,y x,y x,y x,y ...'  
>  - GeoJson  
>    - Point：  
>         [x,y,z,m]  # 简约格式  
>         {"type":"Point","coordinates":[x,y,z,m]}  
>    - MultiPoint：  
>         [[x,y,z,m],[x,y,z,m],...]  # 简约格式  
>         {"type":"MultiPoint","coordinates":[[x,y,z,m],[x,y,z,m],...]}  
>    - LineString：  
>         [[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],...]  # 简约格式  
>         {"type":"LineString","coordinates":[[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],...]}  
>    - MultiLineString：  
>         [[[x,y,z,m],[x,y,z,m],[x,y,z,m]],[[x,y,z,m],[x,y,z,m],[x,y,z,m],...],...]  # 简约格式  
>         {"type":"MultiLineString","coordinates":[[[x,y,z,m],[x,y,z,m],[x,y,z,m]],[[x,y,z,m],[x,y,z,m],[x,y,z,m],...],...]}  
>    - Polygon（单面或母子面）：    
>         [[[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],...],...]  # 简约格式  
>         {"type":"Polygon","coordinates":[[[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],...],...]}  
>    - MultiPolygon：  
>         [[[[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],...],...],...]  # 简约格式  
>         {"type":"MultiPolygon","coordinates":[[[[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],...],...],...]}  
>    - GeometryCollection：  
>         {'type': 'GeometryCollection', 'geometries': [{"type":"Point","coordinates":[x,y,z,m]}, {"type":"LineString","coordinates":[[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],...]}, {"type":"Polygon","coordinates":[[[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],[x,y,z,m],...],...]}]}  
>   - WKT（Well-Known Text 采用文本字符串存储）    
>     - Point：  
>         (x y z m)  # 简约格式  
>         POINT(x y z m)  
>     - MultiPoint：  
>         (x y z m,x y z m,...)  # 简约格式  
>         MULTIPOINT(x y z m,x y z m,...)  
>     - LineString：  
>         (x y z m,x y z m,...)  # 简约格式  
>         LINESTRING(x y z m,x y z m,...)  
>     - MultiLineString：  
>         ((x y z m,x y z m,...),...)  # 简约格式  
>         MULTILINESTRING((x y z m,x y z m,...),...)  
>     - Polygon（单面或母子面）：  
>         ((x y z m,x y z m,...),...)  # 简约格式  
>         POLYGON((x y z m,x y z m,...),...)  
>     - MultiPolygon：  
>         (((x y z m,x y z m,...),...),...)  
>         MULTIPOLYGON(((x y z m,x y z m,...),...),...)  
>     - GEOMETRYCOLLECTION（不支持简约格式）：  
>         GEOMETRYCOLLECTION(POINT(x y z m), LINESTRING(x y z m,x y z m,...), POLYGON((x y z m,x y z m,...),...))  
>   - WKB（Well-known Binary 采用十六进制字节串存储）  
>     b"??..."  # 由诸多[00～FF]构成的字节串   
>   
> 
> - 自由文本格式示例
> ```python
> # Point
> >>> ellipsoid.Geometry.loads('120,38', -1 or 0)   
> >>> ellipsoid.Geometry.loads('120 38', -1 or 0)   
> # {'type': 'Point', 'coordinates': [120, 38]}
> ``` 
> ```python
> # MultiPoint
> >>> ellipsoid.Geometry.loads('120 38,122 39,99 28,120 38', 0)   
> >>> ellipsoid.Geometry.loads('120,38 122,39 99,28 120,38', 0)  
> # {'type': 'MultiPoint', 'coordinates': [[120, 38], [122, 39], [99, 28], [120, 38]]}  
> ``` 
> ```python
> # LineString
> >>> ellipsoid.Geometry.loads('120 38,122 39,99 28,120 38', -1 or 1)   
> >>> ellipsoid.Geometry.loads('120,38 122,39 99,28 120,38', -1 or 1)  
> # {'type': 'LineString', 'coordinates': [[120, 38], [122, 39], [99, 28], [120, 38]]}  
> ```  
> ```python
> # Polygon
> >>> ellipsoid.Geometry.loads('120 38,122 39,99 28,120 38', 2)    
> >>> ellipsoid.Geometry.loads('120,38 122,39 99,28 120,38', 2)   
> # {'type': 'Polygon', 'coordinates': [[[120, 38], [122, 39], [99, 28], [120, 38]]]}    
> ```     
>   
> - GeoJSON 格式示例  
> ```python
> # Point
> >>> ellipsoid.Geometry.loads([-115.81, 37.24],-1 or 0)     
> >>> ellipsoid.Geometry.loads('[-115.81, 37.24]',-1 or 0)    
> >>> ellipsoid.Geometry.loads('{"type": "Point", "coordinates": [-115.81, 37.24]}', -1 or 0)  
> >>> ellipsoid.Geometry.loads({"type": "Point", "coordinates": [-115.81, 37.24]},-1 or 0)  
> # {'type': 'Point', 'coordinates': [-115.81, 37.24]}   
> ```
> ```python
> # MultiPoint / LineString  
> >>> ellipsoid.Geometry.loads([[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]], 0)     
> >>> ellipsoid.Geometry.loads('[[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]]', 0)   
> >>> ellipsoid.Geometry.loads('{"type":"MultiPoint","coordinates":[[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]]}',-1 or 0)  
> >>> ellipsoid.Geometry.loads({"type":"MultiPoint","coordinates":[[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]]},-1 or 0)  
> # {'coordinates': [[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]], 'type': 'MultiPoint'}    
> >>> ellipsoid.Geometry.loads([[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]], -1 or 1)    
> >>> ellipsoid.Geometry.loads('[[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]]', -1 or 1)  
> # {'coordinates': [[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]], 'type': 'LineString'}  
> ```
> ```python
> # LineString   
> >>> ellipsoid.Geometry.loads([[8.919, 44.4074], [8.923, 44.4075]], -1 or 1)  
> >>> ellipsoid.Geometry.loads('[[8.919, 44.4074], [8.923, 44.4075]]', -1 or 1)  
> >>> ellipsoid.Geometry.loads('{"type":"LineString","coordinates": [[8.919, 44.4074], [8.923, 44.4075]]}', -1 or 1)  
> >>> ellipsoid.Geometry.loads({"type":"LineString","coordinates": [[8.919, 44.4074], [8.923, 44.4075]]}, -1 or 1)  
> # {'coordinates': [[8.919, 44.4074], [8.923, 44.4075]], 'type': 'LineString'}    
> ```     
> ```python
> # MultiLineString / Polygon    
> >>> ellipsoid.Geometry.loads([[[3.75, 9.25], [-130.95, 1.52]], [[23.15, -34.25], [-1.35, -4.65], [3.45, 77.95]]], 1)   
> >>> ellipsoid.Geometry.loads('[[[3.75, 9.25], [-130.95, 1.52]], [[23.15, -34.25], [-1.35, -4.65], [3.45, 77.95]]]', 1)   
> >>> ellipsoid.Geometry.loads('{"type":"MultiLineString","coordinates":[[[3.75, 9.25], [-130.95, 1.52]], [[23.15, -34.25], [-1.35, -4.65], [3.45, 77.95]]]}', -1 or 1)  
> >>> ellipsoid.Geometry.loads({"type":"MultiLineString","coordinates":[[[3.75, 9.25], [-130.95, 1.52]], [[23.15, -34.25], [-1.35, -4.65], [3.45, 77.95]]]}, -1 or 1)  
> # {'type': 'MultiLineString', 'coordinates': [[[3.75, 9.25], [-130.95, 1.52]], [[23.15, -34.25], [-1.35, -4.65], [3.45, 77.95]]]}   
> ```         
> ```python
> # no hole within polygon  
> >>> ellipsoid.Geometry.loads([[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]], -1 or 2)  
> >>> ellipsoid.Geometry.loads('[[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]]', -1 or 2)  
> >>> ellipsoid.Geometry.loads('{"type":"Polygon","coordinates":[[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]]}', -1 or 2)  
> >>> ellipsoid.Geometry.loads({"type":"Polygon","coordinates":[[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]]}, -1 or 2)  
> # {'type': 'Polygon', 'coordinates': [[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]]}  
> ```          
> ```python
> # hole within polygon   
> >>> ellipsoid.Geometry.loads('{"type":"Polygon","coordinates":[[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]], [[-5.21, 23.51], [15.21, -10.81], [-20.51, 1.51], [-5.21, 23.51]]]}', -1 or 2)  
> >>> ellipsoid.Geometry.loads({"type":"Polygon","coordinates":[[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]], [[-5.21, 23.51], [15.21, -10.81], [-20.51, 1.51], [-5.21, 23.51]]]}, -1 or 2)  
> >>> ellipsoid.Geometry.loads('[[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]], [[-5.21, 23.51], [15.21, -10.81], [-20.51, 1.51], [-5.21, 23.51]]]', -1 or 2)  
> >>> ellipsoid.Geometry.loads([[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]], [[-5.21, 23.51], [15.21, -10.81], [-20.51, 1.51], [-5.21, 23.51]]], -1 or 2)          
> # {'type': 'Polygon', 'coordinates': [[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]], [[-5.21, 23.51], [15.21, -10.81], [-20.51, 1.51], [-5.21, 23.51]]]}  
> ```        
> ```python
> # MultiPolygon   
> >>> ellipsoid.Geometry.loads('{"type":"MultiPolygon","coordinates":[[[[3.78, 9.28], [-130.91, 1.52], [35.12, 72.234], [3.78, 9.28]]], [[[23.18, -34.29], [-1.31, -4.61], [3.41, 77.91], [23.18, -34.29]]]]}', -1 or 2)  
> >>> ellipsoid.Geometry.loads({"type":"MultiPolygon","coordinates":[[[[3.78, 9.28], [-130.91, 1.52], [35.12, 72.234], [3.78, 9.28]]], [[[23.18, -34.29], [-1.31, -4.61], [3.41, 77.91], [23.18, -34.29]]]]}, -1 or 2)  
> >>> ellipsoid.Geometry.loads('[[[[3.78, 9.28], [-130.91, 1.52], [35.12, 72.234], [3.78, 9.28]]], [[[23.18, -34.29], [-1.31, -4.61], [3.41, 77.91], [23.18, -34.29]]]]', -1 or 2)  
> >>> ellipsoid.Geometry.loads([[[[3.78, 9.28], [-130.91, 1.52], [35.12, 72.234], [3.78, 9.28]]], [[[23.18, -34.29], [-1.31, -4.61], [3.41, 77.91], [23.18, -34.29]]]], -1 or 2)           
> # {'type': 'MultiPolygon', 'coordinates': [[[[3.78, 9.28], [-130.91, 1.52], [35.12, 72.234], [3.78, 9.28]]], [[[23.18, -34.29], [-1.31, -4.61], [3.41, 77.91], [23.18, -34.29]]]]}  
> ```        
> ```python
> # GeometryCollection（不支持简约格式且可忽略识别码）    
> >>> ellipsoid.Geometry.loads({"type": "GeometryCollection","geometries":[{"type": "Point", "coordinates": [-115.81, 37.24]},{"type":"LineString","coordinates": [[8.919, 44.4074], [8.923, 44.4075]]},{"type":"Polygon","coordinates":[[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]]}]})  
> >>> ellipsoid.Geometry.loads('{"type": "GeometryCollection","geometries":[{"type": "Point", "coordinates": [-115.81, 37.24]},{"type":"LineString","coordinates": [[8.919, 44.4074], [8.923, 44.4075]]},{"type":"Polygon","coordinates":[[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]]}]}')      
> # {'type': 'GeometryCollection', 'geometries': [{'type': 'Point', 'coordinates': [-115.81, 37.24]}, {'type': 'LineString', 'coordinates': [[8.919, 44.4074], [8.923, 44.4075]]}, {'type': 'Polygon', 'coordinates': [[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]]}]}   
> ```           
>      
> - WKT 格式示例  
> ```python
> # Point  
> >>> ellipsoid.Geometry.loads('POINT(-115.81 37.24)', -1 or 0)   
> >>> ellipsoid.Geometry.loads('(-115.81 37.24)', -1 or 0)   
> # {'type': 'Point', 'coordinates': [-115.81, 37.24]}   
> ``` 
> ```python
> # MultiPoint / LineString     
> >>> ellipsoid.Geometry.loads('MULTIPOINT(-155.52 19.61,-156.22  20.74,-157.97  21.46)', -1 or 0)  
> >>> ellipsoid.Geometry.loads('(-155.52 19.61,-156.22  20.74,-157.97  21.46)', 0)  
> # {'type': 'MultiPoint', 'coordinates': [[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]]}   
> >>> ellipsoid.Geometry.loads('(-155.52 19.61,-156.22  20.74,-157.97  21.46)', -1)   
> # {'type': 'LineString', 'coordinates': [[-155.52, 19.61], [-156.22, 20.74], [-157.97, 21.46]]}  
> ``` 
> ```python
> # LineString   
> >>> ellipsoid.Geometry.loads('LINESTRING(8.919 44.4074,8.923 44.4075)', -1 or 1)    
> >>> ellipsoid.Geometry.loads('(8.919 44.4074,8.923 44.4075)', -1 or 1)   
> # {'type': 'LineString', 'coordinates': [[8.919, 44.4074], [8.923, 44.4075]]}   
> ```  
> ```python
> # MultiLineString / Polygon  
> >>> ellipsoid.Geometry.loads('MULTILINESTRING((3.75 9.25,-130.95 1.52),(23.15 -34.25,-1.35 -4.65,3.45 77.95))', -1 or 1)  
> >>> ellipsoid.Geometry.loads('((3.75 9.25,-130.95 1.52),(23.15 -34.25,-1.35 -4.65,3.45 77.95))', 1)  
> # {'type': 'MultiLineString', 'coordinates': [[[3.75, 9.25], [-130.95, 1.52]], [[23.15, -34.25], [-1.35, -4.65], [3.45, 77.95]]]}  
> >>> ellipsoid.Geometry.loads('((3.75 9.25,-130.95 1.52),(23.15 -34.25,-1.35 -4.65,3.45 77.95))', -1)  
> # {'type': 'Polygon', 'coordinates': [[[3.75, 9.25], [-130.95, 1.52]], [[23.15, -34.25], [-1.35, -4.65], [3.45, 77.95]]]}  
> ```
> ```python
> # no hole within polygon  
> >>> ellipsoid.Geometry.loads('POLYGON((2.38 57.322,-120.43 19.15,23.194 -20.28,2.38 57.322))', -1 or 2)  
> >>> ellipsoid.Geometry.loads('((2.38 57.322,-120.43 19.15,23.194 -20.28,2.38 57.322))', -1 or 2)  
> # {'type': 'Polygon', 'coordinates': [[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]]]}  
> ```      
> ```python
> # hole within polygon   
> >>> ellipsoid.Geometry.loads('POLYGON((2.38 57.322,-120.43 19.15,23.194 -20.28,2.38 57.322),(-5.21 23.51,15.21 -10.81,-20.51 1.51,-5.21 23.51))', -1 or 2)  
> >>> ellipsoid.Geometry.loads('((2.38 57.322,-120.43 19.15,23.194 -20.28,2.38 57.322),(-5.21 23.51,15.21 -10.81,-20.51 1.51,-5.21 23.51))', -1 or 2)  
> # {'type': 'Polygon', 'coordinates': [[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38], [57.322]], [[-5.21, 23.51], [15.21, -10.81], [-20.51, 1.51], [-5.21, 23.51]]]}  
> ```       
> ```python
> # MultiPolygon  
> >>> ellipsoid.Geometry.loads('MULTIPOLYGON(((3.78 9.28,-130.91 1.52,35.12 72.234,3.78 9.28)),((23.18 -34.29,-1.31 -4.61,3.41 77.91,23.18 -34.29)))', -1 or 2)  
> >>> ellipsoid.Geometry.loads('(((3.78 9.28,-130.91 1.52,35.12 72.234,3.78 9.28)),((23.18 -34.29,-1.31 -4.61,3.41 77.91,23.18 -34.29)))', -1 or 2)  
> # {'type': 'MultiPolygon', 'coordinates': [[[[3.78, 9.28], [-130.91, 1.52], [35.12, 72.234], [3.78, 9.28]]], [[[23.18, -34.29], [-1.31, -4.61], [3.41, 77.91], [23.18, -34.29]]]]}  
> ```  
> ```python
> # GeometryCollection（不支持简约格式且应将识别码取默认值[-1]）    
> >>> ellipsoid.Geometry.loads('GEOMETRYCOLLECTION (POINT (-115.81 37.24),LINESTRING (8.919 44.4074,8.923 44.4075),POLYGON ((2.38 57.322,-120.43 19.15,23.194 -20.28,2.38 57.322)))',-1)  
> # {'type': 'GeometryCollection', 'geometries': [{'type': 'Point', 'coordinates': [-115.81, 37.24]}, {'type': 'LineString', 'coordinates': [[8.919, 44.4074], [8.923, 44.4075]]}]} 
> ```
>       
> - WKB 格式示例  
> ```python
> # Point   
> >>> ellipsoid.Geometry.toWkb({"type": "Point", "coordinates": [-115.81, 37.24]})  
> # 0101000020E6100000A4703D0AD7F35CC01F85EB51B89E4240   
> SQL> SELECT ST_AsGeoJSON(ST_GeomFromEWKB(E'\\x0101000020E6100000A4703D0AD7F35CC01F85EB51B89E4240'))   
> >>> ellipsoid.Geometry.loads('0101000020E6100000A4703D0AD7F35CC01F85EB51B89E4240')
> # {"type":"Point","coordinates":[-115.81,37.24]}  
> ``` 
> 

***Geometry.rotate***
> ```python
> @classmethod
> def rotate(
>        cls,
>        geometry: dict | list | str,
>        angle: float,
>        origin: str | tuple = (0, 0, 0)
> ) -> shapely.geometry
> ```
> 旋转几何对象  
>
> | Parameter | Type                   | Description                                                                  |
> |:----------|:-----------------------|:-----------------------------------------------------------------------------|
> | geometry  | dict list str          | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组                   |
> | angle     | float                  | 旋转角（十进制度格式 - 正值为逆时针旋转，负值为顺时针旋转）                                              |
> | origin    | str tuple = (0, 0, 0)  | 参考原点（旋转中心），可为不超过3维的元组类型点状坐标、几何边框中心'center'、几何质心'centroid'，省略时取默认值：(0, 0, 0)  |
> 
> 返回shapely格式几何（geometry）对象。失败时抛出异常

***Geometry.scale***
> ```python
> @classmethod
> def scale(
>         cls,
>         geometry: dict | list | str,
>         xfact: float = 1.0,
>         yfact: float = 1.0,
>         zfact: float = 1.0,
>         origin: str | tuple = (0, 0, 0)
> ) -> shapely.geometry
> ```
> 缩放几何对象  
>
> | Parameter | Type                   | Description                                                                 |
> |:----------|:-----------------------|:----------------------------------------------------------------------------|
> | geometry  | dict list str          | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组                  |
> | xfact     | float                  | 横向缩放因子（比例），省略时取默认值：1.0                                                      |
> | yfact     | float                  | 纵向缩放因子（比例），省略时取默认值：1.0                                                      |
> | zfact     | float                  | 竖向缩放因子（比例），省略时取默认值：1.0                                                      |
> | origin    | str tuple = (0, 0, 0)  | 参考原点，可为不超过3维的元组类型点状坐标、几何边框中心'center'、几何质心'centroid'，省略时取默认值：(0, 0, 0) |
> 
> 返回shapely格式几何（geometry）对象。失败时抛出异常

***Geometry.skew***
> ```python
> @classmethod
> def skew(
>         cls,
>         geometry: dict | list | str,
>         xs: float = 0.0,
>         ys: float = 0.0,
>         origin: str | tuple = (0, 0, 0)
> ) -> shapely.geometry
> ```
> 扭斜几何对象    
>
> | Parameter | Type                   | Description                                                                 |
> |:----------|:-----------------------|:----------------------------------------------------------------------------|
> | geometry  | dict list str          | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组                  |
> | xs        | float                  | 沿横向坐标轴的倾斜角（十进制度格式 - 正值为逆时针旋转，负值为顺时针旋转），省略时取默认值：0.0 |
> | ys        | float                  | 沿纵向坐标轴的倾斜角（十进制度格式 - 正值为逆时针旋转，负值为顺时针旋转），省略时取默认值：0.0 |
> | origin    | str tuple = (0, 0, 0)  | 参考原点，可为不超过3维的元组类型点状坐标、几何边框中心'center'、几何质心'centroid'，省略时取默认值：(0, 0, 0) |
> 
> 返回shapely格式几何（geometry）对象。失败时抛出异常

***Geometry.swapXY***
> ```python
> @classmethod
> def swapXY(
>         cls,
>         geometry: dict | list | str
> ) -> dict  
> ```
> 交换指定几何体的顶点坐标[x,y,z,m]中的[x,y]顺序（[x,y,z,m] to [y,x,z,m]）   
>  
> | Parameter | Type                   | Description                                                 |
> |:----------|:-----------------------|:------------------------------------------------------------|
> | geometry  | dict list str          | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组  |
> 
> 返回【GeoJson-geometry】格式的字典类型对象。失败时抛出异常

***Geometry.toGml***
> ```python
> @classmethod
> def toGml(
>         cls,
>         geometry: dict | list | str
> ) -> etree._Element  
> ```
> 将【GeoJson-geometry】何字符串或字典对象以及列表对象转换为GML-V3.2格式几何对象  
>  
> | Parameter | Type                   | Description                                                 |
> |:----------|:-----------------------|:------------------------------------------------------------|
> | geometry  | dict list str          | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组  |
> 
> 返回GML-V3.2格式几何对象（解码为字符串：lxml.etree.tostring(resultGml, pretty_print=True).decode()）。失败时抛出异常

***Geometry.toKml***
> ```python
> @classmethod
> def toKml(
>         cls,
>         geometry: dict | list | str
> ) -> etree._Element  
> ```
> 将【GeoJson-geometry】几何字典对象转换为KML格式几何元素对象  
>  
> | Parameter | Type                   | Description                                                 |
> |:----------|:-----------------------|:------------------------------------------------------------|
> | geometry  | dict list str          | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组  |
> 
> 返回KML格式几何元素对象（解码为字符串：lxml.etree.tostring(resultKml, pretty_print=True).decode()）。失败时抛出异常

***Geometry.toOgr***
> ```python
> @classmethod
> def toOgr(
>         cls,
>         geometry: dict | list | str
> ) -> ogr.Geometry
> ```
> 将【GeoJson-geometry】几何字符串或字典对象以及列表对象转换为[OSGEO - GDAL - Geometry]格式几何对象  
>  
> | Parameter | Type                   | Description                                                 |
> |:----------|:-----------------------|:------------------------------------------------------------|
> | geometry  | dict list str          | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组  |
> 
> 返回[OSGEO - GDAL - Geometry]格式几何对象。失败时抛出异常

***Geometry.toShapely***
> ```python
> @classmethod
> def toShapely(
>         cls,
>         geometry: dict | list | str,
>         srid: int | None = 4326
> ) -> shapely.geometry
> ```
> 将【GeoJson-geometry】几何字符串或字典对象以及列表对象转换为shapely格式几何对象。注：几何坐标最多支持3维  
>  
> | Parameter | Type          | Description                                                       |
> |:----------|:--------------|:------------------------------------------------------------------|
> | geometry  | dict list str | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组        |
> | srid      | int None      | 几何投影参照系OGC类型代码，默认值：4326=十进制经纬度格式；设定为0时意指未定义参照系;如果设为None，将不设置投影参量  |
> 
> 返回shapely格式几何（geometry）对象。失败时抛出异常

***Geometry.toSvg***
> ```python
> @classmethod
> def toSvg(
>         cls,
>         geometry: dict | list | str,
>         scale_factor: float = 1.0,
>         color: str = None,
>         opacity: float = None
> ) -> str
> ```
> 将【GeoJson-geometry】几何字符串或字典对象以及列表对象或者【shapely】格式对象转换为SVG格式   
>  
> | Parameter    | Type          | Description                                                |
> |:-------------|:--------------|:-----------------------------------------------------------|
> | geometry     | dict list str | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组 |
> | scale_factor | float         | 画笔宽度的缩放因子，默认值：1.0                                          |
> | color        | str           | 画笔颜色或者填充颜色（十六进制字符串），有效几何的默认色：“#66cc99”，无效几何的默认色：“#ff3333”  |
> | opacity      | float         | 色彩透明度（介于[0,1]之间），默认值：0.6（点）、0.8（线面）                        |
> 
> 返回XML格式SVG几何字符串. 失败时抛出异常  

***Geometry.toWkb***
> ```python
> @classmethod
> def toWkb(
>         cls,
>         geometry: dict | list | str,
>         srid: int | None = 4326
> ) -> str
> ```
> 将【GeoJson-geometry】几何字典对象转换为OGC-WKB十六进制几何文本  
>  
> | Parameter | Type          | Description                                                       |
> |:----------|:--------------|:------------------------------------------------------------------|
> | geometry  | dict list str | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组        |
> | srid      | int None      | 几何投影参照系OGC类型代码，默认值：4326=十进制经纬度格式；设定为0时意指未定义参照系;如果设为None，将不设置投影参量  |
> 
> 返回OGC-WKB（可包含srid）十六进制几何文本。失败时抛出异常  
>  
> EPSG:4326坐标系下的WKB编码样例：   
>> 单点  
>> ellipsoid.Geometry.toWkb({"type": "Point", "coordinates": [1, 2]})  
>> 0101000020E6100000000000000000F03F0000000000000040  
>  
>> 多点  
>> ellipsoid.Geometry.toWkb({"type": "MultiPoint", "coordinates": [[1, 2], [3, 4]]})  
>> 0104000020E6100000020000000101000000000000000000F03F0000000000000040010100000000000000000008400000000000001040  
>  
>> 单线  
>> ellipsoid.Geometry.toWkb({"type": "LineString", "coordinates": [[1, 2], [3, 4]]})  
>> 0102000020E610000002000000000000000000F03F000000000000004000000000000008400000000000001040  
>  
>> 多线  
>> ellipsoid.Geometry.toWkb({"type": "MultiLineString", "coordinates": [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]})  
>> 0105000020e610000002000000010200000002000000000000000000f03f000000000000004000000000000008400000000000001040010200000002000000000000000000144000000000000018400000000000001c400000000000002040  
>   
>> 单面  
>> ellipsoid.Geometry.toWkb({"type": "Polygon", "coordinates": [[[1, 2], [3, 4]], [[5, 6], [7, 8],[1, 2]]]})  
>> 0103000020E61000000200000002000000000000000000F03F00000000000000400000000000000840000000000000104003000000000000000000144000000000000018400000000000001C400000000000002040000000000000F03F0000000000000040  
>  
>> 母子面  
>> ellipsoid.Geometry.toWkb({"type": "Polygon", "coordinates": [[[2.38, 57.322], [-120.43, 19.15], [23.194, -20.28], [2.38, 57.322]], [[-5.21, 23.51], [15.21, -10.81], [-20.51, 1.51], [-5.21, 23.51]]]})  
>> 0103000020E610000002000000040000000AD7A3703D0A0340F0A7C64B37A94C40EC51B81E851B5EC066666666662633408B6CE7FBA931374048E17A14AE4734C00AD7A3703D0A0340F0A7C64B37A94C4004000000D7A3703D0AD714C0C3F5285C8F823740EC51B81E856B2E401F85EB51B89E25C0C3F5285C8F8234C0295C8FC2F528F83FD7A3703D0AD714C0C3F5285C8F823740  
>  
>> 多面  
>> ellipsoid.Geometry.toWkb({"type": "MultiPolygon", "coordinates": [[[[3.78, 9.28], [-130.91, 1.52], [35.12, 72.234], [3.78, 9.28]]], [[[23.18, -34.29], [-1.31, -4.61], [3.41, 77.91], [23.18, -34.29]]]]})  
>> 0106000020E610000002000000010300000001000000040000003D0AD7A3703D0E408FC2F5285C8F224085EB51B81E5D60C052B81E85EB51F83F8FC2F5285C8F4140E5D022DBF90E52403D0AD7A3703D0E408FC2F5285C8F224001030000000100000004000000AE47E17A142E374085EB51B81E2541C0F6285C8FC2F5F4BF713D0AD7A37012C048E17A14AE470B400AD7A3703D7A5340AE47E17A142E374085EB51B81E2541C0  

***Geometry.toWkt***
> ```python
> @classmethod
> def toWkt(
>         cls,
>         geometry: dict | list | str
> ) -> str 
> ```
> 将【GeoJson-geometry】几何字典对象转换为OGC-WKT(Well-known Text）格式字符串  
>  
> | Parameter | Type                   | Description                                                 |
> |:----------|:-----------------------|:------------------------------------------------------------|
> | geometry  | dict list str          | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组  |
> 
> 返回WKT格式字符串。失败时抛出异常  

***Geometry.translate***
> ```python
> @classmethod
> def translate(
>         cls,
>         geometry: dict | list | str,
>         xoff: float = 0.0,
>         yoff: float = 0.0,
>         zoff: float = 0.0
> ) -> shapely.geometry
> ```
> 平移几何对象   
>  
> | Parameter | Type          | Description                                                |
> |:----------|:--------------|:-----------------------------------------------------------|
> | geometry  | dict list str | 几何字典参数中的【type】成员为几何类型名称，【coordinates】成员为符合GeoJson格式的几何坐标数组 |
> | xoff      | float         | 沿横向坐标轴的平移量，省略时取默认值：0.0                                     |
> | yoff      | float         | 沿纵向坐标轴的平移量，省略时取默认值：0.0                                     | 
> | zoff      | float         | 沿纵向坐标轴的平移量，省略时取默认值：0.0                                     |
> 
> 返回shapely格式几何（geometry）对象。失败时抛出异常    

*****
* ### Class MapGrid(builtins.object)

*****

***MapGrid.map***
> ```python
> @classmethod
> def map(
>        cls,
>        longitude: float,
>        latitude: float,
>        scale: int = 1000000
> ) -> dict
> ```
> 由十进制经纬度位置和比例尺分母计算所在比例尺的图幅新旧编号（南半球冠以S前缀，北半球省略N前缀）与边框范围。注：如果指定位置恰好位于图幅边缘，将返回右上角图幅结果信息  
>
> | Parameter | Type  | Description                     |
> |:----------|:------|:--------------------------------|
> | longitude | float | 十进制经度，定义域为：[-180 ～ +180]        |
> | latitude  | float | 十进制纬度，定义域为：[-90 ～ +90]          | 
> | scale     | int   | 比例尺分母，定义域为：[1000000（默认） ～ 500]  |
> 
> 返回所在比例尺的图幅新旧编号与边框范围构成的字典对象，运行失败时抛出异常  
>   
> 示例（位置：114°33′45″,39°22′30″）：
>> ```python
>> ellipsoid.MapGrid.map(longitude=114.5625, latitude=39.375, scale=1000000)  
>> # {'new': 'J50', 'old': 'J-50', 'boundary': {'north': 40, 'south': 36, 'west': 114, 'east': 120}}  
>> ellipsoid.MapGrid.map(longitude=114.5625, latitude=39.375, scale=500000)  
>> # {'new': 'J50B001001', 'old': 'J-50-A', 'boundary': {'north': 40.0, 'south': 38.0, 'west': 114.0, 'east': 117.0}}  
>> ellipsoid.MapGrid.map(longitude=114.5625, latitude=39.375, scale=250000)  
>> # {'new': 'J50C001001', 'old': 'J-50-[1]', 'boundary': {'north': 40.0, 'south': 39.0, 'west': 114.0, 'east': 115.5}}  
>> ellipsoid.MapGrid.map(longitude=114.5625, latitude=39.375, scale=200000)   
>> # {'new': 'J-50-(01)', 'old': 'J-50-(01)', 'boundary': {'north': 40.0, 'south': 39.333333333333336, 'west': 114.0, 'east': 115.0}}   
>> ellipsoid.MapGrid.map(longitude=114.5625, latitude=39.375, scale=100000)  
>> # {'new': 'J50D002002', 'old': 'J-50-14', 'boundary': {'north': 39.66666666666667, 'south': 39.333333333333336, 'west': 114.5, 'east': 115.0}}  
>> e