You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEdatasets
(
id TEXTPRIMARY KEY ,
provider_id TEXT,
category_id TEXT,
data_source_id TEXT,
name TEXT,
description TEXT,
country_iso_code3 TEXT,
language_iso_code3 TEXT,
geography_id TEXT,
CREATETABLEgeographies
(
id TEXTPRIMARY KEY,
provider_id TEXT,
name TEXT,
description TEXT,
country_iso_code3 TEXT,
language_iso_code3 TEXT,
version TEXT,
geom_coverage GEOMETRY, -- admin,quadkey,zipcode...
Where geography_id is a FK.
Given a polygon, we want to be able to select the datasets in the catalog with available data for that region. Something like:
datasets=catalog.datasets(polygon)
The format of the polygon is yet to be defined (but it can be a shapely geometry).
We'd need to query the catalog with a query like this:
SELECT d.*FROM geographies g
LEFT JOIN datasets d
ONg.id=d.geography_idWHERE ST_Intersects(ST_geometryfromtext(local_polygon_wkt, 4326), geom_coverage)
So basically, convert the polygon to a WKT or WKB and perform the spatial intersection to get the list of datasets.
The text was updated successfully, but these errors were encountered:
We have these two entities in the catalog
Where
geography_id
is a FK.Given a polygon, we want to be able to select the datasets in the catalog with available data for that region. Something like:
The format of the polygon is yet to be defined (but it can be a shapely geometry).
We'd need to query the catalog with a query like this:
So basically, convert the polygon to a WKT or WKB and perform the spatial intersection to get the list of datasets.
The text was updated successfully, but these errors were encountered: