user9227466
user9227466

Reputation: 11

python continue with for loop

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

Upvotes: 0

Views: 128

Answers (1)

Melvin
Melvin

Reputation: 1600

try:
    <code that might give error>
except Whatever_Error:
    continue

Upvotes: 1

Related Questions