Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.17 #43

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/pull_request_template.md

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 72 additions & 1 deletion content/docs/about/overture-maps-examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Overture Maps Examples"
description: "Collection of kepler.gl maps created from Overture Data in BigQuery public dataset using SQL and Dekart."
lead: ""
date: 2024-08-28T07:26:19+02:00
lastmod: 2024-08-28T07:26:19+02:00
lastmod: 2024-09-23T07:26:19+02:00
draft: false
images: ["77dc6f7f-c91c-4099-8dc3-8f043d46cdfb.png"]
menu:
Expand Down Expand Up @@ -183,6 +183,54 @@ ORDER BY total_road_length_km DESC;

{{< try-query-cloud report="eb5b25bf-4c62-44bc-9e69-f0257134e3f8" >}}

### Joining GPS probes with road geometry

{{< img src="8693cbeb-8369-4f38-91a4-5638589998e5.png" cloud="8693cbeb-8369-4f38-91a4-5638589998e5" >}}

```sql
-- Step 1: Generate H3 indexes for road geometries
WITH brandenburg_gate AS (
SELECT ST_GEOGPOINT(13.3777, 52.5163) AS location
),
road_segments AS (
SELECT id, geometry
FROM `bigquery-public-data.overture_maps.segment`
WHERE ST_DISTANCE(geometry, (SELECT location FROM brandenburg_gate)) <= 10000
AND subtype = 'road'
),
road_h3_cells AS (
SELECT id AS road_id,
geometry, -- Include geometry in the result
bqcarto.h3.ST_ASH3(ST_LINEINTERPOLATEPOINT(geometry, ratio), 12) AS h3_index
FROM road_segments,
UNNEST(GENERATE_ARRAY(0, 1, 0.01)) AS ratio -- Generate H3 for road geometries
),

-- Step 2: Generate H3 indexes for dekart-dev.strava.streams points
strava_h3_cells AS (
SELECT bqcarto.h3.LONGLAT_ASH3(lng, lat, 12) AS h3_index, velocity_smooth
FROM `dekart-dev.strava.streams`
WHERE ST_DISTANCE(
ST_GEOGPOINT(lng, lat), (SELECT location FROM brandenburg_gate)
) <= 10000
)

-- Step 3: Join road geometries with strava points based on H3 index
SELECT
r.road_id,
ANY_VALUE(r.geometry) AS geometry, -- Use ANY_VALUE() to select a representative geometry
COUNT(s.h3_index) AS num_strava_points,
AVG(s.velocity_smooth) AS avg_velocity_smooth,
MAX(s.velocity_smooth) AS max_velocity_smooth
FROM road_h3_cells r
LEFT JOIN strava_h3_cells s
ON r.h3_index = s.h3_index
GROUP BY r.road_id;

```
{{< try-query-cloud report="8693cbeb-8369-4f38-91a4-5638589998e5" >}}


## Division Area

