Add Culver's

main
Chandler Swift 2023-07-04 00:56:31 -05:00
parent 4167fed59c
commit 4c4b37e74e
Signed by: chandlerswift
GPG Key ID: A851D929D52FB93F
4 changed files with 162 additions and 0 deletions

View File

@ -0,0 +1,70 @@
#!/usr/bin/env python3
import requests
import json
print("Searching for Culver's locations")
response = requests.get('https://hosted.where2getit.com/lite?action=getstategeojsonmap&appkey=EC84928C-9C0B-11E4-B999-D8F4B845EC6E').json()
stores = []
state_names = {}
for f in response['states']['features']:
state_names[f['properties']['name']] = f['properties']['regiondesc']
for s in response['labels']['features']:
if s['properties']['num_stores'] > 0:
state = s['properties']['name']
print(f"Searching {state}...", end="")
json_data = {
'request': {
'appkey': '1099682E-D719-11E6-A0C4-347BDEB8F1E5',
'formdata': {
'geolocs': {
'geoloc': [
{
'addressline': state,
'state': state_names[state],
},
],
},
'stateonly': 1,
},
},
}
response = requests.post('https://hosted.where2getit.com/culvers/rest/locatorsearch', json=json_data)
count = 0
for store in response.json()['response']['collection']:
# I tried a bunch of other things and this is the only one that matched :facepalm:
if "coming soon" in store['name'].lower(): # store['comingsoondate']: # not store['dine_in'] and not store['takeout']: # not store['opendate']: # store['comingsoondate']:
# print(f"{store['name']} not yet open")
continue
stores.append({
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [float(store['longitude']), float(store['latitude'])], # yes, [lon, lat] since it's [x, y]
},
"properties": {
'address': store['address1'],
'city': store['city'],
'state': store['state'],
'zip': store['postalcode'],
'website': store['url'],
},
})
count += 1
print(count)
if not count == s['properties']['num_stores']:
print(f"Inequal for {state}: {count} != {s['properties']['num_stores']}")
print(f"""{len(stores)} locations found""")
geojson = {
"type": "FeatureCollection",
"features": stores,
}
with open("culvers-data.geojson", "w") as f:
f.write(json.dumps(geojson))

View File

