Commit ·
f173585
0
Parent(s):
Duplicate from dredddddd/IntMap
Browse files- .gitattributes +37 -0
- DATA_ZHK +0 -0
- README.md +13 -0
- Restaurants_and_canteens.xlsx +3 -0
- Service.xlsx +3 -0
- ZHKS_COORDS_DOMRF +0 -0
- app.py +314 -0
- cian_parsed_zhk.file +0 -0
- coordsnovostroy +0 -0
- districts_moc.pickle +3 -0
- final_part_domrf +3 -0
- requirements.txt +13 -0
- zhks_w_coords_v2.pickle +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
Restaurants_and_canteens.xlsx filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Service.xlsx filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
final_part_domrf filter=lfs diff=lfs merge=lfs -text
|
DATA_ZHK
ADDED
|
Binary file (32.8 kB). View file
|
|
|
README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: IntMap
|
| 3 |
+
emoji: 😻
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.17.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
duplicated_from: dredddddd/IntMap
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
Restaurants_and_canteens.xlsx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6171cad661d3ad3ff648c0d3c8d5a99381bdf239d6c72d10abb2124c2c5b2a1d
|
| 3 |
+
size 2867894
|
Service.xlsx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:92d9784a49eacde73cc85ba2931871c16da23e1de5918dcaed198de3bf327bab
|
| 3 |
+
size 3431143
|
ZHKS_COORDS_DOMRF
ADDED
|
Binary file (56.8 kB). View file
|
|
|
app.py
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
# coding: utf-8
|
| 3 |
+
|
| 4 |
+
# In[1]:
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
import streamlit as st
|
| 8 |
+
import pandas as pd
|
| 9 |
+
import gspread
|
| 10 |
+
from math import log
|
| 11 |
+
from math import sqrt
|
| 12 |
+
import re
|
| 13 |
+
import numpy as np
|
| 14 |
+
import osmnx as os
|
| 15 |
+
from osmnx.geocoder import geocode
|
| 16 |
+
from osmnx.distance import euclidean_dist_vec
|
| 17 |
+
from osmnx import geocode_to_gdf
|
| 18 |
+
import geocoder
|
| 19 |
+
import shapely as sh
|
| 20 |
+
import datetime
|
| 21 |
+
import pickle
|
| 22 |
+
import geopandas
|
| 23 |
+
from shapely.geometry import Point
|
| 24 |
+
from shapely.ops import unary_union
|
| 25 |
+
from shapely.ops import transform
|
| 26 |
+
import folium
|
| 27 |
+
from streamlit_folium import folium_static
|
| 28 |
+
import pyproj
|
| 29 |
+
|
| 30 |
+
@st.cache
|
| 31 |
+
def import_data():
|
| 32 |
+
Service = pd.read_excel('Service.xlsx')
|
| 33 |
+
Food = pd.read_excel('Restaurants_and_canteens.xlsx')
|
| 34 |
+
|
| 35 |
+
col2 = np.array(list(map(float, Food['Latitude_WGS84'].values[1:])))
|
| 36 |
+
col1 = np.array(list(map(float, Food['Longitude_WGS84'].values[1:])))
|
| 37 |
+
|
| 38 |
+
col2_S = np.array(list(map(float, Service['Latitude_WGS84'].values[1:])))
|
| 39 |
+
col1_S = np.array(list(map(float, Service['Longitude_WGS84'].values[1:])))
|
| 40 |
+
|
| 41 |
+
# col_S = np.column_stack([col2_S, col1_S])
|
| 42 |
+
|
| 43 |
+
# col = np.column_stack([col2, col1])
|
| 44 |
+
Data1 = geopandas.GeoDataFrame(pd.read_pickle('districts_moc.pickle')).sort_values('name')
|
| 45 |
+
|
| 46 |
+
Subway = os.geometries_from_place('Moscow', tags = {'railways':'station', 'station':'subway'})
|
| 47 |
+
Highways = os.geometries_from_place('Moscow', tags = {'highway':['motorway','trunk','primary']})
|
| 48 |
+
For = os.geometries_from_place('Moscow', tags = { 'natural':'wood',
|
| 49 |
+
'landuse':'forest'})
|
| 50 |
+
Schools = os.geometries_from_place('Moscow', tags = { 'amenity':'school'})
|
| 51 |
+
Railway = os.geometries_from_place('Moscow', tags = { 'railway':['rail','disused']})
|
| 52 |
+
locations_gpd = geopandas.GeoDataFrame(geometry=geopandas.points_from_xy(col1, col2),
|
| 53 |
+
crs='epsg:4326')
|
| 54 |
+
Eda = locations_gpd.to_crs("EPSG:25837")
|
| 55 |
+
locations_gpd1 = geopandas.GeoDataFrame(geometry=geopandas.points_from_xy(col1_S, col2_S),
|
| 56 |
+
crs='epsg:4326')
|
| 57 |
+
Uslugi = locations_gpd1.to_crs("EPSG:25837")
|
| 58 |
+
locations_gpd_m = geopandas.GeoDataFrame(Subway.geometry,
|
| 59 |
+
crs='epsg:4326')
|
| 60 |
+
Metro = locations_gpd_m.to_crs("EPSG:25837")
|
| 61 |
+
locations_gpd_H = geopandas.GeoDataFrame(Highways.geometry,
|
| 62 |
+
crs='epsg:4326')
|
| 63 |
+
Shosse = locations_gpd_H.to_crs("EPSG:25837")
|
| 64 |
+
Lesa = For.to_crs("EPSG:25837")
|
| 65 |
+
locations_gpd_Sc = geopandas.GeoDataFrame(Schools.geometry,
|
| 66 |
+
crs='epsg:4326')
|
| 67 |
+
Shkoly = locations_gpd_Sc.to_crs("EPSG:25837")
|
| 68 |
+
locations_gpd_R = geopandas.GeoDataFrame(Railway.geometry,
|
| 69 |
+
crs='epsg:4326')
|
| 70 |
+
Zhd = locations_gpd_R.to_crs("EPSG:25837")
|
| 71 |
+
# zhk = pd.read_pickle('coordsnovostroy')
|
| 72 |
+
# col2_Z = zhk['b']
|
| 73 |
+
# col1_Z = zhk['a']
|
| 74 |
+
zhk = pd.read_pickle('final_part_domrf')
|
| 75 |
+
# ZHK = pd.read_pickle('zhks_w_coords_v2.pickle')
|
| 76 |
+
# col2_Z = ZHK['Lat']
|
| 77 |
+
# col1_Z = ZHK['Long']
|
| 78 |
+
# A = pd.read_pickle('ZHKS_COORDS_DOMRF')
|
| 79 |
+
# A = geopandas.GeoDataFrame(geometry=geopandas.points_from_xy(col1_Z, col2_Z),
|
| 80 |
+
# crs='epsg:4326')
|
| 81 |
+
return Data1, Eda, Uslugi, Metro, Shosse, Lesa, Shkoly, Zhd, zhk
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
Data1, Eda, Uslugi, Metro, Shosse, Lesa, Shkoly, Zhd, zhk = import_data()
|
| 86 |
+
|
| 87 |
+
st.write("""
|
| 88 |
+
#Простая интерактивная карта v0.2 (Alfa)
|
| 89 |
+
""")
|
| 90 |
+
|
| 91 |
+
st.sidebar.header('User Input Parameters')
|
| 92 |
+
|
| 93 |
+
def user_input_features():
|
| 94 |
+
serv = st.sidebar.slider('Distance from services (не больше)', 50, 5000, 500)
|
| 95 |
+
food = st.sidebar.slider('Distance from food markets (не больше)', 50, 5000, 200)
|
| 96 |
+
metro = st.sidebar.slider('Distance from metro (не больше)', 50, 5000, 1000)
|
| 97 |
+
highway = st.sidebar.slider('Distance from highway (не меньше)', 50, 5000, 100)
|
| 98 |
+
area_forest = st.sidebar.slider('Forest area (не меньше)', 1000, 20000, 1000)
|
| 99 |
+
forest = st.sidebar.slider('Distance from forest (не больше)', 50, 5000, 1000)
|
| 100 |
+
school = st.sidebar.slider('Distance from schools (не больше)', 50, 5000, 500)
|
| 101 |
+
railway = st.sidebar.slider('Distance from railway (не меньше)', 50, 5000, 100)
|
| 102 |
+
data = {'serv': serv,
|
| 103 |
+
'food': food,
|
| 104 |
+
'metro': metro,
|
| 105 |
+
'highway': highway,
|
| 106 |
+
'area_forest': area_forest,
|
| 107 |
+
'forest': forest,
|
| 108 |
+
'school': school,
|
| 109 |
+
'railway': railway}
|
| 110 |
+
features = pd.DataFrame(data, index=[0])
|
| 111 |
+
return features
|
| 112 |
+
|
| 113 |
+
df = user_input_features()
|
| 114 |
+
|
| 115 |
+
st.subheader('User Input parameters')
|
| 116 |
+
st.write(df)
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
# In[17]:
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
# def PLOT(serv,food,metro,highway,area_forest,forest, school,railway):
|
| 123 |
+
# m = folium.Map(location=[55.87890, 37.71943], zoom_start=10, tiles='CartoDB positron')
|
| 124 |
+
# locations_gpd = geopandas.GeoDataFrame(Eda.geometry)
|
| 125 |
+
# locations_gpd.geometry = locations_gpd.geometry.buffer(serv,resolution=2)
|
| 126 |
+
# K = locations_gpd.geometry.unary_union
|
| 127 |
+
# locations_gpd1 = geopandas.GeoDataFrame(Uslugi.geometry)
|
| 128 |
+
# locations_gpd1.geometry = locations_gpd1.geometry.buffer(food,resolution=2)
|
| 129 |
+
# T = locations_gpd1.geometry.unary_union
|
| 130 |
+
|
| 131 |
+
# locations_gpd_m = geopandas.GeoDataFrame(Metro.geometry)
|
| 132 |
+
# locations_gpd_m.geometry = locations_gpd_m.geometry.buffer(metro,resolution=2)
|
| 133 |
+
# M = locations_gpd_m.geometry.unary_union
|
| 134 |
+
# locations_gpd_H = geopandas.GeoDataFrame(Shosse.geometry)
|
| 135 |
+
# locations_gpd_H.geometry = locations_gpd_H.geometry.buffer(highway,resolution=2)
|
| 136 |
+
# H = locations_gpd_H.geometry.unary_union
|
| 137 |
+
|
| 138 |
+
# Forests = geopandas.GeoDataFrame(Lesa.geometry)
|
| 139 |
+
# Forests = Forests[Forests.geometry.area > area_forest]
|
| 140 |
+
# Forests.geometry = Forests.geometry.buffer(forest,resolution=2)
|
| 141 |
+
# F = Forests.geometry.unary_union
|
| 142 |
+
|
| 143 |
+
# locations_gpd_Sc = geopandas.GeoDataFrame(Shkoly.geometry)
|
| 144 |
+
# locations_gpd_Sc.geometry = locations_gpd_Sc.geometry.buffer(school,resolution=2)
|
| 145 |
+
# Sc = locations_gpd_Sc.geometry.unary_union
|
| 146 |
+
|
| 147 |
+
# locations_gpd_R = geopandas.GeoDataFrame(Zhd.geometry)
|
| 148 |
+
# locations_gpd_R.geometry = locations_gpd_R.geometry.buffer(railway,resolution=2)
|
| 149 |
+
# Ra = locations_gpd_R.geometry.unary_union
|
| 150 |
+
|
| 151 |
+
# url = "https://cdn-icons-png.flaticon.com/512/746/746859.png{}".format
|
| 152 |
+
# beerGlass_img = url("")
|
| 153 |
+
# custom_icon = folium.CustomIcon(beerGlass_img, icon_size=(35, 35), popup_anchor=(0, -22))
|
| 154 |
+
# insta_post = 'https://www.instagram.com/p/CjcvNysq8om/'
|
| 155 |
+
# website = 'vk.com'
|
| 156 |
+
# name = 'bebra'
|
| 157 |
+
# directions = 'https://yandex.ru/maps/213/moscow/stops/2057340510/?ll=37.593517%2C55.775694&tab=overview&z=12.32'
|
| 158 |
+
# realty_html = folium.Html(f"""<p style="text-align: center;"><span style="font-family: Didot, serif; font-size: 21px;">{name}</span></p>
|
| 159 |
+
# <p style="text-align: center;"><iframe src={insta_post}embed width="240" height="290" frameborder="0" scrolling="auto" allowtransparency="true"></iframe>
|
| 160 |
+
# <p style="text-align: center;"><a href={website} target="_blank" title="{name} Website"><span style="font-family: Didot, serif; font-size: 17px;">{name} Website</span></a></p>
|
| 161 |
+
# <p style="text-align: center;"><a href={directions} target="_blank" title="Directions to {name}"><span style="font-family: Didot, serif; font-size: 17px;">Directions to {name}</span></a></p>
|
| 162 |
+
# """, script=True)
|
| 163 |
+
|
| 164 |
+
# popup = folium.Popup(realty_html, max_width=700)
|
| 165 |
+
|
| 166 |
+
# custom_marker = folium.Marker(location=[55.87890,37.71943], icon=custom_icon, tooltip=name, popup=popup)
|
| 167 |
+
|
| 168 |
+
|
| 169 |
+
# R = K.intersection(T)
|
| 170 |
+
# R = R.intersection(M)
|
| 171 |
+
# R= R.difference(H)
|
| 172 |
+
# R = R.intersection(F)
|
| 173 |
+
# R = R.intersection(Sc)
|
| 174 |
+
# R= R.difference(Ra)
|
| 175 |
+
# wgs84 = pyproj.CRS('EPSG:25837')
|
| 176 |
+
# utm = pyproj.CRS('EPSG:4326')
|
| 177 |
+
|
| 178 |
+
# project = pyproj.Transformer.from_crs(wgs84, utm, always_xy=True).transform
|
| 179 |
+
# utm_point = transform(project, R)
|
| 180 |
+
# R = folium.GeoJson(data=utm_point, style_function=lambda x: {'fillColor': 'orange'})
|
| 181 |
+
# b = folium.GeoJson(data=M, style_function=lambda x: {'fillColor': '#00000000', 'color': '#00000000'})
|
| 182 |
+
# AH = folium.GeoJson(data=(Data1), style_function=lambda x: {'fillColor': '#00000000', 'color': 'black'})
|
| 183 |
+
|
| 184 |
+
# fg1 = folium.map.FeatureGroup(name='Metro').add_to(m)
|
| 185 |
+
# fg2 = folium.map.FeatureGroup(name='Plot').add_to(m)
|
| 186 |
+
# fg3 = folium.map.FeatureGroup(name='Districts').add_to(m)
|
| 187 |
+
# fg4 = folium.map.FeatureGroup(name='rightzhk').add_to(m)
|
| 188 |
+
# fg5 = folium.map.FeatureGroup(name='badzhk').add_to(m)
|
| 189 |
+
# R.add_child(folium.Popup('Plot'))
|
| 190 |
+
# b.add_child(folium.Popup('Метро'))
|
| 191 |
+
# AH.add_child(folium.Popup('Районы'))
|
| 192 |
+
# custom_marker.add_to(fg2)
|
| 193 |
+
# fg1.add_child(b)
|
| 194 |
+
# fg2.add_child(R)
|
| 195 |
+
# fg3.add_child(AH)
|
| 196 |
+
# G = np.array(A.intersects(utm_point))
|
| 197 |
+
# zhk['G']=G
|
| 198 |
+
# zhk_1 = zhk.query('G == True').copy()
|
| 199 |
+
# zhk_2 = zhk.query('G == False').copy()
|
| 200 |
+
# del(zhk['G'])
|
| 201 |
+
# for i,row in zhk_1.iterrows():
|
| 202 |
+
# iframe = folium.IFrame('ЖК:' + str(row[2]))
|
| 203 |
+
# popup = folium.Popup(iframe, min_width=100, max_width=100)
|
| 204 |
+
# Z=folium.Marker(location=[row[1],row[0]],
|
| 205 |
+
# popup = popup, icon=folium.Icon(color='red', icon=''))
|
| 206 |
+
# fg4.add_child(Z)
|
| 207 |
+
# for i,row in zhk_2.iterrows():
|
| 208 |
+
# iframe = folium.IFrame('ЖК:' + str(row[2]))
|
| 209 |
+
# popup = folium.Popup(iframe, min_width=100, max_width=100)
|
| 210 |
+
# Z=folium.Marker(location=[row[1],row[0]],
|
| 211 |
+
# popup = popup, icon=folium.Icon(color='gray', icon=''))
|
| 212 |
+
# fg4.add_child(Z)
|
| 213 |
+
# del(zhk_1)
|
| 214 |
+
# del(zhk_2)
|
| 215 |
+
# folium.LayerControl().add_to(m)
|
| 216 |
+
|
| 217 |
+
|
| 218 |
+
# folium_static(m)
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
# In[ ]:
|
| 222 |
+
|
| 223 |
+
|
| 224 |
+
st.subheader('Интерактивная карта')
|
| 225 |
+
# PLOT(df['serv'][0],df['food'][0],df['metro'][0],df['highway'][0],df['area_forest'][0],df['forest'][0],df['school'][0],df['railway'][0])
|
| 226 |
+
m = folium.Map(location=[55.87890, 37.71943], zoom_start=10, tiles='CartoDB positron')
|
| 227 |
+
locations_gpd = geopandas.GeoDataFrame(Eda.geometry)
|
| 228 |
+
locations_gpd.geometry = locations_gpd.geometry.buffer(df['serv'][0],resolution=2)
|
| 229 |
+
K = locations_gpd.geometry.unary_union
|
| 230 |
+
locations_gpd1 = geopandas.GeoDataFrame(Uslugi.geometry)
|
| 231 |
+
locations_gpd1.geometry = locations_gpd1.geometry.buffer(df['food'][0],resolution=2)
|
| 232 |
+
T = locations_gpd1.geometry.unary_union
|
| 233 |
+
|
| 234 |
+
locations_gpd_m = geopandas.GeoDataFrame(Metro.geometry)
|
| 235 |
+
locations_gpd_m.geometry = locations_gpd_m.geometry.buffer(df['metro'][0],resolution=2)
|
| 236 |
+
M = locations_gpd_m.geometry.unary_union
|
| 237 |
+
locations_gpd_H = geopandas.GeoDataFrame(Shosse.geometry)
|
| 238 |
+
locations_gpd_H.geometry = locations_gpd_H.geometry.buffer(df['highway'][0],resolution=2)
|
| 239 |
+
H = locations_gpd_H.geometry.unary_union
|
| 240 |
+
|
| 241 |
+
Forests = geopandas.GeoDataFrame(Lesa.geometry)
|
| 242 |
+
Forests = Forests[Forests.geometry.area > df['area_forest'][0]]
|
| 243 |
+
Forests.geometry = Forests.geometry.buffer(df['forest'][0],resolution=2)
|
| 244 |
+
F = Forests.geometry.unary_union
|
| 245 |
+
|
| 246 |
+
locations_gpd_Sc = geopandas.GeoDataFrame(Shkoly.geometry)
|
| 247 |
+
locations_gpd_Sc.geometry = locations_gpd_Sc.geometry.buffer(df['school'][0],resolution=2)
|
| 248 |
+
Sc = locations_gpd_Sc.geometry.unary_union
|
| 249 |
+
|
| 250 |
+
locations_gpd_R = geopandas.GeoDataFrame(Zhd.geometry)
|
| 251 |
+
locations_gpd_R.geometry = locations_gpd_R.geometry.buffer(df['railway'][0],resolution=2)
|
| 252 |
+
Ra = locations_gpd_R.geometry.unary_union
|
| 253 |
+
|
| 254 |
+
url = "https://cdn-icons-png.flaticon.com/512/746/746859.png{}".format
|
| 255 |
+
beerGlass_img = url("")
|
| 256 |
+
custom_icon = folium.CustomIcon(beerGlass_img, icon_size=(35, 35), popup_anchor=(0, -22))
|
| 257 |
+
insta_post = 'https://www.instagram.com/p/CjcvNysq8om/'
|
| 258 |
+
website = 'vk.com'
|
| 259 |
+
name = 'bebra'
|
| 260 |
+
directions = 'https://yandex.ru/maps/213/moscow/stops/2057340510/?ll=37.593517%2C55.775694&tab=overview&z=12.32'
|
| 261 |
+
realty_html = folium.Html(f"""<p style="text-align: center;"><span style="font-family: Didot, serif; font-size: 21px;">{name}</span></p>
|
| 262 |
+
<p style="text-align: center;"><iframe src={insta_post}embed width="240" height="290" frameborder="0" scrolling="auto" allowtransparency="true"></iframe>
|
| 263 |
+
<p style="text-align: center;"><a href={website} target="_blank" title="{name} Website"><span style="font-family: Didot, serif; font-size: 17px;">{name} Website</span></a></p>
|
| 264 |
+
<p style="text-align: center;"><a href={directions} target="_blank" title="Directions to {name}"><span style="font-family: Didot, serif; font-size: 17px;">Directions to {name}</span></a></p>
|
| 265 |
+
# """, script=True)
|
| 266 |
+
|
| 267 |
+
popup = folium.Popup(realty_html, max_width=700)
|
| 268 |
+
|
| 269 |
+
custom_marker = folium.Marker(location=[55.87890,37.71943], icon=custom_icon, tooltip=name, popup=popup)
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
R = K.intersection(T)
|
| 273 |
+
R = R.intersection(M)
|
| 274 |
+
R= R.difference(H)
|
| 275 |
+
R = R.intersection(F)
|
| 276 |
+
R = R.intersection(Sc)
|
| 277 |
+
R= R.difference(Ra)
|
| 278 |
+
wgs84 = pyproj.CRS('EPSG:25837')
|
| 279 |
+
utm = pyproj.CRS('EPSG:4326')
|
| 280 |
+
|
| 281 |
+
project = pyproj.Transformer.from_crs(wgs84, utm, always_xy=True).transform
|
| 282 |
+
utm_point = transform(project, R)
|
| 283 |
+
R = folium.GeoJson(data=utm_point, style_function=lambda x: {'fillColor': 'orange'})
|
| 284 |
+
b = folium.GeoJson(data=M, style_function=lambda x: {'fillColor': '#00000000', 'color': '#00000000'})
|
| 285 |
+
AH = folium.GeoJson(data=(Data1), style_function=lambda x: {'fillColor': '#00000000', 'color': 'black'})
|
| 286 |
+
|
| 287 |
+
fg1 = folium.map.FeatureGroup(name='Metro').add_to(m)
|
| 288 |
+
fg2 = folium.map.FeatureGroup(name='Plot').add_to(m)
|
| 289 |
+
fg3 = folium.map.FeatureGroup(name='Districts').add_to(m)
|
| 290 |
+
# fg4 = folium.map.FeatureGroup(name='rightzhk').add_to(m)
|
| 291 |
+
# fg5 = folium.map.FeatureGroup(name='badzhk').add_to(m)
|
| 292 |
+
R.add_child(folium.Popup('Plot'))
|
| 293 |
+
b.add_child(folium.Popup('Метро'))
|
| 294 |
+
AH.add_child(folium.Popup('Районы'))
|
| 295 |
+
custom_marker.add_to(fg2)
|
| 296 |
+
fg1.add_child(b)
|
| 297 |
+
fg2.add_child(R)
|
| 298 |
+
fg3.add_child(AH)
|
| 299 |
+
# G = np.array(A.intersects(utm_point))
|
| 300 |
+
# for i,row in zhk.iterrows():
|
| 301 |
+
# iframe = folium.IFrame('ЖК:' + str(row[3]))
|
| 302 |
+
# popup = folium.Popup(iframe, min_width=100, max_width=100)
|
| 303 |
+
# # if (G[i]):
|
| 304 |
+
# Z=folium.Marker(location=[row[11],row[12]],
|
| 305 |
+
# popup = popup, icon=folium.Icon(color='red', icon=''))
|
| 306 |
+
# fg4.add_child(Z)
|
| 307 |
+
# # else:
|
| 308 |
+
# # Z=folium.Marker(location=[row[11],row[12]],
|
| 309 |
+
# # popup = popup, icon=folium.Icon(color='gray', icon=''))
|
| 310 |
+
# # fg5.add_child(Z)
|
| 311 |
+
# folium.LayerControl().add_to(m)
|
| 312 |
+
|
| 313 |
+
|
| 314 |
+
folium_static(m)
|
cian_parsed_zhk.file
ADDED
|
Binary file (23.1 kB). View file
|
|
|
coordsnovostroy
ADDED
|
Binary file (180 kB). View file
|
|
|
districts_moc.pickle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50e1d18d4a219f9c91aa3ad172d1091dc46141df387df950d357f93130d66f40
|
| 3 |
+
size 1377531
|
final_part_domrf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0514ed22af616844e377e6eb4ade606d66d1d479b456c9c15970982be417e6d6
|
| 3 |
+
size 5519673
|
requirements.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
pandas
|
| 3 |
+
gspread
|
| 4 |
+
numpy
|
| 5 |
+
osmnx
|
| 6 |
+
geocoder
|
| 7 |
+
shapely
|
| 8 |
+
datetime
|
| 9 |
+
geopandas
|
| 10 |
+
folium
|
| 11 |
+
streamlit_folium
|
| 12 |
+
pyproj
|
| 13 |
+
openpyxl
|
zhks_w_coords_v2.pickle
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:51495238f8955de4c75a6744c7948d288585a1d14ac897fb8235debb7ea69b25
|
| 3 |
+
size 20835
|