Skip to main content

Introduction

dgsamples is a package of sample image chips and vector files that can be used for unit testing without having to maintain test data in each code base that needs to be tested.

Quick Start

import dgsamples

# The code automatically discovers the data available and puts it on a
# bunch object called samples which can be accessed directly:
dgsamples.allsamples   # This will pretty print the contents of the bunch

# Finer grained access to the samples can be achieved by:
dgsamples.wv2_longmont_1k.files
# The above will produce a path similar to:
# /path/to/dgsampledata/wv2_longmont_1k/...M2AS-053792616010_01_P001.TIL'
# /path/to/dgsampledata/wv2_longmont_1k/...P2AS-053792616010_01_P001.TIL'

# If the samples have a filename_map.PVL file provided, there will also be
# sensor specific shotcuts available in an OrderedBunch object:
dgsamples.wv2_longmont_1k.ms
# The above will produce a path to the sensor .TIL file:
# /path/to/dgsampledata/wv2_longmont_1k/...M2AS-053792616010_01_P001.TIL'

# The .TIL file can be ingested with geoio as:
import geoio
img = geoio.DGImage(dgsamples.wv2_longmont_1k.ms)

# However, these links are to real files on disk and can be read with
# an appropriate application.
from osgeo import gdal
obj = gdal.Open(dgsamples.bayou_chip.extract_test)

# or
import fiona
s = fiona.open(dgsamples.bayou_vectors.poly)

# The sample data can also be retrieved through the "file" bunch key:
dgsamples.bayou_vectors.files
# The above will produce something similar to:
# ['/path/to/dgsampledata/.../extract_test_point.shp',
#  '/path/to/dgsampledata/.../extract_test_poly.shp']

Adding Data Sets

New data can be added directly into the “dgsamples” package and will be dynamically discovered on import. The dynamic discovery code uses the following logic when determining what type of data exists in a directory:

if ".TIL found":
    "return all .TILs and stop"
elif ".TIF found" :
    "return all .TIFs and stop"
elif ".shp or .json found" :
    "return all .shp and .json then stop"

If a file named “filename_map.PVL” is added to a sample directory, the key/ value pairs in the file will be used to map files to an key entry on the returned OrderedBunch object.

If a file named “notes.txt” is present in the sample directory, the content will be added to a “notes” entry on the OrderedBunch object.

Metadata

Release files for dgsamples 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dgsamples 1.1.2
File Size Uploaded Provenance
dgsamples-1.1.2.tar.gz 28.2 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dgsamples 1.1.2
File Interpreter ABI Platform
dgsamples-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 56.5 MB

Release files / dgsamples-1.1.2.tar.gz

Download URL dgsamples-1.1.2.tar.gz
Size 28.2 MB
Tags Source
SHA-256 checksum
How to use checksums
4ec2a806272ac973e9e0905489d0eecec640e26c175d6a4401962902f7c1c16c
BLAKE2b-256 checksum
How to use checksums
b3768c9421d58895e874195444fd949e686121ca2736d3ea071ff9c0d5907e03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / dgsamples-1.1.2-py3-none-any.whl

Download URL dgsamples-1.1.2-py3-none-any.whl
Size 28.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2120e2c27d6b4ee16d8e9f4f37e4081ba596edb108352b78e3877cca47c32302
BLAKE2b-256 checksum
How to use checksums
1e4c26fa375484a40c6b356ec31003c1f242ebd602e4d15ca63ee27178e533e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for dgsamples 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page