Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regions_buider.allow_ambiguous() doesn't prevent "ValueError: Multiple objects.." #174

Closed
alshan opened this issue Jul 20, 2020 · 2 comments
Assignees

Comments

@alshan
Copy link
Collaborator

alshan commented Jul 20, 2020

from shapely.geometry import box
warwick_box = regions_builder(request='warwick', level='city') \
    .where('warwick', within=box(-72, 41.5, -71, 42)) \
    .allow_ambiguous() \
    .build()

ValueError: Multiple objects (2) were found for warwick:

  • Warwick (United States of America, Rhode Island)
  • West Warwick (United States of America, Rhode Island)
@IKupriyanov-HORIS
Copy link
Collaborator

It is expected behaviour. Use-case for allow_ambiguous is to ignore all ambiguous requests except ones with where invocation - requests, user trying to resolve (to make the process less noisy without requests we are not interested in, adding where and fixing ambiguity step by step).

In example bellow springfield will not cause ambiguity error, but warwick will.

regions_builder(request=['springfield', 'warwick'], level='city')\
    .where('warwick', within=box(-72, 41.5, -71, 42))\
    .allow_ambiguous()\
    .build()

@IKupriyanov-HORIS
Copy link
Collaborator

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants