0

I have a loop code in python like this:

 for index, row in maproad.iterrows():
    road = wkb.loads(row['THE_GEOM'], hex=True)
    buffered_road = Polygon(road.buffer(0.00015,cap_style=2,resolution=2))
    print(row['OBJECTNAME'])
    c.write({
    'geometry': mapping(Polygon(buffered_road.exterior)),
    'properties': {'name': row['OBJECTNAME']}
     }) 

     if road:
     road = wkb.loads(row['THE_GEOM'], hex=False)
     continue

I want to continue the loop but it throws THE_GEOM parsing error. So i got stuck and i am really noob to python. Thankyou

2
  • Perhaps this might be useful stackoverflow.com/questions/730764/… Commented Jan 17, 2018 at 4:29
  • Acontinue a the last command in the loop does not make much sense. Commented Jan 17, 2018 at 5:15

1 Answer 1

1
try:
    <code that might give error>
except Whatever_Error:
    continue
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.