@ -0,0 +1,24 @@
import VectorLayer from 'ol/layer/Vector';
import {Vector as VectorSource} from 'ol/source.js';
import GeoJSON from 'ol/format/GeoJSON.js';
import {Style} from 'ol/style.js';
import Icon from 'ol/style/Icon.js';
import culversURL from '/data/culvers-data.geojson?url'; // TODO: remove `?url`?
import pinURL from '/layers/culvers/pin.svg?url'; // TODO: remove `?url`?
const vectorLayer = new VectorLayer({
source: new VectorSource({
url: culversURL,
format: new GeoJSON,
}),
style: new Style({
image: new Icon({
anchor: [0.5, 1],
src: pinURL,
}),
}),
});
export default vectorLayer;

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 384 512"
width="40px"
height="30px"
version="1.1"
id="svg873"
sodipodi:docname="culvers-location-pin-solid.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs877" />
<sodipodi:namedview
id="namedview875"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="1.5917969"
inkscape:cx="180.6135"
inkscape:cy="296.20613"
inkscape:window-width="1916"
inkscape:window-height="1030"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g1175" />
<!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. -->
<path
d="m 384,192 c 0,87.4 -117,243 -168.3,307.2 -12.3,15.3 -35.1,15.3 -47.4,0 C 116.1,435 0,279.4 0,192 0,85.96 85.96,0 192,0 245.96029,0 294.73775,22.275796 329.62577,58.136607 363.27205,92.721042 384,139.94065 384,192 Z"
id="path871"
sodipodi:nodetypes="sccssss"
style="fill:#005696;fill-opacity:1" />
<g
id="g1175"
transform="matrix(0.7011677,0,0,0.7011677,25.41615,116.65117)"
style="stroke-width:1.00260199;stroke-miterlimit:4;stroke-dasharray:none">
<g
id="g1167"
style="stroke-width:1.0026;stroke-miterlimit:4;stroke-dasharray:none">
<path
fill="#ffffff"
d="m 413.7,58.1 c 17.8,-0.7 26,-21.5 26,-32.2 0,-5.9 -2.7,-13.4 -8.7,-13.4 -7.3,0 -18.2,11.4 -18.2,24.4 0,8.7 4,9.7 3.9,11.1 -0.3,5.3 -11.5,10.5 -3,10.1 z m 57.5,16.5 c 0,13.7 -7.8,24.4 -16.5,25.1 5.5,-7.6 7,-10.3 8.4,-19.9 2.9,-22.5 -3,-22.4 -5.7,-34.8 0,0 3.2,-12.1 -2.4,-11 -23.8,4.4 -7.1,11.8 -40.8,64.5 -5.8,9.3 -13.7,12 -14.3,11.9 -11.8,-2 10.2,-21.7 11.1,-28.3 1.8,-15.1 -2.9,-23.2 -6.6,-22.9 -8.6,0.8 -15.9,6.2 -22.7,5.8 0,0 4.1,-6.2 -3.1,-6.2 -14.3,0 -22.5,25.8 -22.5,32.7 0,3.5 2.7,6.4 2.7,7.3 0,4.1 -13.6,27.4 -24,27.4 -6.1,0 -7,-7 -7,-8.2 0,-4.6 27.8,-17 27.8,-39.7 0,-5.8 -2.5,-13.4 -10.2,-13.4 -14.6,0 -29.1,14.3 -33.8,23.7 -13.3,25.6 0.8,29.1 -14.4,34.4 0,0 -7,2 -4.5,-5.7 0.9,-4.6 4.2,-8.5 5.6,-17.7 2.2,-15.4 -3.6,-15 -9.7,-14.6 -13.7,1 -17.1,27.5 -17.1,35 0,3.6 0,5.8 0,9.5 0,2.8 -6.2,15.5 -11.8,15.7 -2.6,0.1 -3.4,-9.4 -3.4,-11.6 0,-6 13.9,-18.7 13.9,-37.2 0,-5.9 -7.2,-6.6 -11.9,-6.6 -16.3,0 -18.8,43 -18.8,43 0,18 -15.9,21.8 -16.1,21.8 -7.7,0 -8.9,-19 -8.9,-19 -0.4,-9.8 25.8,-21.6 25.8,-74 0,-5.5 -2.4,-15.8 -8.2,-14.8 -18.7,3.3 -36.3,68.3 -34.7,90.8 -1.6,4.2 -15.8,23.3 -21.2,23.3 -2.6,0 -2.5,-2.2 -2.5,-5.3 0,-12.8 15.9,-29.9 15.9,-37.2 0,-7.3 -9.6,-18.2 -10.2,-18.2 -9.1,0 -22.4,30.4 -24.8,40.6 -2,8.6 -14.3,26.6 -18.8,24.9 -8.1,-3 14.3,-29.6 17.6,-37.2 2.9,-6.6 1.9,-11.2 -6.2,-12.6 -26.2,-4.5 -28.2,33 -30.6,40.4 -0.3,0.9 -35.1,45.8 -50.7,45.8 -8.1,0 -20.7,-1.9 -19.6,-30.2 C 48,129 90,76.5 99.8,74.9 c 6,-1.1 -1.5,30.7 -12.6,38 -18.1,11.9 -39.7,37.7 -22.9,47.8 25.5,15.5 44.1,-35.5 44.1,-35.5 30.7,-61.3 8.9,-75 -2.9,-75 -27.2,0 -93.7,80.3 -93.7,130.2 0,31 20.5,50.8 38.5,50.8 35.6,0 57.2,-42.2 67.7,-51.9 2.9,3 9.6,12.6 19.7,12.6 11.8,0 11.9,-16.3 18.1,-20.5 1.5,4.2 4.2,15 14.2,15 16.1,0 17.7,-19 27.5,-24.3 2.3,12.1 9.9,17.3 18.9,17.3 13.5,0 21.1,-12.2 27.2,-23 5.1,4 6.1,9 13.7,9.6 16.4,1.4 25.2,-26.4 26,-26.7 0,0 5.4,2.3 7.1,2.3 9.1,0 16.2,-9.7 17.5,-8.5 0.4,0.4 6.7,11.3 13.9,13 30.2,7.2 49,-36.4 53.6,-49.8 0.2,-0.6 7.1,-3.5 10.6,-4.9 -2.4,7 -10.2,19.3 -7.3,33.5 1.6,8.2 7.3,13.9 17.2,12.7 13.8,-1.6 22.3,-24.4 25.3,-25 6.6,-1.3 10,11 20.5,11 14.3,0 38.5,-19.1 38.5,-35.6 -0.3,-2.1 -2.4,-17.2 -9,-13.4 z m -258.8,36.3 -0.1,-0.2 v -0.1 c 0,-5.9 9,-27.7 12.3,-32.2 1,-1.3 2.1,-0.8 2.6,-0.5 0.6,0.5 2.1,1.6 -1.9,13.2 -0.1,0.2 -7.2,21 -11.3,21 -0.4,0.1 -1.2,0 -1.6,-1.2 z M 324.9,99.4 c -1.1,-3.5 6.8,-15.3 11.4,-16.7 2.1,-0.6 3.5,0.3 4,1.1 1.4,2.4 -1.3,7.4 -4.5,11 -7.4,7.2 -10.7,5.3 -10.9,4.6 z m 115.2,-3.6 c -1.5,0 -4.5,-1.6 -6.7,-3.1 8.2,-16.4 8,-19.7 11,-22 3.9,2.6 4.7,3.5 4.7,9.6 0.1,7.1 -4.1,15.5 -9,15.5 z"
id="path1165"
style="stroke-width:1.0026;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
<g
id="g1171"
style="stroke-width:1.0026;stroke-miterlimit:4;stroke-dasharray:none">
<path
fill="#ffffff"
d="m 486.8,113.8 c -4.3,0 -7.6,-3.5 -7.6,-7.6 0,-4.2 3.4,-7.7 7.7,-7.7 4.3,0 7.6,3.5 7.6,7.6 0.1,4.2 -3.3,7.7 -7.7,7.7 z m 0.1,-14.5 c -3.9,0 -6.8,3.1 -6.8,6.9 0,3.8 2.9,6.8 6.8,6.8 3.9,0 6.8,-3.1 6.8,-6.9 0,-3.7 -2.9,-6.8 -6.8,-6.8 z m 1.9,7.8 2,2.9 h -2.1 l -1.7,-2.6 h -1.4 v 2.6 h -1.8 v -8.1 h 3.6 c 1.9,0 3.2,1 3.2,2.7 0,1.3 -0.8,2.2 -1.8,2.5 z m -1.5,-3.6 h -1.7 v 2.4 h 1.8 c 0.9,0 1.4,-0.5 1.4,-1.2 0,-0.8 -0.6,-1.2 -1.5,-1.2 z"
id="path1169"
style="stroke-width:1.0026;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -5,6 +5,7 @@ import Stamen from 'ol/source/Stamen.js';
import amtrakLayer from './amtrak/layer.js';
import arenasLayer from './nhl-arenas/layer.js';
import menardsLayer from './menards/layer.js';
import culversLayer from './culvers/layer.js';
const layerCategories = [
{
@ -61,6 +62,10 @@ const layerCategories = [
name: "Menards",
layer: menardsLayer,
},
{
name: "Culver's",
layer: culversLayer,
},
]
}
];