Shapely中的几何图形操作
|
Geometric Objects |
||
|
object.area |
Returns the area (float) of the object. |
|
|
object.bounds |
Returns a (minx, miny, maxx, maxy) tuple (float values) that bounds the object. |
|
|
object.length |
Returns the length (float) of the object. |
|
|
object.geom_type |
Returns a string specifying the Geometry Type |
|
|
object.distance(other) |
Returns the minimum distance (float) to the other geometric object. |
|
|
object.representative_point() |
Returns a cheaply computed point that is guaranteed to be within the geometric object. |
|
|
Unary Predicates |
||
|
object.has_z |
Returns True if the feature has not only x and y, but also z coordinates for 3D (or so-called, 2.5D) geometries. |
|
|
object.is_ccw |
Returns True if coordinates are in counter-clockwise order (bounding a region with positive signed area). This method applies to LinearRing objects only |
|
|
object.is_empty |
Returns True if the feature’s interior and boundary (in point set terms) coincide with the empty set. |
|
|
object.is_ring |
Returns True if the feature is closed. A closed feature’s boundary coincides with the empty set. |
|
|
object.is_simple |
Returns True if the feature does not cross itself. |
|
|
object.is_valid |
Returns True if a feature is “valid” in the sense of [1]. |
|
Binary Predicates |
||
|
object.almost_equals (other[, decimal=6]) |
Returns True if the object is approximately equal to the other at all points to specified decimal place precision. |
|
|
object.contains(other) |
Returns True if the object’s interior contains the boundary and interior of the other object and their boundaries do not touch at all. |
|
|
object.crosses(other) |
Returns True if the interior of the object intersects the interior of the other but does not contain it, and the dimension of the intersection is less than the dimension of the one or the other. |
|
|
object.disjoint(other) |
Returns True if the boundary and interior of the object do not intersect at all with those of the other. |
|
|
object.equals(other) |
Returns True if the set-theoretic boundary, interior, and exterior of the object coincide with those of the other. |
|
|
object.intersects(other) |
Returns True if the boundary and interior of the object intersect in any way with those of the other. |
|
|
object.touches(other) |
Returns True if the objects have at least one point in common and their interiors do not intersect with any part of the other. |
|
|
object.within(other) |
Returns True if the object’s boundary and interior intersect only with the interior of the other (not its boundary or exterior). |
|
DE-9IM Relationships |
||
|
object.relate(other) |
Returns a string representation of the DE-9IM matrix of relationships between an object’s interior, boundary, exterior and those of another geometric object. |
|
Set-theoretic Methods |
||
|
object.boundary |
Returns a lower dimensional object representing the object’s set-theoretic boundary. |
|
|
object.centroid |
Returns a representation of the object’s geometric centroid (point). |
|
|
object.difference(other) |
Returns a representation of the points making up this geometric object that do not make up the other object. |
|
|
object.intersection(other) |
Returns a representation of the intersection of this object with the other geometric object. |
|
|
object.symmetric_difference(other) |
Returns a representation of the points in this object not in the other geometric object, and the points in the other not in this geometric object. |
|
|
object.union(other) |
Returns a representation of the union of points from this object and the other geometric object. |
|
Constructive Methods |
||
|
object.buffer (distance, resolution=16, cap_style=1, join_style=1, mitre_limit=1.0) |
Returns an approximate representation of all points within a given distance of the this geometric object. |
|
|
object.convex_hull |
Returns a representation of the smallest convex Polygon containing all the points in the object unless the number of points in the object is less than three. |
|
|
object.envelope |
Returns a representation of the point or smallest rectangular polygon (with sides parallel to the coordinate axes) that contains the object. |
|
|
object.parallel_offset (distance, side, resolution=16, join_style=1, mitre_limit=1.0) |
Returns a LineString or MultiLineString geometry at a distance from the object on its right or its left side. |
|
|
object.simplify(tolerance, preserve_topology=True) |
Returns a simplified representation of the geometric object. |
|
Affine Transformations |
||
|
shapely.affinity.affine_transform (geom, matrix) |
Returns a transformed geometry using an affine transformation matrix. |
|
|
shapely.affinity.rotate (geom, angle, origin='center', use_radians=False) |
Returns a rotated geometry on a 2D plane. |
|
|
shapely.affinity.scale (geom, xfact=1.0, yfact=1.0, zfact=1.0, origin='center') |
Returns a scaled geometry, scaled by factors along each dimension. |
|
|
shapely.affinity.skew (geom, xs=0.0, ys=0.0, origin='center', use_radians=False) |
Returns a skewed geometry, sheared by angles along x and y dimensions. |
|
|
shapely.affinity.translate (geom, xoff=0.0, yoff=0.0, zoff=0.0) |
Returns a translated geometry shifted by offsets along each dimension. |
|
|
shapely.ops.transform(func, geom) |
Applies func to all coordinates of geom and returns a new geometry of the same type from the transformed coordinates. |
|
Merging Linear Features |
||
|
shapely.ops.polygonize(lines) |
Returns an iterator over polygons constructed from the input lines. |
|
|
shapely.ops.polygonize_full(lines) |
Creates polygons from a source of lines, returning the polygons and leftover geometries. |
|
|
shapely.ops.linemerge(lines) |
Returns a LineString or MultiLineString representing the merger of all contiguous elements of lines. |
|
Cascading Unions |
||
|
shapely.ops.cascaded_union(geoms) |
Returns a representation of the union of the given geometric objects. |
|
|
shapely.ops.unary_union(geoms) |
Returns a representation of the union of the given geometric objects. |
|
Prepared Geometry Operations |
||
|
prepared.prep(ob) |
Creates and returns a prepared geometric object. |
|
Diagnostics |
||
|
validation.explain_validity(ob) |
Returns a string explaining the validity or invalidity of the object. |
|
Interoperation--Well-Known Formats |
||
|
object.wkb.encode('hex') |
A Well Known Text (WKT) or Well Known Binary (WKB) representation [1] of any geometric object can be had via its wkt or wkb attribute. |
|
|
object.wkt |
||
|
shapely.wkb.dumps(ob) |
Returns a WKB representation of ob. |
|
|
shapely.wkb.loads(wkb) |
Returns a geometric object from a WKB representation wkb. |
|
|
shapely.wkt.dumps(ob) |
Returns a WKT representation of ob. |
|
|
shapely.wkt.loads(wkt) |
Returns a geometric object from a WKT representation wkt. |
|
|
|
||
|
Interoperation-- Numpy and Python Arrays |
||
|
shapely.geometry.asShape() |
family of functions can be used to wrap Numpy coordinate arrays so that they can then be analyzed using Shapely while maintaining their original storage |
|
|
|
||
|
Interoperation-- Python Geo Interface |
||
|
shapely.geometry.asShape(context) |
Adapts the context to a geometry interface. The coordinates remain stored in the context. |
|
|
shapely.geometry.shape(context) |
Returns a new, independent geometry with coordinates copied from the context. |
|
|
shapely.geometry.mapping(ob) |
Returns a new, independent geometry with coordinates copied from the context. |
|
|
|
||
|
Linear Referencing Methods |
||
|
object.interpolate(distance[, normalized=False]) |
Return a point at the specified distance along a linear geometric object. |
|
|
object.project (other[, normalized=False]) |
Returns the distance along this geometric object to a point nearest the other object. |
|
Shapely中的几何图形操作的更多相关文章
- 关于JavaScript中的delete操作
关于JavaScript中的delete操作 看到一道题,是这样的: (function(x){ delete x; return x; })(1); 1 null undefined Error 我 ...
- 理解CSV文件以及ABAP中的相关操作
在很多ABAP开发中,我们使用CSV文件,有时候,关于CSV文件本身的一些问题使人迷惑.它仅仅是一种被逗号分割的文本文档吗? 让我们先来看看接下来可能要处理的几个相关组件的词汇的语义. Separat ...
- 第32课 Qt中的文件操作
1. Qt的中IO操作 (1)Qt中IO操作的处理方式 ①Qt通过统一的接口简化了文件和外部设备的操作方式 ②Qt中的文件被看作一种特殊的外部设备 ③Qt中的文件操作与外部设备的操作相同 (2)IO操 ...
- 【Java EE 学习 33 上】【JQuery样式操作】【JQuery中的Ajax操作】【JQuery中的XML操作】
一.JQuery中样式的操作 1.给id=mover的div采用属性增加样式.one $("#b1").click(function(){ $("#mover" ...
- 【Java EE 学习 32 下】【JQuery】【JQuey中的DOM操作】
一.JQuery中的DOM操作. 什么是DOM:DOM是一中和浏览器.平台.语言无关的接口,使用该接口可以轻松访问页面中所有的标准组件.DOM简称文档对象模型,是Document Oject Mode ...
- git工作中的常用操作
上班开始,打开电脑,git pull:拉取git上最新的代码: 编辑代码,准备提交时,git stash:将自己编辑的代码暂存起来,防止git pull时与库中的代码起冲突,否则自己的代码就白敲了: ...
- 我的Android六章:Android中SQLite数据库操作
今天学习的内容是Android中的SQLite数据库操作,在讲解这个内容之前小编在前面有一篇博客也是讲解了SQLite数据库的操作,而那篇博客的讲解是讲述了 如何在Window中通过DOM来操作数据库 ...
- 使用Hive或Impala执行SQL语句,对存储在HBase中的数据操作
CSSDesk body { background-color: #2574b0; } /*! zybuluo */ article,aside,details,figcaption,figure,f ...
- 使用Hive或Impala执行SQL语句,对存储在Elasticsearch中的数据操作(二)
CSSDesk body { background-color: #2574b0; } /*! zybuluo */ article,aside,details,figcaption,figure,f ...
随机推荐
- 百度地图JavaScript API自定义覆盖物、自定义信息窗口增删时的显示问题
项目中,需求:在百度地图上实时画出车辆,并能点击车辆弹出信息框查看实时信息. 实现:通过不停的画覆盖物并删除掉.点击覆盖物时弹出信息窗口. 问题:删除掉覆盖物后信息窗也删除掉了.因为信息窗是建立在覆盖 ...
- HT for Web基于HTML5的图像操作(一)
HT for Web独创的矢量图片设计架构,使其具有强大丰富的动态图形呈现能力,但从最近知乎热议的“Adobe Photoshop 是否已经过时?”的话题,大家能体会到很多情况下实际项目不可能完全采用 ...
- 分享在winform下实现左右布局多窗口界面
在web页面上我们可以通过frameset,iframe嵌套框架很容易实现各种导航+内容的布局界面,而在winform.WPF中实现其实也很容易,我这里就分享一个:在winform下实现左右布局多窗口 ...
- CSS魔法堂:Reset CSS
下列样式规则可用于最小化各浏览器标签样式的不一致性.注意:实际使用时应该对其进行适当的调整,以适应项目要求. /* http://meyerweb.com/eric/tools/css/reset/ ...
- 【Swift学习】Swift编程之旅---方法(十五)
在Swift中结构体和枚举也能够定义方法,而在 Objective-C 中,类是唯一能定义方法的类型. 实例方法 实例方法是属于某个特定类.结构体或者枚举类型实例的方法,实例方法提供访问和修改实例属性 ...
- [python基础]关于包,类,模块的那些事儿
转载请注明出处:http://www.cnblogs.com/codefish/p/5032753.html 在理解python的包,类,模块之前,我一直是将他类比为dll,C#的类,命名空间的这种参 ...
- ASP.NET MVC使用SSI来实现页面静态化
页面静态化分为两种:伪静态和真静态,这里主要介绍的是真静态. 进入正题之前先简单介绍一下SSI和shtml: 1).SSI是Server Side Include的简称(服务器端嵌入) 2).shtm ...
- C# DllImport用法和路径问题
DllImport是System.Runtime.InteropServices命名空间下的一个属性类,其功能是提供从非托管DLL导出的函数的必要调用信息. DllImport属性应用于方法,要 ...
- 优化Angular应用的性能
MVVM框架的性能,其实就取决于几个因素: 监控的个数 数据变更检测与绑定的方式 索引的性能 数据的大小 数据的结构 我们要优化Angular项目的性能,也需要从这几个方面入手. 1. 减少监控值的个 ...
- Java总结篇系列:Java多线程(三)
本文主要接着前面多线程的两篇文章总结Java多线程中的线程安全问题. 一.一个典型的Java线程安全例子 public class ThreadTest { public static void ma ...