The Overture Maps division_area table contains boundary polygons for administrative areas, such as cities, countries, and neighborhoods, along with related attributes like subtype, population, and country codes​.
Expand Down Expand Up @@ -336,3 +384,26 @@ WHERE (p.categories.primary LIKE "%charging%" OR p.categories.primary LIKE "%ev%
AND ST_WITHIN(p.geometry, lv.geometry)
```
{{< try-query-cloud report="72781fb6-8bc5-4c41-839f-66f5bcf7c122" >}}

### UK pubs density

{{< img src="3205a875-b5d7-4458-a0b9-74fdeb49a44b.png" cloud="3205a875-b5d7-4458-a0b9-74fdeb49a44b" >}}

```sql
WITH uk_boundary AS (
SELECT geometry
FROM `bigquery-public-data.overture_maps.division_area`
WHERE LOWER(country) = 'gb' AND subtype = 'country' AND class = 'land'
),
pubs AS (
SELECT p.id, p.geometry, p.names.primary
FROM `bigquery-public-data.overture_maps.place` AS p, uk_boundary
WHERE p.categories.primary = 'pub'
AND ST_WITHIN(p.geometry, uk_boundary.geometry)
)
SELECT bqcarto.h3.ST_ASH3(p.geometry, 8) AS h3_index, COUNT(p.id) AS pub_count
FROM pubs AS p
GROUP BY h3_index
ORDER BY pub_count DESC
```
{{< try-query-cloud report="3205a875-b5d7-4458-a0b9-74fdeb49a44b" >}}
2 changes: 1 addition & 1 deletion content/docs/configuration/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ images: []
|`DEKART_PORT`| *Example*: `8080`|
|`DEKART_POSTGRES_URL` <br><small class="badge badge-info">version &gt;= 0.13</small> | Alternatively to specify `DEKART_POSTGRES_DB`, `DEKART_POSTGRES_HOST`, `DEKART_POSTGRES_PORT`, `DEKART_POSTGRES_USER`, `DEKART_POSTGRES_PASSWORD`, configure PostgreSQL by passing the connection string. If both specified `DEKART_POSTGRES_URL` is used. <br/> *Example*: `postgres://user:pass@hostname:5432/dekart?sslmode=verify-full`|
|`DEKART_DATASOURCE=BQ` <br><small class="badge badge-info">version &gt;= 0.8</small> | Which datasource to use: <br>Values<ul><li>`BQ` BigQuery, default</li><li>`ATHENA` AWS Athena</li><li>`SNOWFLAKE` Snowflake <small class="badge badge-info">version &gt;= 0.12</small></li><li>`PG` Postgres <small class="badge badge-info">version &gt;= 0.16</small></li></ul>|
| `DEKART_STORAGE=GCS` <br><small class="badge badge-info">version &gt;= 0.8</small> | Which storage backend to use for storing queries and query results <br>Values<ul><li>`GCS` Google Cloud Storage, default, works only with BigQuery data source</li><li>`S3` AWS S3, works with BigQuery and AWS Athena</li></ul>|
| `DEKART_STORAGE=GCS` <br><small class="badge badge-info">version &gt;= 0.8</small> | Which storage backend to use for storing queries and query results <br>Values<ul><li>`GCS` Google Cloud Storage, default, works only with BigQuery data source</li><li>`S3` AWS S3, works with BigQuery and AWS Athena</li><li>`SNOWFLAKE` Queries will be cached in Snowflake query result cache. Works only with Snowflake data source. <small class="badge badge-info">version &gt;= 0.17</small></li></ul>|
| `DEKART_CLOUD_STORAGE_BUCKET` | Google Cloud Storage or AWS S3 bucket name where Dekart Query results will be stored. <br> *Example*: `dekart-bucket` <br><br> If value is empty, users will be able to define storage bucket via UI. Supported datasource `DEKART_DATASOURCE`: <ul><li>`BQ` BigQuery from <small class="badge badge-info">version &gt;= 0.15</small></li></ul>|
| `DEKART_CORS_ORIGIN=` <br/><small class="badge badge-info">version &gt;= 0.10</small> | CORS Origin to be allowed by Dekart backend and set in `Access-Control-Allow-Origin` header. If not set or set incorrectly, warning will appear in logs. If set incorrectly. <br> *Example*: `https://dekart.example.com` |

Expand Down
8 changes: 4 additions & 4 deletions content/docs/self-hosting/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ docker run \
-e DEKART_MAPBOX_TOKEN=${DEKART_MAPBOX_TOKEN} \
-e DEKART_CORS_ORIGIN=${DEKART_CORS_ORIGIN} \
-p 8080:8080 \
dekartxyz/dekart:0.16
dekartxyz/dekart:0.17
```

### Google BigQuery
Expand All @@ -66,7 +66,7 @@ docker run \
-e DEKART_MAPBOX_TOKEN=${DEKART_MAPBOX_TOKEN} \
-e DEKART_CORS_ORIGIN=${DEKART_CORS_ORIGIN} \
-p 8080:8080 \
dekartxyz/dekart:0.16
dekartxyz/dekart:0.17
```

### Snowflake
Expand All @@ -90,7 +90,7 @@ docker run -it --rm \
-e DEKART_MAPBOX_TOKEN=${DEKART_MAPBOX_TOKEN} \
-e DEKART_CORS_ORIGIN=${DEKART_CORS_ORIGIN} \
-p 8080:8080 \
dekartxyz/dekart:0.16
dekartxyz/dekart:0.17
```

### PostgreSQL
Expand All @@ -113,7 +113,7 @@ docker run \
-e DEKART_MAPBOX_TOKEN=${DEKART_MAPBOX_TOKEN} \
-e DEKART_CORS_ORIGIN=${DEKART_CORS_ORIGIN} \
-p 8080:8080 \
dekartxyz/dekart:0.16
dekartxyz/dekart:0.17
```


Expand Down
7 changes: 6 additions & 1 deletion content/docs/self-hosting/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ menu:
Before you begin: it is always recommended to back up your Postgres database before upgrading Dekart. On the first run, Dekart applies migrations to the database and you won't be able to downgrade.
</div></p>

For all Docker-based deployments, update the docker tag, for example `dekartxyz/`dekart:0.15` -> `dekartxyz/dekart:0.16`
For all Docker-based deployments, update the docker tag, for example `dekartxyz/`dekart:0.16` -> `dekartxyz/dekart:0.17`

## Migration instructions

**`dekartxyz/dekart:0.16` -> `dekartxyz/dekart:0.17`**
No breaking changes, just update the docker tag. New Postgres migrations will be applied on the first run.

Note, after update private reports will not be available to other users. You need to give access explicitly in new Share dialog.

**`dekartxyz/dekart:0.15` -> `dekartxyz/dekart:0.16`**
No breaking changes, just update the docker tag. New Postgres migrations will be applied on the first run.

Expand Down
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</figure>
</div>
<div class="col-lg-9 col-xl-8 text-center">
<p><a target="_blank" href="https://github.com/dekart-xyz/dekart/releases/tag/v0.16.0">Latest open-source release 0.16.0</a></p>
<p><a target="_blank" href="https://github.com/dekart-xyz/dekart/releases/tag/v0.17.0">Latest open-source release 0.16.0</a></p>
</div>
</div>
</section>
Expand Down
Loading