Skip to content

Instantly share code, notes, and snippets.

View jj0hns0n's full-sized avatar

Jeffrey Johnson jj0hns0n

View GitHub Profile
{
"city": "Vero Beach",
"country": "United States",
"year": 2025,
"safest_neighborhoods": [
{
"name": "South Beach",
"description": "A luxurious waterfront neighborhood offering Atlantic and Indian River access, known for its low crime rates and upscale living.",
"source": "https://www.homes.com/neighborhood-search/vero-beach-fl/safest/"
},
geosure=# \d h3_l8_union_cities_urban
Table "public.h3_l8_union_cities_urban"
Column | Type | Collation | Nullable | Default
-----------------------------------+------------------------+-----------+----------+---------
h3 | text | | |
geom | geometry(Polygon,4326) | | |
source | text | | |
adm0_admin | text | | |
adm0_a3 | text | | |
adm0_name | text | | |
DO $$
DECLARE
iso TEXT;
base_val DOUBLE PRECISION;
min_val INTEGER;
max_val INTEGER;
BEGIN
FOR iso IN
SELECT adm0_iso FROM geosure_country_modes
LOOP
WITH weights AS (
SELECT
0.24 AS w_adm0_crime,
0.18 AS w_adm1_violent,
0.12 AS w_adm1_property,
0.10 AS w_structure,
0.04 AS w_population,
0.08 AS w_property_value
),
base_and_range AS (
WITH weights AS (
SELECT
0.8 AS w_structure,
0.4 AS w_population
),
base AS (
SELECT
100.0 - (
(AVG(DISTINCT legatum_prosperity_score) +
AVG(DISTINCT legatum_safety_and_security) +
WITH weights AS (
SELECT
0.18 AS w_adm0_crime,
0.15 AS w_adm1_violent,
0.12 AS w_adm1_property,
0.05 AS w_structure,
0.05 AS w_population,
0.08 AS w_property_value
),
base_and_range AS (
# H3 Cell Report: Oceanside, NY (`882a103169fffff`)
## 📍 1. Spatial Identity
| Field | Value | Explanation |
|-------|-------|-------------|
| `h3` | `882a103169fffff` | Unique H3 index at resolution 8 (approx. 0.74 km² hex). |
| `geom` | GeoJSON Polygon | Boundary of the H3 cell (EPSG:4326). |
| `geom_centroid` | GeoJSON Point | Center of the H3 cell geometry. |
{
"table": "h3_l8_union_cities_urban",
"description": "Hex-level spatial dataset (H3 resolution 8) combining administrative, urban, prosperity, safety, and structure/property data.",
"fields": {
"spatial_identity": [
{
"name": "h3",
"type": "text",
"description": "H3 index at resolution 8 (~0.74 km²)"
},
{
"city": "Budapest",
"country": "Hungary",
"year": 2025,
"safest_neighborhoods": [
{
"name": "Csepel-Királyerdő",
"description": "A residential area in District XXI known for its family-friendly environment and relatively low crime rates.",
"source": "N/A"
},
{
"city": "Budapest",
"country": "Hungary",
"year": 2025,
"safest_neighborhoods": [
{
"name": "Inner Ferencváros (Belső Ferencváros)",
"description": "This area, encompassing Kálvin tér, Corvin-negyed, and the vicinity of Semmelweis University, is known for its safety, modern infrastructure, and vibrant atmosphere. It's popular among students and young professionals.",
"source": "https://www.reddit.com/r/budapest/comments/mo8wwn/what_do_you_think_about_living_in_the_9th_district/"
},