Skip to content

Instantly share code, notes, and snippets.

@marklit
Last active August 22, 2024 16:58
Show Gist options
  • Save marklit/8e53c52f2725ec75c1a2a918c7ed0437 to your computer and use it in GitHub Desktop.
Save marklit/8e53c52f2725ec75c1a2a918c7ed0437 to your computer and use it in GitHub Desktop.
Pacific Spatial Solutions: Japanese GIS Data

https://beta.source.coop/repositories/pacificspatial/flateau/description/

https://github.com/pacificspatial/flateau/

$ aws s3 --no-sign-request \
         sync \
         --exclude="*" \
         --include="*building_lod0.parquet" \
         s3://flateau/data/plateau \
         plateau

Some areas have been refreshed:

$ find . | grep -i 'yokohama.*building_lod0.*parquet$'
./plateau/2022/buildings/gpqt/14100_yokohama_2022_building_lod0.parquet
./plateau/2022/buildings202312/gpqt/14100_yokohama-shi_2022_building_lod0.parquet
./plateau/2023/parquet/14100_yokohama-shi_2023_building_lod0.parquet
@marklit
Copy link
Author

marklit commented Aug 22, 2024

COPY (
    WITH a AS (
        SELECT h3_latlng_to_cell(st_y(st_centroid(st_geomfromwkb(geom))), st_x(st_centroid(st_geomfromwkb(geom))), 5) h3_val,
               COUNT(*) num_recs
        FROM read_parquet('plateau/2023/parquet/*building_lod0*parquet')
        GROUP BY 1
    )
    SELECT h3_cell_to_boundary_wkt(h3_val)::geometry geom,
           num_recs
    FROM a
    WHERE h3_cell_to_lng(h3_val) > -175
    AND   h3_cell_to_lng(h3_val) < 175
) TO 'plateau.h3.gpkg'
    WITH (FORMAT GDAL,
          DRIVER 'GPKG',
          LAYER_CREATION_OPTIONS 'WRITE_BBOX=YES');
qgis-bin_sRg2GwDznU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment