Skip to content

Commit

Permalink
Merge pull request #29 from UDST/maintenance/python-version-shapely-dep
Browse files Browse the repository at this point in the history
Maintenance/python version shapely dep
  • Loading branch information
smmaurer authored Aug 2, 2023
2 parents 0c5af00 + 5376d05 commit e1ab4df
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
language: python

python:
- '3.5'
- '3.6'
# - '3.7' # drop tests in 3.7 for now due to Travis build error
- '3.8'
- '3.9'
- '3.10'

install:
- pip install .
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007

Copyright (C) 2020 UrbanSim Inc.
Copyright (C) 2022 UrbanSim Inc.

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ Overview

OSMnet offers tools to download street network data from OpenStreetMap
and extract a graph network comprised of nodes and edges to be used in
`Pandana`_ street network accessibility calculations.
`Pandana`_ street network accessibility calculations and or `UrbanAccess`_
to connect GTFS transit networks to road networks.

Let us know what you are working on or if you think you have a great use case
by tweeting us at ``@urbansim`` or post on the UrbanSim `forum`_.
by tweeting us at ``@urbansim``.

Library Status
--------------
Expand Down Expand Up @@ -84,7 +85,6 @@ Related UDST libraries
.. _OSMnet repo: https://github.com/udst/osmnet
.. _here: https://udst.github.io/osmnet/index.html
.. _UrbanAccess: https://github.com/UDST/urbanaccess
.. _forum: http://discussion.urbansim.com/

.. |Build Status| image:: https://travis-ci.org/UDST/osmnet.svg?branch=master
:target: https://travis-ci.org/UDST/osmnet
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
source_suffix = '.rst'
master_doc = 'index'
project = u'OSMnet'
copyright = u'2020, UrbanSim Inc.'
copyright = u'2022, UrbanSim Inc.'
author = u'UrbanSim Inc.'
version = u'0.1.6'
release = u'0.1.6'
Expand Down
4 changes: 1 addition & 3 deletions docs/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Introduction
OSMnet provides tools for the extraction of `OpenStreetMap`_ (OSM) street network data. OSMnet is intended to be used in tandem with `Pandana`_ and `UrbanAccess`_ libraries to extract street network nodes and edges.

Let us know what you are working on or if you think you have a great use case
by tweeting us at ``@urbansim`` or post on the UrbanSim `forum`_.
by tweeting us at ``@urbansim``.

Reporting bugs
~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -39,5 +39,3 @@ Related UDST libraries
.. _Pandana: https://github.com/UDST/pandana

.. _UrbanAccess: https://github.com/UDST/urbanaccess

.. _forum: http://discussion.urbansim.com/
6 changes: 3 additions & 3 deletions osmnet/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ def osm_net_download(lat_min=None, lng_min=None, lat_max=None, lng_max=None,
geometry, crs = project_geometry(geometry_proj_consolidated_subdivided,
crs=crs_proj, to_latlong=True)
log('Requesting network data within bounding box from Overpass API '
'in {:,} request(s)'.format(len(geometry)))
'in {:,} request(s)'.format(len(geometry.geoms)))
start_time = time.time()

# loop through each polygon in the geometry
for poly in geometry:
for poly in geometry.geoms:
# represent bbox as lng_max, lat_min, lng_min, lat_max and round
# lat-longs to 8 decimal places to create
# consistent URL strings
Expand All @@ -168,7 +168,7 @@ def osm_net_download(lat_min=None, lng_min=None, lat_max=None, lng_max=None,

log('Downloaded OSM network data within bounding box from Overpass '
'API in {:,} request(s) and'
' {:,.2f} seconds'.format(len(geometry), time.time()-start_time))
' {:,.2f} seconds'.format(len(geometry.geoms), time.time()-start_time))

# stitch together individual json results
for json in response_jsons_list:
Expand Down
10 changes: 6 additions & 4 deletions osmnet/tests/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_quadrat_cut_geometry(simple_polygon):
buffer_amount=1e-9)

assert isinstance(multipolygon, MultiPolygon)
assert len(multipolygon) == 4
assert len(multipolygon.geoms) == 4


def test_ways_in_bbox(bbox1, dataframes1):
Expand Down Expand Up @@ -240,14 +240,16 @@ def test_intersection_nodes2(dataframes2):
_, _, waynodes = dataframes2
intersections = load.intersection_nodes(waynodes)

assert intersections == {53099275, 53063555}
assert intersections == {
53063555, 9515373382, 53099275, 9515406927, 4279441429, 4279441430,
4279441432}


def test_node_pairs_two_way(dataframes2):
nodes, ways, waynodes = dataframes2
pairs = load.node_pairs(nodes, ways, waynodes)

assert len(pairs) == 1
assert len(pairs) == 6

fn = 53063555
tn = 53099275
Expand All @@ -263,7 +265,7 @@ def test_node_pairs_one_way(dataframes2):
nodes, ways, waynodes = dataframes2
pairs = load.node_pairs(nodes, ways, waynodes, two_way=False)

assert len(pairs) == 2
assert len(pairs) == 12

n1 = 53063555
n2 = 53099275
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: GNU Affero General Public License v3'
],
packages=find_packages(exclude=['*.tests']),
python_requires='>=3',
install_requires=[
'geopandas >= 0.8.2',
'geopandas >= 0.11',
'numpy >= 1.10',
'pandas >= 0.23',
'requests >= 2.9.1',
'shapely >= 1.6'
'shapely >= 1.8'
]
)

0 comments on commit e1ab4df

Please sign in to comment.