Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Geo Sampling 0.3.1
Geo Sampling 0.3.1
  • Installation
  • Quick Start
  • Examples Gallery
    • Python API Examples
    • Command Line Interface (CLI) Examples
    • Advanced Sampling Strategies
  • API Reference
    • extractor Module
    • sampler Module
    • visualization Module
    • data Module
    • cli Module
Back to top
View this page

Examples GalleryΒΆ

This section provides complete, working examples that demonstrate geo-sampling capabilities. All examples include real data outputs that you can download and examine.

πŸš€ Getting StartedΒΆ

🐍 Python API Examples

Complete Python workflows with actual Delhi road data. Includes 1,220 road segments and 1,000-sample outputs.

Features: Basic extraction, sampling, visualization Data: Delhi, India road network Output: Sample plots and CSV files

Python API Examples

πŸ’» Command Line Usage

Master the geo-sampling CLI with working examples and real command outputs.

Features: All CLI commands with examples Data: Multiple regions and countries Output: Command logs and sample files

Command Line Interface (CLI) Examples

🎯 Advanced Sampling

Sophisticated sampling strategies with Singapore road network examples.

Features: Random, stratified, filtered sampling Data: Singapore Central region (470 segments) Output: Comparison plots and multiple samples

Advanced Sampling Strategies

πŸ“ Download Outputs

All example outputs are available for download. Browse CSV files, plots, and sample data.

Includes: Sample datasets, visualizations, CLI logs Format: CSV, PNG, TXT files Size: Ready-to-use examples

Download Examples

πŸ“Š Live Data ExamplesΒΆ

All examples use real OpenStreetMap data and generate actual outputs that are included with the package:

Delhi Basic WorkflowΒΆ

  • Input: NCT of Delhi administrative boundary

  • Output: 1,220 total road segments β†’ 1,000 random sample

  • Files: delhi_all_roads.csv, delhi_sampled_roads.csv

Singapore Advanced SamplingΒΆ

  • Input: Singapore Central region

  • Output: Multiple sampling strategies (random, stratified, filtered)

  • Files: singapore_*.csv with comparison plots

CLI Command ExamplesΒΆ

  • Input: Various countries and regions

  • Output: Command logs and sample outputs

  • Files: commands_log.txt

πŸ” Code + Data PhilosophyΒΆ

Each example provides:

  1. πŸ”§ Working code - Copy-paste ready scripts

  2. πŸ“ˆ Real outputs - Actual CSV files and plots you can examine

  3. ⚑ Both interfaces - Python API and CLI equivalents

  4. πŸ“‹ Documentation - Step-by-step explanations

Quick NavigationΒΆ

By Interface:

  • Python API Examples - For programmatic usage

  • CLI Examples - For command-line workflows

By Complexity:

  • Basic Workflow - Start here

  • Advanced Sampling - Multiple strategies

  • Custom Integration - Research workflows

πŸ’‘ Tips for Using ExamplesΒΆ

Running Examples LocallyΒΆ

# Clone the repository to get example files
git clone https://github.com/geosensing/geo-sampling.git
cd geo-sampling

# Install with example dependencies
pip install -e .

# Run the basic workflow example
python examples/01_basic_workflow.py

# Try CLI examples
python examples/03_cli_usage.py

Adapting for Your ResearchΒΆ

  1. Change the region: Replace country/region names with your study area

  2. Adjust sample size: Modify sample_size parameters for your needs

  3. Filter road types: Use road_types parameter to focus on specific infrastructure

  4. Set random seed: Use seed parameter for reproducible research

Understanding Output FilesΒΆ

  • *_all_roads.csv: Complete road network for the region

  • *_sample.csv: Random/stratified sample of road segments

  • *_plot.png: Visualization of sampled road segments

  • Metadata: Each example includes sampling methodology details


Ready to dive in? Start with Python API Examples or jump to CLI Usage!

Next
Python API Examples
Previous
Quick Start
Copyright © 2016--2025, Suriyan Laohaprapanon, Gaurav Sood
Made with Sphinx and @pradyunsg's Furo
On this page
  • Examples Gallery
    • πŸš€ Getting Started
    • πŸ“Š Live Data Examples
      • Delhi Basic Workflow
      • Singapore Advanced Sampling
      • CLI Command Examples
    • πŸ” Code + Data Philosophy
    • Quick Navigation
    • πŸ’‘ Tips for Using Examples
      • Running Examples Locally
      • Adapting for Your Research
      • Understanding Output Files