Borya-Goldarb commited on
Commit
3910413
·
verified ·
1 Parent(s): ec3401d

Update pages/market_rent_estimation.py

Browse files
Files changed (1) hide show
  1. pages/market_rent_estimation.py +13 -12
pages/market_rent_estimation.py CHANGED
@@ -147,18 +147,19 @@ def main():
147
  folium.GeoJson(data=gdf_current_market.geometry.to_json(), name='geojson').add_to(m)
148
  for _, row in gdf_current_market.iterrows():
149
  # Convert the row's geometry to GeoJSON
150
- geojson = folium.GeoJson(data=row['geometry'].__geo_interface__,
151
- style_function=lambda feature: {
152
- 'fillColor': '#00000000', # Make the fill color transparent
153
- 'color': '#00000000', # Set the border color
154
- 'weight': 2 # Set the border width
155
- },
156
- )
157
- # Add a popup with the name
158
- popup = folium.Popup(row['full_submarket'], parse_html=True)
159
-
160
- # Add the GeoJson and Popup to the map
161
- geojson.add_child(popup).add_to(m)
 
162
 
163
  # Add layer control to toggle marker visibility
164
  folium.LayerControl().add_to(m)
 
147
  folium.GeoJson(data=gdf_current_market.geometry.to_json(), name='geojson').add_to(m)
148
  for _, row in gdf_current_market.iterrows():
149
  # Convert the row's geometry to GeoJSON
150
+ if row['geometry'] is not None:
151
+ geojson = folium.GeoJson(data=row['geometry'].__geo_interface__,
152
+ style_function=lambda feature: {
153
+ 'fillColor': '#00000000', # Make the fill color transparent
154
+ 'color': '#00000000', # Set the border color
155
+ 'weight': 2 # Set the border width
156
+ },
157
+ )
158
+ # Add a popup with the name
159
+ popup = folium.Popup(row['full_submarket'], parse_html=True)
160
+
161
+ # Add the GeoJson and Popup to the map
162
+ geojson.add_child(popup).add_to(m)
163
 
164
  # Add layer control to toggle marker visibility
165
  folium.LayerControl().add_to(m)