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
π» 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
π― 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
π 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
π 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
Singapore Advanced SamplingΒΆ
Input: Singapore Central region
Output: Multiple sampling strategies (random, stratified, filtered)
Files:
singapore_*.csvwith 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:
π§ Working code - Copy-paste ready scripts
π Real outputs - Actual CSV files and plots you can examine
β‘ Both interfaces - Python API and CLI equivalents
π Documentation - Step-by-step explanations
π‘ 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ΒΆ
Change the region: Replace country/region names with your study area
Adjust sample size: Modify
sample_sizeparameters for your needsFilter road types: Use
road_typesparameter to focus on specific infrastructureSet random seed: Use
seedparameter 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 segmentsMetadata: Each example includes sampling methodology details
Ready to dive in? Start with Python API Examples or jump to CLI Usage!