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

osmpy getting stuck in katana function #1

Open
ajayu-nd opened this issue May 26, 2022 · 1 comment
Open

osmpy getting stuck in katana function #1

ajayu-nd opened this issue May 26, 2022 · 1 comment

Comments

@ajayu-nd
Copy link

  • S2-py version: osmpy==0.2.0
  • Python version: Python 3.8.10
  • Operating System: Ubuntu 20.04.1 LTS

Description

I am trying to find the ways within the given polygon.
Program is getting stuck.

What I Did

import osmpy
from shapely import wkt
boundary = wkt.loads('POLYGON((37.8413 -122.2790,37.8545 -122.2790,37.8545 -122.2963,37.8413 -122.2963,37.8413 -122.2790))')

query = """[out:json];    way["highway"](poly:"{boundary}");    out body geom;"""
res = osmpy.get(query, boundary)
print(f"{res}")

Further when I was looking at the library found the following function katana being called recursively and not exiting.

@silantyev
Copy link

The coordinates are supposed to be set as longitude latitude, so katana cannot handle incorrect input.
This works:

boundary = wkt.loads('POLYGON((-122.2790 37.8413,-122.2790 37.8545,-122.2963 37.8545,-122.2963 37.8413,-122.2790 37.8413))')

query = """[out:json];    way["highway"](poly:"{boundary}");    out body geom;"""
res = osmpy.get(query, boundary)

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