# Create a COPC from Virtual Shizuoka (one-liner via Open Data on AWS)
At FOSS4G Japan 2025 I heard Endo-san’s presentation where he mentioned that Virtual Shizuoka’s open data are published on "Open Data on AWS". I wanted to experiment with that dataset and, using a compact one-liner, converted a LAS inside a ZIP on S3 into a COPC (Cloud-Optimized Point Cloud). The produced file `08md8094_org.copc.laz` can be inspected with the COPC viewer at https://viewer.copc.io/.
## Goal
Stream an S3-hosted ZIP, extract an inner LAS/LAZ without saving the entire ZIP, convert to COPC with PDAL, and clean up the temporary file — all in one line.
## One-liner
```bash
SRS=EPSG:6676; AWS_NO_SIGN_REQUEST=YES; S3='s3://virtual-shizuoka/2025/LP/Original/08/MD/80/08MD8094.zip'; INNER='08md8094_org.las'; TMP=$(mktemp /tmp/copc_input.XXXXXX.${INNER##*.}); OUT="${PWD}/${INNER%.*}.copc.laz"; aws s3 cp "$S3" - --no-sign-request | bsdtar -xf - -O "$INNER" > "$TMP" && pdal --verbose 4 pipeline <(printf '{"pipeline":[{"type":"readers.las","filename":"%s","spatialreference":"%s"},{"type":"writers.copc","filename":"%s"}]}' "$TMP" "$SRS" "$OUT") && rm -f "$TMP"
```
What this does (briefly)
- Sets SRS to `EPSG:6676` (JGD2011 Japan Plane Rectangular CS, Zone VIII — appropriate for Shizuoka).
- Streams the ZIP from S3 (anonymous/no-sign request) and extracts only the specified inner LAS (`08md8094_org.las`) into a temporary file.
- Runs a PDAL pipeline (verbose) that reads the LAS, forces the spatial reference, writes a COPC output.
- Removes the temporary LAS after success.
## Notes & gotchas
- bsdtar vs unzip: the command uses `bsdtar` for streaming extraction. If you don't have it, replace the extraction part with `unzip -p - "$INNER" > "$TMP"`.
- PDAL requirements:
- `pdal` must include `writers.copc` in the build. Check with `pdal --drivers | grep -i copc`.
- If the inner file is `.laz`, PDAL must be built with `laz-perf` or `laszip` support.
- Authentication / Requester Pays:
- If the bucket requires requester-pays or authentication, remove `--no-sign-request` and prepend the command with `AWS_PROFILE=yourprofile AWS_REQUEST_PAYER=requester` (or configure your AWS credentials).
- SRS:
- I used `EPSG:6676` (JGD2011 / Japan Plane Rectangular CS VIII). Confirm this is appropriate for your area; change `SRS` if needed. I know JGD2011 should be JGD2025 in near future ;-)
- Performance & reliability:
- The ZIP stream requires HTTP range support from the S3 endpoint and reasonably stable network. For very large LAS/LAZ you may prefer downloading the inner file to local disk explicitly.
- Viewing:
- To inspect the resulting file in the browser, either upload `08md8094_org.copc.laz` to a static hosting endpoint that supports range requests (or S3 with public access) and paste the URL into https://viewer.copc.io/, or upload the file directly to the viewer if supported.
## Example viewer workflow
1. Upload `08md8094_org.copc.laz` to a public S3 bucket or any static host that supports range requests.
2. Open https://viewer.copc.io/ and enter the URL (or upload the file) to visualize.
---
This quick experiment shows how easily open data on AWS can be combined with command-line tools (aws cli, bsdtar/unzip, pdal) to produce cloud-optimized point-cloud assets for web visualization and analysis.