Pixelmonster (PXM) is a service for processing remotely-sensed images and rendering them to raster tiles on the Mapbox platform.
This document describes the PXM manifest file - the interchange format for specifying the source images and processing parameters.
The Manifest file is a JSON file (typically with a .json
extension) described in this specification:
https://github.com/mapbox/pxm-manifest-specification/blob/master/pxm-manifest-spec.md
Example:
{
"sources": [
"s3://my-bucket/20171101/17RLL630825.tif",
"s3://my-bucket/20171101/17RLL675930.tif",
"s3://my-bucket/20171101/17RLL675720.tif",
"s3://my-bucket/20171101/17RLL705780.tif"
],
"info": {
"tilesets": [
"customer1.aerials"
],
"date": "2018",
"license": "cc by-sa 4.0",
"account": "customer1",
"product": "november_aerial_photos",
"notes": "Aerial photos from November 2017, Northern California",
"crs": "EPSG:26910"
}
}
To create a PXM manifest file, read the specification and
-
Create the JSON file manually or with tools of your choice.
-
Use the included command line script,
manifest.py
.
Python 3.6+ is required and it is recommended to use a venv.
pip install -r requirements.txt
python manifest.py --help
And example of its usage would be
# source-list.txt is a line-delimited list of s3 URLs
python manifest.py source-list.txt \
-t accountname.tileset \
--license "CC BY-SA" \
--account accountname \
--product productname \
--date 2018 \
--output render1.json
which would generate the following output;
{
"info": {
"account": "accountname",
"date": "2018",
"license": "CC BY-SA",
"notes": "",
"product": "productname",
"tilesets": [
"accountname.tileset"
]
},
"sources": [
"s3://my-bucket/test.tif"
],
"version": "0.5.1"
}
A more advanced usage would be;
# List files in a AWS S3 bucket and pipe them into the python CLI
aws s3 ls mybucket/mydata/ --recursive | grep -E '.tif$' | awk '{print "s3://mybucket/"$NF}' | python manifest.py \
-t accountname.tileset \
--license "CC BY-SA" \
--account accountname \
--product productname \
--date 2018 \
--output render1.json
PXM manifest uses JSON Schemas to validate manifest files.
The file schemas/pxm-manifest-0.5.1.json
is used to validate the PXM manifest file.
An example of using jsonschema
from the command line is
jsonschema -i render1.json schemas/pxm-manifest-0.5.1.json
Currently, we review the manifest file and run the processing using an internal workflow.
Please contact the sales team and mention PXM cc: team-satellite
.