This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from dotenv import load_dotenv | |
from fastapi import FastAPI, Request | |
import felt_python as felt | |
import geopandas as gpd | |
from sqlalchemy import create_engine | |
import datetime | |
from slack import post_to_slack_channel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tippecanoe -zg -f -o output_filename.pmtiles input_file.geojson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from felt_python import upload_url | |
tile_url = "https://felt-user-data-assets.s3.us-west-1.amazonaws.com/enf/boston.pmtiles" | |
upload_url( | |
map_id="YOUR_MAP_ID_HERE", | |
layer_url=tile_url, | |
layer_name="Tiles loaded via python", | |
api_token="YOUR_API_TOKEN_HERE" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports for Felt-specific functionality | |
import os | |
from dotenv import load_dotenv | |
from felt_python import upload_file | |
load_dotenv() | |
os.environ["FELT_API_TOKEN"] = os.getenv("FELT_API_TOKEN") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Felt JS SDK</title> | |
</head> | |
<body> | |
<div class="container"> | |
<div id="mapContainer"></div> | |
<div id="sidebar"> | |
<h3>Selected Polygons</h3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import geopandas as gpd | |
from dotenv import load_dotenv | |
from sqlalchemy import create_engine | |
from felt_python import upload_file | |
# In the same folder as this file, create a text file named '.env' | |
# with a line that looks like: 'FELT_API_TOKEN=value-from-the-felt-ui' | |
load_dotenv() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: felt-pilot | |
channels: | |
- conda-forge | |
dependencies: | |
- python=3.12 | |
- pandas<2.2 | |
- geopandas | |
- sqlalchemy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------- | |
-- Convert crime lat/lons to points | |
----------------------------------- | |
SELECT | |
date, | |
description, | |
location_description, | |
ST_GEOGPOINT(longitude, latitude) AS geom | |
FROM | |
`cartobq.docs.sdsb_chicago_burglary_crime_sample` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SECTION 1 | |
SELECT * FROM `cartobq.docs.sds_bootcamp_nyc_starting_point` | |
SELECT * FROM `cartobq.docs.sds_bootcamp_nyc_starting_point_buffer` | |
SELECT * FROM `cartobq.docs.sds_bootcamp_nyc_census_block_groups` | |
SELECT * FROM `cartobq.docs.sds_bootcamp_nyc_census_block_groups_with_poi_data` |
NewerOlder