Query tolerance python test #1499

Merged
merged 8 commits into from Oct 3, 2012

Projects

None yet

2 participants

@manelclos
Mapnik member

Hi,

Generic test for query tolerance, one of the steps for issue #503

@manelclos
Mapnik member

Added tolerance modifications as for issue #503

@springmeyer
Mapnik member

Great, works, looks good, will merge shortly.

@springmeyer springmeyer merged commit 86e805b into mapnik:master Oct 3, 2012
@springmeyer
Mapnik member

@manelclos - note that after merging this I saw several test failures like:

======================================================================
ERROR: python_tests.memory_datasource_test.test_add_feature
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/dane/projects/mapnik5/tests/python_tests/memory_datasource_test.py", line 16, in test_add_feature
    featureset = md.features_at_point(mapnik.Coord(2,3))
ArgumentError: Python argument types in
    Datasource.features_at_point(MemoryDatasource, Coord)
did not match C++ signature:
    features_at_point(mapnik::datasource {lvalue}, mapnik::coord<double, 2>, double)

This is because the default argument signature in C++ is not picked up automatically in python. You need to do it manually and there are a few ways. The easiest is to use arg and the benefit of this is that then you get nicer docstrings and can pass the argument as a kwarg like ds.features_at_point(coord,tolerance=1) in python. I did this in e6f04fd, so check it out. We should be using arg everywhere really, but many functions/classes exposed in python do not have it yet only because of lack of time taken to do it.

@springmeyer springmeyer added a commit that referenced this pull request Oct 3, 2012
@springmeyer springmeyer new features_at_point tolerance should be optional - make it so in py…
…thon to avoid test failures after #1499/#503
e6f04fd
@manelclos
Mapnik member

Yes sorry! this time I forgot to update the python bindings, and didn't run all the tests afterwards... :-o Thanks!

@PetrDlouhy PetrDlouhy added a commit to PetrDlouhy/mapnik that referenced this pull request Aug 22, 2013
@springmeyer springmeyer update changelog after 86e805b - refs #503 and #1499 869eeb3
@PetrDlouhy PetrDlouhy added a commit to PetrDlouhy/mapnik that referenced this pull request Aug 22, 2013
@springmeyer springmeyer new features_at_point tolerance should be optional - make it so in py…
…thon to avoid test failures after #1499/#503
7653d3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment