fixing issue where fiona DriverError was unhandled for string_type fe…#181
Merged
perrygeo merged 1 commit intoperrygeo:fix-buildfrom Mar 9, 2019
Merged
fixing issue where fiona DriverError was unhandled for string_type fe…#181perrygeo merged 1 commit intoperrygeo:fix-buildfrom
perrygeo merged 1 commit intoperrygeo:fix-buildfrom
Conversation
Contributor
Author
|
Guess what lucky dog gets to bring ForestPlanner up to Py3, Django2 standards 😃 |
Owner
|
@rhodges gracias! I'll take a look this weekend. Looks good to me, not sure why travis is complaining but I'll get it straightened out. |
Contributor
Author
|
Cool!
Let me know if it needs some tweaking.
Here's the string fiona choked on:
"POLYGON ((301439.8316288766 1229366.039198387, 301378.1635010813
1229348.700953075, 301321.6492724136 1229297.36610253, 301352.2270260971
1229157.529700135, 301812.98074241 1228963.624401361, 301746.1708636193
1229267.190696551, 301439.8316288766 1229366.039198387))"
Full Trace:
[2019-03-08 17:05:53,928: ERROR/ForkPoolWorker-2] Task
trees.tasks.impute_rasters[49c8dc5d-995f-4273-b816-5a95cf3857e3] raised
unexpected: DriverError('POLYGON ((301439.8316288766 1229366.039198387,
301378.1635010813 1229348.700953075, 301321.6492724136 1229297.36610253,
301352.2270260971 1229157.529700135, 301812.98074241 1228963.624401361,
301746.1708636193 1229267.190696551, 301439.8316288766 1229366.039198387)):
Protocol error',)
Traceback (most recent call last):
File "fiona/_shim.pyx", line 66, in fiona._shim.gdal_open_vector
File "fiona/_err.pyx", line 259, in fiona._err.exc_wrap_pointer
fiona._err.CPLE_OpenFailedError: POLYGON ((301439.8316288766
1229366.039198387, 301378.1635010813 1229348.700953075, 301321.6492724136
1229297.36610253, 301352.2270260971 1229157.529700135, 301812.98074241
1228963.624401361, 301746.1708636193 1229267.190696551, 301439.8316288766
1229366.039198387)): Protocol error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/celery/app/trace.py",
line 385, in trace_task
R = retval = fun(*args, **kwargs)
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/celery/app/trace.py",
line 648, in __protected_call__
return self.run(*args, **kwargs)
File "/usr/local/apps/forestplanner/lot/trees/tasks.py", line 37, in
impute_rasters
stats = terrain_zonal(g1)
File "/usr/local/apps/forestplanner/lot/trees/utils.py", line 648, in
terrain_zonal
# elevation
File "/usr/local/apps/forestplanner/lot/trees/utils.py", line 639, in
get_raster_stats
import ipdb; ipdb.set_trace()
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/rasterstats/main.py",
line 20, in raster_stats
return zonal_stats(*args, **kwargs)
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/rasterstats/main.py",
line 31, in zonal_stats
return list(gen_zonal_stats(*args, **kwargs))
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/rasterstats/main.py",
line 146, in gen_zonal_stats
features_iter = read_features(vectors, layer)
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/rasterstats/io.py",
line 82, in read_features
with fiona.open(obj, 'r', layer=layer) as src:
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/fiona/env.py",
line 405, in wrapper
return f(*args, **kwargs)
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/fiona/__init__.py",
line 253, in open
layer=layer, enabled_drivers=enabled_drivers, **kwargs)
File
"/usr/local/apps/forestplanner/env/lib/python3.6/site-packages/fiona/collection.py",
line 159, in __init__
self.session.start(self, **kwargs)
File "fiona/ogrext.pyx", line 467, in fiona.ogrext.Session.start
File "fiona/_shim.pyx", line 73, in fiona._shim.gdal_open_vector
fiona.errors.DriverError: POLYGON ((301439.8316288766 1229366.039198387,
301378.1635010813 1229348.700953075, 301321.6492724136 1229297.36610253,
301352.2270260971 1229157.529700135, 301812.98074241 1228963.624401361,
301746.1708636193 1229267.190696551, 301439.8316288766 1229366.039198387)):
Protocol error
…On Fri, Mar 8, 2019 at 6:28 PM Matthew Perry ***@***.***> wrote:
@rhodges <https://github.com/rhodges> gracias! I'll take a look this
weekend. Looks good to me, not sure why travis is complaining but I'll get
it straightened out.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#181 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgIqRC4xy8b4BhT5HFESiKiaJRuCOxqks5vUxxMgaJpZM4bmZhw>
.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…atures