Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Commit 
							
							·
						
						0c5ae68
	
1
								Parent(s):
							
							f8439e1
								
Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -158,8 +158,6 @@ indicents = list(gdf_cut['Incident'].values) | |
| 158 | 
             
            incident_edge = st.sidebar.selectbox(
         | 
| 159 | 
             
                'Find Distance to Closest Edge:', indicents)
         | 
| 160 |  | 
| 161 | 
            -
             | 
| 162 | 
            -
            gdf_cut[gdf_cut['Incident']==incident_edge].geometry.apply(lambda x: x.coords)
         | 
| 163 | 
             
            vertices = extract_vertices(gdf_cut[gdf_cut['Incident']==incident_edge])
         | 
| 164 | 
             
            vertices["Lat_address"] = lat
         | 
| 165 | 
             
            vertices["Lon_address"] = lon
         | 
| @@ -169,7 +167,6 @@ closest_edge = vertices[vertices['Distance'] | |
| 169 | 
             
                                    == vertices['Distance'].min()]
         | 
| 170 |  | 
| 171 | 
             
            try:
         | 
| 172 | 
            -
                
         | 
| 173 | 
             
                lon_point, lat_point = closest_edge[['Lon', 'Lat']].values[0]
         | 
| 174 | 
             
                distance_edge = closest_edge['Distance'].round(2).values[0]
         | 
| 175 | 
             
                folium.PolyLine([[lat, lon],
         | 
| @@ -179,6 +176,7 @@ try: | |
| 179 | 
             
                                ).add_to(m)
         | 
| 180 | 
             
            except:
         | 
| 181 | 
             
                pass
         | 
|  | |
| 182 | 
             
            #Display
         | 
| 183 | 
             
            col1, col2 = st.columns((2, 3))
         | 
| 184 | 
             
            with col1:
         | 
|  | |
| 158 | 
             
            incident_edge = st.sidebar.selectbox(
         | 
| 159 | 
             
                'Find Distance to Closest Edge:', indicents)
         | 
| 160 |  | 
|  | |
|  | |
| 161 | 
             
            vertices = extract_vertices(gdf_cut[gdf_cut['Incident']==incident_edge])
         | 
| 162 | 
             
            vertices["Lat_address"] = lat
         | 
| 163 | 
             
            vertices["Lon_address"] = lon
         | 
|  | |
| 167 | 
             
                                    == vertices['Distance'].min()]
         | 
| 168 |  | 
| 169 | 
             
            try:
         | 
|  | |
| 170 | 
             
                lon_point, lat_point = closest_edge[['Lon', 'Lat']].values[0]
         | 
| 171 | 
             
                distance_edge = closest_edge['Distance'].round(2).values[0]
         | 
| 172 | 
             
                folium.PolyLine([[lat, lon],
         | 
|  | |
| 176 | 
             
                                ).add_to(m)
         | 
| 177 | 
             
            except:
         | 
| 178 | 
             
                pass
         | 
| 179 | 
            +
             | 
| 180 | 
             
            #Display
         | 
| 181 | 
             
            col1, col2 = st.columns((2, 3))
         | 
| 182 | 
             
            with col1:
         |