pyqtree
pyqtree module
API Documentation
Classes
class Index
The top spatial index to be created by the user. Once created it can be populated with geographically placed members that can later be tested for intersection with a user inputted geographic bounding box. Note that the index can be iterated through in a for-statement, which loops through all all the quad instances and lets you access their properties.
Ancestors (in MRO)
- Index
- pyqtree._QuadTree
Methods
def __init__(
self, bbox, maxitems=10, maxdepth=20)
Parameters:
- bbox: The coordinate system bounding box of the area that the quadtree should keep track of, as a 4-length sequence (xmin,ymin,xmax,ymax)
- maxmembers (optional): The maximum number of items allowed per quad before splitting up into four new subquads. Default is 10.
- maxdepth (optional): The maximum levels of nested subquads, after which no more splitting occurs and the bottommost quad nodes may grow indefinately. Default is 20.
def countmembers(
self)
Returns:
- A count of the total number of members/items/nodes inserted into this quadtree and all of its child trees.
def insert(
self, item, bbox)
Inserts an item into the quadtree along with its bounding box.
Parameters:
- item: The item to insert into the index, which will be returned by the intersection method
- bbox: The spatial bounding box tuple of the item, with four members (xmin,ymin,xmax,ymax)
def intersect(
self, bbox)
Intersects an input boundingbox rectangle with all of the items contained in the quadtree.
Parameters:
- bbox: A spatial bounding box tuple with four members (xmin,ymin,xmax,ymax)
Returns:
- A list of inserted items whose bounding boxes intersect with the input rectangle.
Here are the examples of the python api pyqtree.Index taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
Example 1
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
def create(index_file, bbox, parse_fn, *parse_args): logger = logging.getLogger("index") idx = pyqtree.Index(bbox=bbox) n = 0 with open(index_file, 'r') as f: files = yaml.load(f) for f in files: t = parse_fn(f, *parse_args) if t: idx.insert(bbox=t.bbox.bounds, item=t) n += 1 logger.info("Created index with %d objects." % n) return idx |
Example 2
|
1
2
3
4
5
6
7
|
def __init__(self, D0): self._D0 = 1. * D0 bbox = (-180, -90, 180, 90) self._spidx = pyqtree.Index(bbox) self._points = [] self._clusters_by_item = None self._clusters = None |
pyqtree的更多相关文章
随机推荐
- docker自建仓库Registry
因为生产情况下官方容器还是比较慢的,所以会用到自建docker仓库.docker官方提供完整部署仓库的容器,你只需要提供域名证书,把文件系统挂载到容器,一个用户密码文件就可以使用基本的仓库功能了. 启 ...
- python - pandas或者sklearn中如何将字符形式的标签数字化
参考:http://www.php.cn/wenda/91257.html https://www.cnblogs.com/king-lps/p/7846414.html http://blog.cs ...
- 安装Linux环境
虚拟机:虚拟机(Virtual Machine),在计算机科学中的体系结构里,是指一种特殊的软件,他可以在计算机平台和终端用户之间建立一种环境,而终端用户则是基于这个软件所建立的环境来操作软件.在计算 ...
- js字符串操作方法
1.字符方法: str.charAt(): 可以访问字符串中特定的字符,可以接受0至字符串长度-1的数字作为参数,返回该位置下的字符,如果参数超出该范围,返回空字符串,如果没有参数,返回位置为0的字符 ...
- 个人学习jQuery笔记
1.$(“#div1”).text()是获取id为div1的文本内容,也可以填充值 $(“#div1”).html() 是获取id 为div1的HTML内容值 也可以填充值 2.$(“#div1”)是 ...
- ASP.NET MVC TryUpdateModel 更新model
总结参考:原文地址http://www.it165.net/pro/html/201305/5724.html TryUpdateModel (model)默认将view页面上form表单中的字段与m ...
- Bireme:一个 Greenplum数据仓库的增量同步工具
https://hashdatainc.github.io/bireme/ Bireme 是一个 Greenplum / HashData 数据仓库的增量同步工具.目前支持 MySQL.Postgre ...
- 【SQL查询】分区查询Over
1. Over介绍 Over为开窗函数.就是把满足条件的数据分成几个区域,每个区域可以通过像现实中的“窗口”来观察统计这些数据. over不能单独使用,要和分析函数:rank(), dense_ran ...
- Makefile特殊标签
http://www.gnu.org/software/make/manual/html_node/Special-Targets.html
- Java基础拾遗(一)
(尊重劳动成果,转载请注明出处:http://blog.csdn.net/qq_25827845/article/details/76358391冷血之心的博客) 马上就要秋招了,新的一轮笔试面试马上 ...