Spaces:
Runtime error
Runtime error
Upload 9 files
Browse files- .gitattributes +1 -0
- app.py +241 -0
- final_crop_historic_data_pkjk.csv +3 -0
- templates/crop_analysis.html +11 -0
- templates/heatmap.html +0 -0
- templates/index.html +88 -0
- templates/map.html +0 -0
- templates/prediction_analysis.html +11 -0
- templates/production_heatmap.html +21 -0
- templates/seasonal_analysis.html +11 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
final_crop_historic_data_pkjk.csv filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from flask import Flask, render_template, request
|
| 2 |
+
import folium
|
| 3 |
+
from folium.plugins import HeatMapWithTime, FeatureGroupSubGroup, HeatMap
|
| 4 |
+
import pandas as pd
|
| 5 |
+
import os
|
| 6 |
+
|
| 7 |
+
app = Flask(__name__)
|
| 8 |
+
|
| 9 |
+
# Load the dataset
|
| 10 |
+
df = pd.read_csv('final_crop_historic_data_pkjk.csv')
|
| 11 |
+
df.columns = ['State', 'District', 'Crop_Year', 'Season', 'Crop', 'Area', 'Production', 'Latitude', 'Longitude']
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@app.route('/')
|
| 15 |
+
def home():
|
| 16 |
+
return render_template('index.html', map_html="", selected_map="Home")
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
@app.route('/prodction_analysis', methods=['GET', 'POST'])
|
| 20 |
+
def production_analysis():
|
| 21 |
+
crop_options = df['Crop'].unique().tolist()
|
| 22 |
+
selected_crop = request.form.get('crop_type') if request.method == 'POST' else None
|
| 23 |
+
|
| 24 |
+
if not selected_crop:
|
| 25 |
+
return render_template('index.html', map_html="", selected_map="Production Analysis",
|
| 26 |
+
crop_options=crop_options, selected_crop=None)
|
| 27 |
+
|
| 28 |
+
crop_data = df[df['Crop'] == selected_crop]
|
| 29 |
+
|
| 30 |
+
if crop_data.empty:
|
| 31 |
+
return render_template('index.html', map_html="", selected_map="No Data Available",
|
| 32 |
+
crop_options=crop_options, selected_crop=selected_crop)
|
| 33 |
+
|
| 34 |
+
time_index = crop_data['Crop_Year'].unique()
|
| 35 |
+
heatmap_data = [
|
| 36 |
+
[[row['Latitude'], row['Longitude']] for _, row in crop_data[crop_data['Crop_Year'] == year].iterrows()]
|
| 37 |
+
for year in time_index
|
| 38 |
+
]
|
| 39 |
+
|
| 40 |
+
m = folium.Map(location=[20.5937, 78.9629], zoom_start=5)
|
| 41 |
+
heatmap = HeatMapWithTime(
|
| 42 |
+
heatmap_data,
|
| 43 |
+
index=[str(year) for year in time_index],
|
| 44 |
+
auto_play=True,
|
| 45 |
+
max_opacity=0.6
|
| 46 |
+
)
|
| 47 |
+
heatmap.add_to(m)
|
| 48 |
+
|
| 49 |
+
map_html = m._repr_html_()
|
| 50 |
+
return render_template('index.html', map_html=map_html, selected_map="Production Heatmap Analysis",
|
| 51 |
+
crop_options=crop_options, selected_crop=selected_crop)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
@app.route('/heatmap_analysis')
|
| 55 |
+
def heatmap_analysis():
|
| 56 |
+
global df # Declare df as global
|
| 57 |
+
m = folium.Map(location=[20.5937, 78.9629], zoom_start=5)
|
| 58 |
+
fg = folium.FeatureGroup(name="Crops")
|
| 59 |
+
m.add_child(fg)
|
| 60 |
+
df_sampled = df.sample(frac=0.005, random_state=42) # Use a different variable for sampled df
|
| 61 |
+
for crop in df_sampled['Crop'].unique():
|
| 62 |
+
subgroup = FeatureGroupSubGroup(fg, crop)
|
| 63 |
+
m.add_child(subgroup)
|
| 64 |
+
crop_data = df_sampled[df_sampled['Crop'] == crop]
|
| 65 |
+
|
| 66 |
+
heatmap_data = [[row['Latitude'], row['Longitude']] for _, row in crop_data.iterrows()]
|
| 67 |
+
HeatMap(heatmap_data).add_to(subgroup)
|
| 68 |
+
|
| 69 |
+
folium.LayerControl(collapsed=False).add_to(m)
|
| 70 |
+
|
| 71 |
+
map_html = m._repr_html_()
|
| 72 |
+
return render_template('index.html', map_html=map_html, selected_map="Crop Heatmap Analysis")
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
@app.route('/season_analysis')
|
| 76 |
+
def season_analysis():
|
| 77 |
+
global df # Declare df as global
|
| 78 |
+
|
| 79 |
+
# Initialize the map centered over India with an appropriate zoom level
|
| 80 |
+
m = folium.Map(location=[20.5937, 78.9629], zoom_start=5)
|
| 81 |
+
|
| 82 |
+
# Sample a fraction of the dataframe for performance
|
| 83 |
+
df_sampled = df.sample(frac=0.005, random_state=42)
|
| 84 |
+
|
| 85 |
+
# Create a dictionary to store top 5 crops for each location
|
| 86 |
+
top_crops = {}
|
| 87 |
+
|
| 88 |
+
# Collect the top crops for each unique location (Latitude, Longitude)
|
| 89 |
+
for _, row in df_sampled.iterrows():
|
| 90 |
+
lat_lon = (row['Latitude'], row['Longitude'])
|
| 91 |
+
crop = row['Crop']
|
| 92 |
+
production = row['Production']
|
| 93 |
+
|
| 94 |
+
if lat_lon not in top_crops:
|
| 95 |
+
top_crops[lat_lon] = {'Season': row['Season'], 'Crops': {}, 'Area': row['Area']}
|
| 96 |
+
|
| 97 |
+
if crop not in top_crops[lat_lon]['Crops']:
|
| 98 |
+
top_crops[lat_lon]['Crops'][crop] = 0
|
| 99 |
+
top_crops[lat_lon]['Crops'][crop] += production
|
| 100 |
+
|
| 101 |
+
# Limit to top 5 crops for each location
|
| 102 |
+
for location, data in top_crops.items():
|
| 103 |
+
top_crops[location]['Crops'] = sorted(data['Crops'].items(), key=lambda x: x[1], reverse=True)[:5]
|
| 104 |
+
|
| 105 |
+
# Add scatter points for each unique location with a different color for each season
|
| 106 |
+
season_colors = {
|
| 107 |
+
'Kharif': 'orange',
|
| 108 |
+
'Rabi': 'green',
|
| 109 |
+
'Winter': 'blue',
|
| 110 |
+
'Autumn':'pink',
|
| 111 |
+
'Rabi':'brown',
|
| 112 |
+
'Summer':'yellow',
|
| 113 |
+
'Whole Year':'Red'
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
for (latitude, longitude), data in top_crops.items():
|
| 117 |
+
season = data['Season']
|
| 118 |
+
top_crop_list = data['Crops']
|
| 119 |
+
area = data['Area']
|
| 120 |
+
|
| 121 |
+
# Create a string for the top crops
|
| 122 |
+
top_crops_str = "<br>".join([f"{crop[0]}: {crop[1]}" for crop in top_crop_list])
|
| 123 |
+
|
| 124 |
+
# Add a scatter point to the map for each location
|
| 125 |
+
folium.CircleMarker(
|
| 126 |
+
location=[latitude, longitude],
|
| 127 |
+
radius=7, # Fixed radius for scatter points
|
| 128 |
+
color=season_colors.get(season, 'gray'), # Use season color or gray if not found
|
| 129 |
+
fill=True,
|
| 130 |
+
fill_color=season_colors.get(season, 'gray'),
|
| 131 |
+
fill_opacity=0.7,
|
| 132 |
+
tooltip=(f"Latitude: {latitude}<br>"
|
| 133 |
+
f"Longitude: {longitude}<br>"
|
| 134 |
+
f"Season: {season}<br>"
|
| 135 |
+
f"Area: {area}<br>"
|
| 136 |
+
f"Top 5 Crops:<br>{top_crops_str}")
|
| 137 |
+
).add_to(m)
|
| 138 |
+
|
| 139 |
+
# Convert the map to HTML format for rendering
|
| 140 |
+
map_html = m._repr_html_()
|
| 141 |
+
|
| 142 |
+
# Render the map in the template
|
| 143 |
+
return render_template('index.html', map_html=map_html, selected_map="Season Analysis")
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
@app.route('/crop_analysis')
|
| 147 |
+
def crop_analysis():
|
| 148 |
+
global df # Declare df as global
|
| 149 |
+
df_sampled = df.sample(frac=0.005, random_state=42) # Use a different variable for sampled df
|
| 150 |
+
m = folium.Map(location=[20.5937, 78.9629], zoom_start=5)
|
| 151 |
+
|
| 152 |
+
for district in df_sampled['District'].unique():
|
| 153 |
+
district_data = df_sampled[df_sampled['District'] == district]
|
| 154 |
+
top_crops = district_data.groupby('Crop')['Production'].sum().nlargest(5).index.tolist()
|
| 155 |
+
lat, lon = district_data.iloc[0]['Latitude'], district_data.iloc[0]['Longitude']
|
| 156 |
+
|
| 157 |
+
folium.Marker(
|
| 158 |
+
location=[lat, lon],
|
| 159 |
+
popup=f"<b>District:</b> {district}<br><b>Top 5 Crops:</b> {', '.join(top_crops)}",
|
| 160 |
+
icon=folium.Icon(icon='arrow-up', color='green')
|
| 161 |
+
).add_to(m)
|
| 162 |
+
|
| 163 |
+
map_html = m._repr_html_()
|
| 164 |
+
return render_template('index.html', map_html=map_html, selected_map="District Crop Analysis")
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
@app.route('/combined_analysis')
|
| 168 |
+
def combined_analysis():
|
| 169 |
+
global df # Declare df as global
|
| 170 |
+
|
| 171 |
+
# Sample a fraction of the dataframe for performance
|
| 172 |
+
df_sampled = df.sample(frac=0.005, random_state=42)
|
| 173 |
+
|
| 174 |
+
# Create the map centered over India with an appropriate zoom level
|
| 175 |
+
m = folium.Map(location=[20.5937, 78.9629], zoom_start=5)
|
| 176 |
+
|
| 177 |
+
# Prepare heatmap data for area
|
| 178 |
+
area_heat_data = [
|
| 179 |
+
[row['Latitude'], row['Longitude'], row['Area']]
|
| 180 |
+
for _, row in df_sampled.iterrows()
|
| 181 |
+
]
|
| 182 |
+
|
| 183 |
+
# Add the heatmap for area (blue to red: low to high)
|
| 184 |
+
HeatMap(
|
| 185 |
+
data=area_heat_data,
|
| 186 |
+
min_opacity=0.3,
|
| 187 |
+
max_opacity=0.8,
|
| 188 |
+
radius=15,
|
| 189 |
+
blur=10,
|
| 190 |
+
gradient={0.0: 'blue', 0.5: 'lightblue', 1.0: 'red'}
|
| 191 |
+
).add_to(m)
|
| 192 |
+
|
| 193 |
+
# Prepare heatmap data for production
|
| 194 |
+
production_heat_data = [
|
| 195 |
+
[row['Latitude'], row['Longitude'], row['Production']]
|
| 196 |
+
for _, row in df_sampled.iterrows()
|
| 197 |
+
]
|
| 198 |
+
|
| 199 |
+
# Add the heatmap for production (green to red: low to high production)
|
| 200 |
+
HeatMap(
|
| 201 |
+
data=production_heat_data,
|
| 202 |
+
min_opacity=0.3,
|
| 203 |
+
max_opacity=0.8,
|
| 204 |
+
radius=15,
|
| 205 |
+
blur=10,
|
| 206 |
+
gradient={0.0: 'green', 0.5: 'yellow', 1.0: 'red'}
|
| 207 |
+
).add_to(m)
|
| 208 |
+
|
| 209 |
+
# Scatter plot for different seasons with distinct colors
|
| 210 |
+
season_colors = {
|
| 211 |
+
'Kharif': 'purple',
|
| 212 |
+
'Rabi': 'orange',
|
| 213 |
+
'Rabi': 'cyan',
|
| 214 |
+
'Winter':'Yellow',
|
| 215 |
+
'Summer':'Green',
|
| 216 |
+
'Whole Year':'Red'
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
for _, row in df_sampled.iterrows():
|
| 220 |
+
season = row['Season']
|
| 221 |
+
color = season_colors.get(season, 'gray') # Default to gray if the season is not recognized
|
| 222 |
+
folium.CircleMarker(
|
| 223 |
+
location=[row['Latitude'], row['Longitude']],
|
| 224 |
+
radius=5,
|
| 225 |
+
color=color,
|
| 226 |
+
fill=True,
|
| 227 |
+
fill_opacity=0.7,
|
| 228 |
+
tooltip=(f"District: {row['District']}<br>"
|
| 229 |
+
f"Season: {row['Season']}<br>"
|
| 230 |
+
f"Area: {row['Area']}<br>"
|
| 231 |
+
f"Production: {row['Production']}")
|
| 232 |
+
).add_to(m)
|
| 233 |
+
|
| 234 |
+
# Convert the map to HTML format
|
| 235 |
+
map_html = m._repr_html_()
|
| 236 |
+
|
| 237 |
+
# Render the map in the template
|
| 238 |
+
return render_template('index.html', map_html=map_html, selected_map="Combined Area & Production Heatmaps")
|
| 239 |
+
|
| 240 |
+
if __name__ == '__main__':
|
| 241 |
+
app.run(debug=True)
|
final_crop_historic_data_pkjk.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9cf39965597f1b461e1351928200036a07929f434420cc40e84d097f9226fc3a
|
| 3 |
+
size 311198769
|
templates/crop_analysis.html
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Crop Analysis</title>
|
| 7 |
+
</head>
|
| 8 |
+
<body>
|
| 9 |
+
<iframe src="{{ map_url }}"></iframe>
|
| 10 |
+
</body>
|
| 11 |
+
</html>
|
templates/heatmap.html
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
templates/index.html
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Crop Production Analysis</title>
|
| 7 |
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
|
| 8 |
+
<style>
|
| 9 |
+
body {
|
| 10 |
+
padding: 20px;
|
| 11 |
+
background-color: #f4f4f9;
|
| 12 |
+
}
|
| 13 |
+
.navbar {
|
| 14 |
+
background-color: black;
|
| 15 |
+
color: white;
|
| 16 |
+
}
|
| 17 |
+
.navbar a {
|
| 18 |
+
color: white;
|
| 19 |
+
}
|
| 20 |
+
.navbar-nav {
|
| 21 |
+
flex-direction: row;
|
| 22 |
+
justify-content: space-between;
|
| 23 |
+
width: 100%;
|
| 24 |
+
}
|
| 25 |
+
.container {
|
| 26 |
+
background: white;
|
| 27 |
+
border-radius: 8px;
|
| 28 |
+
padding: 20px;
|
| 29 |
+
max-height: 1500px;
|
| 30 |
+
max-width: 1700px;
|
| 31 |
+
margin-top: 20px;
|
| 32 |
+
margin-bottom: 20px;
|
| 33 |
+
}
|
| 34 |
+
.heading {
|
| 35 |
+
font-weight: bold;
|
| 36 |
+
color: green;
|
| 37 |
+
}
|
| 38 |
+
.btn-red {
|
| 39 |
+
background-color: red;
|
| 40 |
+
color: white;
|
| 41 |
+
}
|
| 42 |
+
#map-container {
|
| 43 |
+
margin-top: 20px;
|
| 44 |
+
margin-bottom:20px;
|
| 45 |
+
height: 500px;
|
| 46 |
+
border: 2px solid #ddd;
|
| 47 |
+
}
|
| 48 |
+
</style>
|
| 49 |
+
</head>
|
| 50 |
+
<body>
|
| 51 |
+
<nav class="navbar navbar-expand-lg">
|
| 52 |
+
<a class="navbar-brand" href="/">Crop Analysis</a>
|
| 53 |
+
<div class="collapse navbar-collapse">
|
| 54 |
+
<ul class="navbar-nav mr-auto">
|
| 55 |
+
<li class="nav-item"><a class="nav-link" href="/prodction_analysis">Production Analysis</a></li>
|
| 56 |
+
<li class="nav-item"><a class="nav-link" href="/heatmap_analysis">Heatmap Analysis</a></li>
|
| 57 |
+
<li class="nav-item"><a class="nav-link" href="/season_analysis">Season Analysis</a></li>
|
| 58 |
+
<li class="nav-item"><a class="nav-link" href="/crop_analysis">Geospatial Analysis</a></li>
|
| 59 |
+
<li class="nav-item"><a class="nav-link" href="/combined_analysis">Combined Analysis</a></li>
|
| 60 |
+
</ul>
|
| 61 |
+
</div>
|
| 62 |
+
</nav>
|
| 63 |
+
|
| 64 |
+
<div class="container">
|
| 65 |
+
<h2 class="heading">Crop Production Analysis</h2>
|
| 66 |
+
<form method="POST" action="/prodction_analysis">
|
| 67 |
+
<div class="form-group">
|
| 68 |
+
<label for="crop_type">Select Crop Type:</label>
|
| 69 |
+
<select class="form-control" id="crop_type" name="crop_type">
|
| 70 |
+
<option value="">Select Crop</option>
|
| 71 |
+
{% for crop in crop_options %}
|
| 72 |
+
<option value="{{ crop }}" {% if crop == selected_crop %}selected{% endif %}>{{ crop }}</option>
|
| 73 |
+
{% endfor %}
|
| 74 |
+
</select>
|
| 75 |
+
</div>
|
| 76 |
+
<button type="submit" class="btn btn-success">Analyze</button>
|
| 77 |
+
</form>
|
| 78 |
+
|
| 79 |
+
<div id="map-container">
|
| 80 |
+
{{ map_html | safe }}
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
|
| 84 |
+
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
|
| 85 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
|
| 86 |
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
|
| 87 |
+
</body>
|
| 88 |
+
</html>
|
templates/map.html
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
templates/prediction_analysis.html
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Production Analysis</title>
|
| 7 |
+
</head>
|
| 8 |
+
<body>
|
| 9 |
+
<iframe src="{{ map_url }}"></iframe>
|
| 10 |
+
</body>
|
| 11 |
+
</html>
|
templates/production_heatmap.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Production Heatmap</title>
|
| 7 |
+
</head>
|
| 8 |
+
<body>
|
| 9 |
+
<form method="get">
|
| 10 |
+
<div class="scrollable">
|
| 11 |
+
<label>Select Crops:</label><br>
|
| 12 |
+
{% for crop in crops %}
|
| 13 |
+
<input type="checkbox" name="crops" value="{{ crop }}" {% if crop in selected_crops %}checked{% endif %}>
|
| 14 |
+
{{ crop }}<br>
|
| 15 |
+
{% endfor %}
|
| 16 |
+
</div>
|
| 17 |
+
<input type="submit" value="Update Heatmap">
|
| 18 |
+
</form>
|
| 19 |
+
<iframe src="{{ map_url }}"></iframe>
|
| 20 |
+
</body>
|
| 21 |
+
</html>
|
templates/seasonal_analysis.html
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Season Analysis</title>
|
| 7 |
+
</head>
|
| 8 |
+
<body>
|
| 9 |
+
<img src="{{ image_url }}" alt="Season Analysis">
|
| 10 |
+
</body>
|
| 11 |
+
</html>
|