drfilter / pyrtree Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/pyrtree
Automatically exported from code.google.com/p/pyrtree
In my own client code I found comparison operators for Rect to be useful. If I
add them (and you find them acceptable) will you accept them?
The operators make Rect hashable and sortable. Aside from that, rect1 < rect2
is not a very interesting geometric comparison.
Original issue reported on code.google.com by [email protected]
on 23 Aug 2013 at 12:12
What steps will reproduce the problem?
1. Create a zero-sized length
What is the expected output? What do you see instead?
I expect things to work. I get assertion error.
What version of the product are you using? On what operating system?
Python 2.6.6, Windows Vista.
Please provide any additional information below.
rect = Rect(point.coords[0], point.coords[1], point.coords[0], point.coords[1])
print rect.extent(), point.coords
self.extent = rect.union(self.extent)
self.points.append(point)
Traceback (most recent call last):
File "C:\Users\valit\Desktop\?\?.py", line 89, in <module>
a = PointCollection('?.csv', '?')
File "C:\Users\valit\Desktop\?\?.py", line 39, in __init__
self.rtree.insert(point, rect)
File "C:\Python26\lib\pyrtree\rtree.py", line 45, in insert
self.cursor.insert(o,orect)
File "C:\Python26\lib\pyrtree\rtree.py", line 203, in insert
self._insert_child(_NodeCursor.create_leaf(self.root,leafo,leafrect))
File "C:\Python26\lib\pyrtree\rtree.py", line 92, in create_leaf
assert(res.is_leaf())
AssertionError
This wont give an error:
rect = Rect(point.coords[0], point.coords[1], point.coords[0]+0.0000001,
point.coords[1]+0.0000001)
Original issue reported on code.google.com by [email protected]
on 9 May 2011 at 12:51
I downloaded the most recent release (pyrtree-0a12e64c7386.zip) and then
installed it for Python 3.3 by running "python3.3 setup.py install". But it
doesn't work:
Python 3.3.2 (default, May 21 2013, 11:50:47)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyrtree
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pyrtree/__init__.py", line 4, in <module>
import rect
ImportError: No module named 'rect'
Python 3 no longer supports implicit package-relative imports (see PEP 404
<http://www.python.org/dev/peps/pep-0404/>). So the import statements need to
be changed to be package-relative. In __init__.py you should replace:
import rect
import rtree
with
from . import rect
from . import rtree
and in rtree.py you should replace:
from rect import Rect, union_all, NullRect
with:
from .rect import Rect, union_all, NullRect
(Similar changes need to be made in the bench/ and test/ subdirectories.)
Original issue reported on code.google.com by [email protected]
on 4 Jan 2014 at 10:48
After persistence, implement APIs like:
https://mail.zope.org/pipermail/zodb-dev/2010-June/013491.html
Original issue reported on code.google.com by [email protected]
on 23 Jun 2010 at 9:24
Currently only benchmarking inserts.
Original issue reported on code.google.com by [email protected]
on 21 Jun 2010 at 11:53
What steps will reproduce the problem?
1. Run unit tests
What is the expected output? What do you see instead?
I excpect them to finish with all OK.
I get failure of two tests with NullRect not defined.
Ran 11 tests in 259.657s
FAILED (errors=2)
from pyrtree import Rect, RTree
+ from pyrtree.rect import NullRect
#from pyrtree.rect import *
With "+" I mark added line, which fixes the problem.
Ran 11 tests in 257.825s
OK
What version of the product are you using? On what operating system?
Python 2.6.6 on Windows Vista.
Please provide any additional information below.
======================================================================
ERROR: testCons (__main__.RectangleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\valit\Desktop\Rtree\pyrtree\tests\test_rtree.py", line 77, in testCons
self.assertTrue(r is not NullRect)
NameError: global name 'NullRect' is not defined
======================================================================
ERROR: testIntersection (__main__.RectangleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\valit\Desktop\Rtree\pyrtree\tests\test_rtree.py", line 95, in testIntersection
self.assertTrue(res2 is NullRect)
NameError: global name 'NullRect' is not defined
----------------------------------------------------------------------
Ran 11 tests in 259.657s
FAILED (errors=2)
Traceback (most recent call last):
File "C:\Users\valit\Desktop\Rtree\pyrtree\tests\test_rtree.py", line 266, in <module>
ut.main()
File "C:\Python26\lib\unittest.py", line 817, in __init__
self.runTests()
File "C:\Python26\lib\unittest.py", line 865, in runTests
sys.exit(not result.wasSuccessful())
SystemExit: True
Original issue reported on code.google.com by [email protected]
on 8 May 2011 at 8:50
Need to allow persistence to the disk
Original issue reported on code.google.com by [email protected]
on 22 Jun 2010 at 5:08
as the subject says
Original issue reported on code.google.com by [email protected]
on 21 Jun 2010 at 11:54
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.