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

Ubdus Samad
  • 1,218
  • 1
  • 15
  • 27
  • Perhaps this might be useful https://stackoverflow.com/questions/730764/try-except-in-python-how-do-you-properly-ignore-exceptions – Unni Jan 17 '18 at 04:29
  • A`continue` a the last command in the loop does not make much sense. – Klaus D. Jan 17 '18 at 05:15

1 Answers1

1
try:
    <code that might give error>
except Whatever_Error:
    continue
Melvin
  • 1,530
  • 11
  • 18