Skip to content

Instantly share code, notes, and snippets.

Maxar Open Data GeoParquet STAC Catalog

GeoParquet is an experimental standard for storing geospatial data in the Parquet format. Because Parquet's columnar architecture allow for efficient reads over HTTP it's considered to be an initial attempt at a "Cloud-optimized" vector format.

While it lacks the ability to do optimized spatial reads, since it can filter on a small fraction of a features fields it fits will with storing and querying STAC Items. A STAC Item inherits from GeoJSON so has a spatial component, but also can store a large number of metadata field, many of which may be redundant and rarely useful to query. GeoParquet lets us query for features with simple filter requirements like "all images with a low cloud cover percentage".

The first attempt at converting the full Open Data Catalog to GeoParquet is at:

s3://maxar-opendata/events/maxar-opendata.parquet

--extra-index-url https://packages.ard.maxar.com/
maxar-canvas-grid
click
pyjwt
s3fs
boto3
requests
requests_oauthlib
pydantic
backports.cached-property
@drwelby
drwelby / acini.md
Last active October 16, 2019 22:39

Acini

Grid

Global grid of uniquely identified tiles, 256px x 0.3125m

specs: PDA (default), PD, PA

acini <catid> <file.geojson> generate all Acini tiles intersecting geojson features from cat id

Roadmap - what we want to do
???
Sketch
shaping
Pitch - how we're going to build a piece of it
@drwelby
drwelby / bitbinsort.md
Last active October 8, 2019 15:21
Bitwise binary range tree sorting, a la SBN

The SBN spatial index is some sort of binary range tree. I've been pretty close in reproducing the indexing by using a tree method, where the input bounding box is sorted through a tree structure by alternately comparing min/max coordinate pair against each division.

However, it's always seemed like there would be some faster way to sort features based on looking at individual bits in the binary representation of the coordinate value.

For example, let's say we have a 4 bit index space ( a 16 x 16 grid). We're trying to bin a bounding box with a max coordinate of (11,9) and min of (8,7).

Using the tree method, we would first look at the first split which occurs at an x of 8. Since xmin is equal to or greater than 8 that would sort the bounding box into the right bin. Next we would look at a y value of 8 for the second division. In this case the y value splits the bounding box, so the box cannot be sorted further and remains in the third bin.

We can also do this bitwise. What we first do is reverse the bin

@drwelby
drwelby / info.json
Created July 16, 2019 15:43
TileJSON.io - Canvas Demo
{
"baseLayer": {
"tilejson": "2.2.0",
"name": "base",
"version": "1.0.0",
"scheme": "xyz",
"tiles": [
"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
]
},

canvas.town

Mastodon works like Twitter, but instead of a central server users are on independent instances that can talk to each other.

Let's say every Canvas grid tile is an account on a server called canvas.town. It can post activities, like:

Z40-0df769@canvas.town: WV04 acquired imagery over me, ID 1001212350

It can also take commands if someone sends it a message.

class Point(object):
def __init__(self, x, y):
self.x = float(x)
self.y = float(y)
def square(x):
return x * x
def distance_squared(v, w):
return square(v.x - w.x) + square(v.y - w.y)