Compare commits
No commits in common. "bd31c08c1655c4316ef33505be5421f1eb04570e" and "69d567d13c555bec0e7d980e97d4aa6cc45ed5e3" have entirely different histories.
bd31c08c16
...
69d567d13c
|
@ -12,8 +12,6 @@ import states from './states/index.js';
|
||||||
import national_land from './national-land/index.js';
|
import national_land from './national-land/index.js';
|
||||||
import cellular from './cellular.js';
|
import cellular from './cellular.js';
|
||||||
import light_pollution from './light_pollution.js';
|
import light_pollution from './light_pollution.js';
|
||||||
import state_land from './state-land/index.js';
|
|
||||||
import trips from './trips/index.js';
|
|
||||||
|
|
||||||
const layerCategories = [
|
const layerCategories = [
|
||||||
{ // Base maps
|
{ // Base maps
|
||||||
|
@ -77,12 +75,10 @@ const layerCategories = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
trips,
|
|
||||||
chains,
|
chains,
|
||||||
census_bureau,
|
census_bureau,
|
||||||
states,
|
states,
|
||||||
national_land,
|
national_land,
|
||||||
state_land,
|
|
||||||
cellular,
|
cellular,
|
||||||
light_pollution,
|
light_pollution,
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# https://gisdata.mn.gov/dataset/bdry-dnr-lrs-prk
|
|
||||||
curl --silent --remote-name https://resources.gisdata.mn.gov/pub/gdrs/data/pub/us_mn_state_dnr/bdry_dnr_lrs_prk/shp_bdry_dnr_lrs_prk.zip
|
|
||||||
unzip shp_bdry_dnr_lrs_prk.zip
|
|
||||||
ogr2ogr -f GeoJSON mn-state-parks.geojson dnr_stat_plan_areas_prk.shp
|
|
||||||
# sed -i '/^"crs":/d' mn-state-parks.geojson # TODO: handle this projection properly
|
|
||||||
rm -r dnr_* metadata shp_bdry_dnr_lrs_prk.zip
|
|
|
@ -1,48 +0,0 @@
|
||||||
import GeoJSON from 'ol/format/GeoJSON.js';
|
|
||||||
import VectorLayer from 'ol/layer/Vector.js';
|
|
||||||
import VectorSource from 'ol/source/Vector.js';
|
|
||||||
|
|
||||||
import stateParks from './mn-state-parks.geojson?url';
|
|
||||||
|
|
||||||
import { Fill, Stroke, Style, Text } from 'ol/style.js';
|
|
||||||
|
|
||||||
// Projection stuff
|
|
||||||
import proj4 from 'proj4';
|
|
||||||
import {register} from 'ol/proj/proj4.js';
|
|
||||||
// https://epsg.io/26915.proj4js
|
|
||||||
proj4.defs("EPSG:26915","+proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs");
|
|
||||||
register(proj4);
|
|
||||||
|
|
||||||
|
|
||||||
function style(feature){
|
|
||||||
return new Style({
|
|
||||||
text: new Text({
|
|
||||||
text: feature.get('AREA_NAME') + ' ' + feature.get('AREA_TYPE'),
|
|
||||||
}),
|
|
||||||
fill: new Fill({
|
|
||||||
color: 'rgba(255,255,255,0.4)',
|
|
||||||
}),
|
|
||||||
stroke: new Stroke({
|
|
||||||
color: '#008800',
|
|
||||||
width: 1.25,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const layers = {
|
|
||||||
name: "MN State Parks",
|
|
||||||
layers: [
|
|
||||||
{
|
|
||||||
name: "State Parks",
|
|
||||||
layer: new VectorLayer({
|
|
||||||
source: new VectorSource({
|
|
||||||
url: stateParks,
|
|
||||||
format: new GeoJSON(),
|
|
||||||
}),
|
|
||||||
style: style,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default layers;
|
|
|
@ -1,13 +0,0 @@
|
||||||
import ncAug2023 from './trahan-north-carolina-august-2023/layer.js'
|
|
||||||
|
|
||||||
const trips = {
|
|
||||||
name: "Trips",
|
|
||||||
layers: [
|
|
||||||
{
|
|
||||||
name: "North Carolina 2023-08 with Trahans",
|
|
||||||
layer: ncAug2023,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default trips;
|
|
|
@ -1,9 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
FROM="2023-08-24T12:45:00.000Z"
|
|
||||||
TO="2023-09-01T21:50:00.000Z"
|
|
||||||
URL="https://whereis.chandlerswift.com/api/0/locations?from=$FROM&to=$TO&format=geojson&user=chandler&device=oneplus6t"
|
|
||||||
|
|
||||||
curl --silent "$URL" \
|
|
||||||
| python "$(dirname $0)/../../../util/process_owntracks_geojson_to_line.py" \
|
|
||||||
> data.geojson
|
|
|
@ -1,26 +0,0 @@
|
||||||
import VectorLayer from 'ol/layer/Vector';
|
|
||||||
import {Vector as VectorSource} from 'ol/source.js';
|
|
||||||
import GeoJSON from 'ol/format/GeoJSON.js';
|
|
||||||
|
|
||||||
import {Style, Stroke} from 'ol/style.js';
|
|
||||||
|
|
||||||
import url from './data.geojson?url'; // TODO: remove `?url`?
|
|
||||||
|
|
||||||
const colors = '135, 0, 226'; // Käthe says lavender
|
|
||||||
|
|
||||||
const vectorLayer = new VectorLayer({
|
|
||||||
source: new VectorSource({
|
|
||||||
url: url,
|
|
||||||
format: new GeoJSON,
|
|
||||||
}),
|
|
||||||
style: function(feature, resolution){
|
|
||||||
return new Style({
|
|
||||||
stroke: new Stroke({
|
|
||||||
color: `rgba(${colors},${Math.min(1, Math.pow(resolution/10, 1/4))})`,
|
|
||||||
width: 10/Math.pow(resolution, 1/4),
|
|
||||||
})
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export default vectorLayer;
|
|
43
package-lock.json
generated
43
package-lock.json
generated
|
@ -8,11 +8,10 @@
|
||||||
"name": "maps.chandlerswift.com",
|
"name": "maps.chandlerswift.com",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ol": "latest",
|
"ol": "latest"
|
||||||
"proj4": "2.9.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"vite": "^4.3.9"
|
"vite": "^4.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/android-arm": {
|
"node_modules/@esbuild/android-arm": {
|
||||||
|
@ -535,11 +534,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.1.tgz",
|
||||||
"integrity": "sha512-QQ/iKiM43DM9+aujTL45Iz5o7gDeSFmy4LPl3HZmNcwCE++NxGazf+yFpY+wCb+YS23sDa1ghpo3zrNFOcHlow=="
|
"integrity": "sha512-QQ/iKiM43DM9+aujTL45Iz5o7gDeSFmy4LPl3HZmNcwCE++NxGazf+yFpY+wCb+YS23sDa1ghpo3zrNFOcHlow=="
|
||||||
},
|
},
|
||||||
"node_modules/mgrs": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mgrs/-/mgrs-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-awNbTOqCxK1DBGjalK3xqWIstBZgN6fxsMSiXLs9/spqWkF2pAhb2rrYCFSsr1/tT7PhcDGjZndG8SWYn0byYA=="
|
|
||||||
},
|
|
||||||
"node_modules/minimist": {
|
"node_modules/minimist": {
|
||||||
"version": "1.2.6",
|
"version": "1.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||||
|
@ -644,15 +638,6 @@
|
||||||
"node": "^10 || ^12 || >=14"
|
"node": "^10 || ^12 || >=14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/proj4": {
|
|
||||||
"version": "2.9.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/proj4/-/proj4-2.9.0.tgz",
|
|
||||||
"integrity": "sha512-BoDXEzCVnRJVZoOKA0QHTFtYoE8lUxtX1jST38DJ8U+v1ixY70Kpwi0Llu6YqSWEH2xqu4XMEBNGcgeRIEywoA==",
|
|
||||||
"dependencies": {
|
|
||||||
"mgrs": "1.0.0",
|
|
||||||
"wkt-parser": "^1.3.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/protocol-buffers-schema": {
|
"node_modules/protocol-buffers-schema": {
|
||||||
"version": "3.6.0",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
||||||
|
@ -790,11 +775,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz",
|
||||||
"integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA=="
|
"integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA=="
|
||||||
},
|
},
|
||||||
"node_modules/wkt-parser": {
|
|
||||||
"version": "1.3.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.3.3.tgz",
|
|
||||||
"integrity": "sha512-ZnV3yH8/k58ZPACOXeiHaMuXIiaTk1t0hSUVisbO0t4RjA5wPpUytcxeyiN2h+LZRrmuHIh/1UlrR9e7DHDvTw=="
|
|
||||||
},
|
|
||||||
"node_modules/xml-utils": {
|
"node_modules/xml-utils": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.2.0.tgz",
|
||||||
|
@ -1085,11 +1065,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/mapbox-to-css-font/-/mapbox-to-css-font-2.4.1.tgz",
|
||||||
"integrity": "sha512-QQ/iKiM43DM9+aujTL45Iz5o7gDeSFmy4LPl3HZmNcwCE++NxGazf+yFpY+wCb+YS23sDa1ghpo3zrNFOcHlow=="
|
"integrity": "sha512-QQ/iKiM43DM9+aujTL45Iz5o7gDeSFmy4LPl3HZmNcwCE++NxGazf+yFpY+wCb+YS23sDa1ghpo3zrNFOcHlow=="
|
||||||
},
|
},
|
||||||
"mgrs": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mgrs/-/mgrs-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-awNbTOqCxK1DBGjalK3xqWIstBZgN6fxsMSiXLs9/spqWkF2pAhb2rrYCFSsr1/tT7PhcDGjZndG8SWYn0byYA=="
|
|
||||||
},
|
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.6",
|
"version": "1.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||||
|
@ -1158,15 +1133,6 @@
|
||||||
"source-map-js": "^1.0.2"
|
"source-map-js": "^1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"proj4": {
|
|
||||||
"version": "2.9.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/proj4/-/proj4-2.9.0.tgz",
|
|
||||||
"integrity": "sha512-BoDXEzCVnRJVZoOKA0QHTFtYoE8lUxtX1jST38DJ8U+v1ixY70Kpwi0Llu6YqSWEH2xqu4XMEBNGcgeRIEywoA==",
|
|
||||||
"requires": {
|
|
||||||
"mgrs": "1.0.0",
|
|
||||||
"wkt-parser": "^1.3.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"protocol-buffers-schema": {
|
"protocol-buffers-schema": {
|
||||||
"version": "3.6.0",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
||||||
|
@ -1249,11 +1215,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz",
|
||||||
"integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA=="
|
"integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA=="
|
||||||
},
|
},
|
||||||
"wkt-parser": {
|
|
||||||
"version": "1.3.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.3.3.tgz",
|
|
||||||
"integrity": "sha512-ZnV3yH8/k58ZPACOXeiHaMuXIiaTk1t0hSUVisbO0t4RjA5wPpUytcxeyiN2h+LZRrmuHIh/1UlrR9e7DHDvTw=="
|
|
||||||
},
|
|
||||||
"xml-utils": {
|
"xml-utils": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.2.0.tgz",
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
"vite": "^4.3.9"
|
"vite": "^4.3.9"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ol": "latest",
|
"ol": "latest"
|
||||||
"proj4": "2.9.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
#!/usr/bin/python3
|
|
||||||
|
|
||||||
import json
|
|
||||||
import math
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# https://stackoverflow.com/a/19412565
|
|
||||||
# returns distance in kilometers
|
|
||||||
def distance(lat1, lon1, lat2, lon2):
|
|
||||||
R = 6373.0 # Approximate radius of earth in km
|
|
||||||
|
|
||||||
lat1 = math.radians(52.2296756)
|
|
||||||
lon1 = math.radians(21.0122287)
|
|
||||||
lat2 = math.radians(52.406374)
|
|
||||||
lon2 = math.radians(16.9251681)
|
|
||||||
|
|
||||||
dlon = lon2 - lon1
|
|
||||||
dlat = lat2 - lat1
|
|
||||||
|
|
||||||
a = math.sin(dlat / 2)**2 + math.cos(lat1) * math.cos(lat2) * math.sin(dlon / 2)**2
|
|
||||||
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))
|
|
||||||
|
|
||||||
return R * c
|
|
||||||
|
|
||||||
data = json.load(sys.stdin)
|
|
||||||
|
|
||||||
coordinates = []
|
|
||||||
|
|
||||||
for feature in data['features']:
|
|
||||||
if feature['properties']['acc'] < 500:
|
|
||||||
coordinates.append(feature['geometry']['coordinates'])
|
|
||||||
# TODO: auto prune unnecessary points (e.g. too close to previous points?)
|
|
||||||
|
|
||||||
print(json.dumps({
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {},
|
|
||||||
"geometry": {
|
|
||||||
"type": "LineString",
|
|
||||||
"coordinates": coordinates,
|
|
||||||
},
|
|
||||||
}))
|
|
Loading…
Reference in a new issue