As @jwass mentions in #134 :
"it's weird and annoying to iterate over the rows and not have the geom methods"
You can get to the geometry methods via row.geometry.* but you have no way of knowing if geometry is the active geometry field on that Series.
This is probably an OK solution for now but it assumes the original dataframe is still in the scope.
for i, row in df.iterrows():
bbox = row[df._geometry_column_name].bounds
Leah, your question is solved?
Op vr 5 okt. 2018 om 03:36 schreef Leah Wasser notifications@github.com:
@perrygeo https://github.com/perrygeo if i wanted to have access to
unary_union, how would i do that? bounds works but i'd like unary_union.
if this is not the ideal spot to post this question please say the word and
i'll post it separately referencing this issue.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/geopandas/geopandas/issues/136#issuecomment-427220167,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA-SULyIJmjsRkX6Q7DzenbKefV3j6X8ks5uhreagaJpZM4CNbfs
.
my apologies @jorisvandenbossche i left this question and then found a solution that isn't pretty but works! i didn't want to "muddle" this issue w a slightly off topic question. This relates to my clip issue here: https://github.com/geopandas/geopandas/issues/821 i'm still trying to sort out ways to clip lines with polygons in geopandas. In this case id want to do an INTERSECTION but that doesn't relate to this issue
Here is my not so pretty solution using .itterrows: :)
note it's just a start!
# clip a roads layer by several polygons in a geopandas df
for i, row in enumerate(two_counties.iterrows()):
rds_cl=shp_sub.intersection(two_counties["geometry"].iloc[[i]].unary_union)
i will post in the other related issue now.
Most helpful comment
This is probably an OK solution for now but it assumes the original dataframe is still in the scope.