Skip to content

Commit

Permalink
Merge pull request #20 from raphaellaude/use-local-pmtiles
Browse files Browse the repository at this point in the history
Use local pmtiles
  • Loading branch information
raphaellaude authored Mar 25, 2024
2 parents 7011e6a + 6938192 commit f5ba9f7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ scratch/
.env
*.swp
logfile.log
assets/
44 changes: 22 additions & 22 deletions pluto-hist/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"08": {
"year": 2008,
"id": "pluto08_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto08_shp_wgs.pmtiles",
"url": "pluto08_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -19,7 +19,7 @@
"11": {
"year": 2011,
"id": "pluto11_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto11_shp_wgs.pmtiles",
"url": "pluto11_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -36,7 +36,7 @@
"23": {
"year": 2023,
"id": "pluto23_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto23_shp_wgs.pmtiles",
"url": "pluto23_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -53,7 +53,7 @@
"07": {
"year": 2007,
"id": "pluto07_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto07_shp_wgs.pmtiles",
"url": "pluto07_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -70,7 +70,7 @@
"19": {
"year": 2019,
"id": "pluto19_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto19_shp_wgs.pmtiles",
"url": "pluto19_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -87,7 +87,7 @@
"16": {
"year": 2016,
"id": "pluto16_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto16_shp_wgs.pmtiles",
"url": "pluto16_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -104,7 +104,7 @@
"18": {
"year": 2018,
"id": "pluto18_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto18_shp_wgs.pmtiles",
"url": "pluto18_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -121,7 +121,7 @@
"17": {
"year": 2017,
"id": "pluto17_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto17_shp_wgs.pmtiles",
"url": "pluto17_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -138,7 +138,7 @@
"09": {
"year": 2009,
"id": "pluto09_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto09_shp_wgs.pmtiles",
"url": "pluto09_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -155,7 +155,7 @@
"10": {
"year": 2010,
"id": "pluto10_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto10_shp_wgs.pmtiles",
"url": "pluto10_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -172,7 +172,7 @@
"22": {
"year": 2022,
"id": "pluto22_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto22_shp_wgs.pmtiles",
"url": "pluto22_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -189,7 +189,7 @@
"06": {
"year": 2006,
"id": "pluto06_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto06_shp_wgs.pmtiles",
"url": "pluto06_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -206,7 +206,7 @@
"03": {
"year": 2003,
"id": "pluto03_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto03_shp_wgs.pmtiles",
"url": "pluto03_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -223,7 +223,7 @@
"15": {
"year": 2015,
"id": "pluto15_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto15_shp_wgs.pmtiles",
"url": "pluto15_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -240,7 +240,7 @@
"12": {
"year": 2012,
"id": "pluto12_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto12_shp_wgs.pmtiles",
"url": "pluto12_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -257,7 +257,7 @@
"04": {
"year": 2004,
"id": "pluto04_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto04_shp_wgs.pmtiles",
"url": "pluto04_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -274,7 +274,7 @@
"20": {
"year": 2020,
"id": "pluto20_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto20_shp_wgs.pmtiles",
"url": "pluto20_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -291,7 +291,7 @@
"13": {
"year": 2013,
"id": "pluto13_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto13_shp_wgs.pmtiles",
"url": "pluto13_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -308,7 +308,7 @@
"05": {
"year": 2005,
"id": "pluto05_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto05_shp_wgs.pmtiles",
"url": "pluto05_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -325,7 +325,7 @@
"21": {
"year": 2021,
"id": "pluto21_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto21_shp_wgs.pmtiles",
"url": "pluto21_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -342,7 +342,7 @@
"02": {
"year": 2002,
"id": "pluto02_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto02_shp_wgs.pmtiles",
"url": "pluto02_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand All @@ -359,7 +359,7 @@
"14": {
"year": 2014,
"id": "pluto14_shp_wgs",
"url": "pmtiles://https://pluto-hist.s3.amazonaws.com/data/tilesets/pluto14_shp_wgs.pmtiles",
"url": "pluto14_shp_wgs.pmtiles",
"columns": [
{ "name": "Land use", "id": "landuse" },
{ "name": "Simplified zoning district", "id": "zonedist1" },
Expand Down
2 changes: 1 addition & 1 deletion pluto-hist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ map.on("load", function () {

map.addSource(`pluto-${y}`, {
type: "vector",
url: layerData.url,
url: `${import.meta.env.VITE_TILE_DIR}${layerData.url}`,
});

choroplethLayers.forEach((k) => {
Expand Down
10 changes: 1 addition & 9 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,12 @@ xset s noblank
xset s off
xset -dpms

unclutter -idle 0.5 -root &

USER=fishmulch

cd "/home/$USER/Documents/github/pluto-hist"

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' "/home/$USER/.config/chromium/Default/Preferences"
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' "/home/$USER/.config/chromium/Default/Preferences"

cd backend
poetry run uvicorn main:app --reload --log-config log.conf & # start backend
cd ..

cd pluto-hist
http-server . --cors &
VITE_KIOSK=true npm run dev &
cd ..

Expand Down

0 comments on commit f5ba9f7

Please sign in to comment.