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

Are segments spatially sorted? #228

Open
marklit opened this issue Sep 19, 2024 · 0 comments
Open

Are segments spatially sorted? #228

marklit opened this issue Sep 19, 2024 · 0 comments

Comments

@marklit
Copy link

marklit commented Sep 19, 2024

The bounding boxes of each PQ file seems a bit random and overlap a lot.

$ cd theme=transportation/type=segment
$ ~/duckdb
COPY (
    SELECT SPLIT_PART(filename, '-', 2) as pq_num,
           {min_x: MIN(bbox.xmin),
            min_y: MIN(bbox.ymin),
            max_x: MAX(bbox.xmax),
            max_y: MAX(bbox.ymax)}::BOX_2D::GEOMETRY AS geom,
           ST_AREA(geom) AS area
    FROM READ_PARQUET('*.parquet', filename=true)
    GROUP BY filename
) TO 'pq_bboxes.gpkg'
        WITH (FORMAT GDAL,
              DRIVER 'GPKG',
              LAYER_CREATION_OPTIONS 'WRITE_BBOX=YES');

Below is the 31st segment file from the September release.

qgis-bin_OuFalLWxSd

One point in Riyadh has five bounding boxes overlapping with it.

SELECT   pq_num
FROM     ST_READ('pq_bboxes.gpkg')
WHERE    ST_CONTAINS(geom, ST_POINT(24.7262, 46.70701))
ORDER BY area;
┌─────────┐
│ pq_num  │
│ varchar │
├─────────┤
│ 00046   │
│ 00045   │
│ 00037   │
│ 00047   │
│ 00020   │
└─────────┘
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants