-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyAutiGIS.py
More file actions
41 lines (31 loc) · 1.28 KB
/
Copy pathpyAutiGIS.py
File metadata and controls
41 lines (31 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import geopandas as gpd
import folium
# Load property data with geospatial information (replace with your data file)
property_data_file = 'property_data.shp'
property_data = gpd.read_file(property_data_file)
# Calculate the center of the map (mean latitude and longitude)
center_lat = property_data.geometry.centroid.y.mean()
center_lon = property_data.geometry.centroid.x.mean()
# Create an interactive map centered on the properties
property_map = folium.Map(location=[center_lat, center_lon], zoom_start=14)
# Define a function to style the GeoJSON features
def style_function(feature):
return {
# or use feature['properties']['your_property_field'] for dynamic color
'fillColor': 'blue',
'color': 'black',
'weight': 2,
'opacity': 0.5
}
# Add property boundaries to the maps
folium.GeoJson(
property_data,
name='Property Boundaries',
style_function=style_function,
tooltip=folium.GeoJsonTooltip(fields=['property_id', 'address'], aliases=[
'Property ID', 'Address'])
).add_to(property_map)
# Add a layer control to toggle property boundaries
folium.LayerControl().add_to(property_map)
# Save the map as an HTML files
property_map.save('property_map.html')