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

Fixed deprecated imports #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions geopandas_osm/osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

import fiona.crs
import geopandas as gpd
from pandas.io.common import urlopen, urlencode
from urllib.parse import urlencode
from urllib.request import urlopen
import pandas as pd
from shapely.geometry import Point, LineString
from six import string_types
Expand Down Expand Up @@ -124,10 +125,10 @@ def _build_url(typ, bbox=None, recurse=None, tags='', meta=False):
if bbox is None:
bboxstr = ''
else:
#bboxstr = "({})".format(
#','.join(str(b) for b in (bbox[1], bbox[0], bbox[3], bbox[2])))
bboxstr = '(poly:"{}")'.format(
' '.join('{c[1]} {c[0]}'.format(c=c) for c in bbox.exterior.coords))
bboxstr = "({})".format(
','.join(str(b) for b in (bbox[1], bbox[0], bbox[3], bbox[2])))
# bboxstr = '(poly:"{}")'.format(
# ' '.join('{c[1]} {c[0]}'.format(c=c) for c in bbox.exterior.coords))

if meta:
metastr = 'meta'
Expand Down Expand Up @@ -296,7 +297,7 @@ def render_ways(nodes, waynodes, waytags):
node_points = nodes[['id', 'lon', 'lat']]

def wayline(df):
df = df.sort_index(by='index')[['lon', 'lat']]
df = df.sort_values(by='index')[['lon', 'lat']]
return LineString(df.values)

# Group the ways and create a LineString for each one. way_lines is a
Expand Down