Skip to content

Instantly share code, notes, and snippets.

@shaystrong
Created May 8, 2019 05:13
Show Gist options
  • Save shaystrong/42c18fde598ca296aff3cad33ed84087 to your computer and use it in GitHub Desktop.
Save shaystrong/42c18fde598ca296aff3cad33ed84087 to your computer and use it in GitHub Desktop.
building polygons to rectangles
def footprint2box(vector):
df = vector
df['geometry']=df.envelope #round to nearest (axis-aligned) rectangle
df['class']='building' #all buildings we will just call class=buildings
return df
df=footprint2box(buildings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment