jgc234 / optiburb

Cycling route generator for optimum "burbing" route.
MIT License
31 stars 7 forks source link

'MultiPolygon' object has no attribute 'exterior' #1

Closed zdebruine closed 4 years ago

zdebruine commented 4 years ago

First off, great work! I'm excited to get this working!

I'm running into an issue regardless of what suburb I enter (i.e. 'bellfield, victoria, australia'):

2020-07-29 10:47:02 optiburb.py:create_gpx_polygon:484 [INFO] saving suburb boundary - burb_polygon_'footscray__victoria__australia'.gpx
Traceback (most recent call last):
  File "PATH\optiburb.py", line 668, in <module>
    burbing.create_gpx_polygon(burbing.region)
  File "PATH\optiburb.py", line 501, in create_gpx_polygon
    for x, y in polygon.exterior.coords:
AttributeError: 'MultiPolygon' object has no attribute 'exterior'

I suspect I'm just doing something wrong, any thoughts?

zdebruine commented 4 years ago

Solved the issue. At the command line it should look like:

optiburb.py 'bellfield victoria australia'

and NOT

optiburb.py 'bellfield, victoria, australia'

After reading through the lines I realized that searches were being run for "bellville", "victoria", and "australia" separately and that was causing an invalid intersection error between tracks. No, I don't want to run optiburb on all of australia!

Perhaps the documentation could be updated to reflect this, if it's an issue across the board.

So, for the inexperienced, here's how I'm using optiburb.py to generate Strava routes for my burbing attempts:

  1. Install the latest Python release
  2. From the command shell, add the dependencies indicated on https://github.com/jgc234/o... (shapely, gpxpy, numpy, networkx, geopandas, and osmnx). I found that for geopandas and osmnx, I had to use pipwin rather than pip to install successfully (I'm using windows)
  3. Run optiburb.py "Bellfield Victoria Australia" (no commas) on the command line. 10 seconds later I had the solved .gpx file in my directory
  4. Upload the .gpx file to https://gotoes.org/strava/A... to add timestamps so you can upload it to Strava
  5. Upload that file to Strava as an activity (a private one, of course)
  6. Copy that Strava activity to a Strava route. And now you're set to burb!