Name | geo-sampling JSON |
Version |
0.2.1
JSON |
| download |
home_page | None |
Summary | Scripts for sampling Geo data sets by the specific region name |
upload_time | 2025-08-31 01:27:59 |
maintainer | None |
docs_url | https://pythonhosted.org/geo-sampling/ |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
geo
street
road
openstreetmap
osm
city
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
|
coveralls test coverage |
No coveralls.
|
Geo sampling: Randomly sample locations on streets
===================================================
.. image:: https://notarypy.soodoku.workers.dev/badge/geo_sampling/0.1.2/geo_sampling-0.1.2-py3-none-any.whl
:target: https://pypi.org/integrity/geo_sampling/0.1.2/geo_sampling-0.1.2-py3-none-any.whl/provenance
.. image:: https://img.shields.io/pypi/v/geo_sampling.svg?maxAge=3600
:target: https://pypi.python.org/pypi/geo_sampling
.. image:: https://readthedocs.org/projects/geo-sampling/badge/?version=latest
:target: http://geo-sampling.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pepy.tech/badge/geo-sampling
:target: https://pepy.tech/project/geo-sampling
Say you want to learn about the average number of potholes per kilometer of street in a city. Or estimate a similar such quantity. To estimate the quantity, you need to sample locations on the streets. This package helps you sample those locations. In particular, the package implements the following sampling strategy:
1. **Sampling Frame**: Get all the streets in the region of interest from `OpenStreetMap <https://www.openstreetmap.org/#map=5/51.500/-0.100>`_. To accomplish that, the package first downloads administrative boundary data for the country in which the region is located in ESRI format from http://www.gadm.org/country The administrative data is in multiple levels, for instance, cities are nested in states, which are nested in countries. The user can choose a city or state, but not a portion of a city. And then the package uses the `pyshp package <https://pypi.python.org/pypi/pyshp>`_ to build a URL for the site http://extract.bbbike.org from which we can download the OSM data.
2. **Sampling Design**:
* For each street (or road), starting from one end of the street, we split the street into .5 km segments till we reach the end of the street. (The last segment, or if the street is shorter than .5km, the only segment, can be shorter than .5 km.)
* Get the lat/long of starting and ending points of each of the segments. And assume that the street is a straight line between the .5 km segment.
* Next, create a database of all the segments
* Sample rows from the database and produce a CSV of the sampled segments
* Plot the lat/long --- filling all the area within the segment. These shaded regions are regions for which data needs to be collected.
3. **Data Collection**: Collect data on the highlighted segments.
Prerequisites
=============
There are a couple dependencies that need to be built from source on Windows so you may need to install `Microsoft Visual C++ Compiler for Python 2.7 <https://www.microsoft.com/en-us/download/details.aspx?id=44266>`_.
Installation
============
Prepare the working directory. We recommend that you install in the Python virtual environment.
::
mkdir geo_sampling
cd geo_sampling
virtualenv -p python2.7 venv
. venv/bin/activate
Upgrade Python packages `pip` and `setuptools` to the latest version.
::
pip install --upgrade pip setuptools
Install geo-sampling package from PyPI.
::
pip install geo-sampling
Documentation
==============
* `More information on installation <docs/install.rst>`_
* `Usage <docs/usage.rst>`_
* `Sample workflow <docs/workflow.rst>`_
For more information please visit the `project documentation page <http://geo-sampling.readthedocs.io/en/latest/>`_.
Downloads
==========
As of February 4th, 2018, the package had been downloaded nearly 5,000 times (see the `saved BigQuery <https://console.cloud.google.com/bigquery?sq=267723140544:c57a4d5f24cd4bc7b8546d04928b5cc5>`__).
Authors
=======
Suriyan Laohaprapanon and Gaurav Sood
License
=======
Scripts are released under the `MIT License <LICENSE>`__.
Raw data
{
"_id": null,
"home_page": null,
"name": "geo-sampling",
"maintainer": null,
"docs_url": "https://pythonhosted.org/geo-sampling/",
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "geo, street, road, openstreetmap, osm, city",
"author": null,
"author_email": "Suriyan Laohaprapanon <suriyant@gmail.com>, Gaurav Sood <gsood07@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c4/9c/9df4e972a2de4b97b69dbc2f8712f8c18970e9ee605f134668befd1791dc/geo_sampling-0.2.1.tar.gz",
"platform": null,
"description": "Geo sampling: Randomly sample locations on streets\n===================================================\n\n\n.. image:: https://notarypy.soodoku.workers.dev/badge/geo_sampling/0.1.2/geo_sampling-0.1.2-py3-none-any.whl\n :target: https://pypi.org/integrity/geo_sampling/0.1.2/geo_sampling-0.1.2-py3-none-any.whl/provenance\n.. image:: https://img.shields.io/pypi/v/geo_sampling.svg?maxAge=3600\n :target: https://pypi.python.org/pypi/geo_sampling\n.. image:: https://readthedocs.org/projects/geo-sampling/badge/?version=latest\n :target: http://geo-sampling.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n.. image:: https://pepy.tech/badge/geo-sampling\n :target: https://pepy.tech/project/geo-sampling\n\nSay you want to learn about the average number of potholes per kilometer of street in a city. Or estimate a similar such quantity. To estimate the quantity, you need to sample locations on the streets. This package helps you sample those locations. In particular, the package implements the following sampling strategy:\n\n1. **Sampling Frame**: Get all the streets in the region of interest from `OpenStreetMap <https://www.openstreetmap.org/#map=5/51.500/-0.100>`_. To accomplish that, the package first downloads administrative boundary data for the country in which the region is located in ESRI format from http://www.gadm.org/country The administrative data is in multiple levels, for instance, cities are nested in states, which are nested in countries. The user can choose a city or state, but not a portion of a city. And then the package uses the `pyshp package <https://pypi.python.org/pypi/pyshp>`_ to build a URL for the site http://extract.bbbike.org from which we can download the OSM data. \n\n2. **Sampling Design**:\n\t\n\t* For each street (or road), starting from one end of the street, we split the street into .5 km segments till we reach the end of the street. (The last segment, or if the street is shorter than .5km, the only segment, can be shorter than .5 km.) \n\n\t* Get the lat/long of starting and ending points of each of the segments. And assume that the street is a straight line between the .5 km segment. \n\n\t* Next, create a database of all the segments \n\n\t* Sample rows from the database and produce a CSV of the sampled segments \n\n\t* Plot the lat/long --- filling all the area within the segment. These shaded regions are regions for which data needs to be collected.\n\n3. **Data Collection**: Collect data on the highlighted segments.\n\nPrerequisites\n=============\n\nThere are a couple dependencies that need to be built from source on Windows so you may need to install `Microsoft Visual C++ Compiler for Python 2.7 <https://www.microsoft.com/en-us/download/details.aspx?id=44266>`_.\n\nInstallation\n============\n\nPrepare the working directory. We recommend that you install in the Python virtual environment.\n\n::\n\n mkdir geo_sampling\n cd geo_sampling\n virtualenv -p python2.7 venv\n . venv/bin/activate\n\nUpgrade Python packages `pip` and `setuptools` to the latest version.\n\n::\n\n pip install --upgrade pip setuptools\n\n\nInstall geo-sampling package from PyPI.\n\n::\n\n pip install geo-sampling\n\n\nDocumentation\n==============\n\n* `More information on installation <docs/install.rst>`_\n* `Usage <docs/usage.rst>`_\n* `Sample workflow <docs/workflow.rst>`_\n\nFor more information please visit the `project documentation page <http://geo-sampling.readthedocs.io/en/latest/>`_.\n\nDownloads\n==========\nAs of February 4th, 2018, the package had been downloaded nearly 5,000 times (see the `saved BigQuery <https://console.cloud.google.com/bigquery?sq=267723140544:c57a4d5f24cd4bc7b8546d04928b5cc5>`__).\n\nAuthors\n=======\n\nSuriyan Laohaprapanon and Gaurav Sood\n\nLicense\n=======\n\nScripts are released under the `MIT License <LICENSE>`__.\n",
"bugtrack_url": null,
"license": null,
"summary": "Scripts for sampling Geo data sets by the specific region name",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/geosensing/geo_sampling",
"Repository": "https://github.com/geosensing/geo_sampling"
},
"split_keywords": [
"geo",
" street",
" road",
" openstreetmap",
" osm",
" city"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f117df251347d1b8f88dab814dcd022702a296b0d5d134cb2d4a63a757fcaafe",
"md5": "ce775ed7f48811d630214142d733f1c6",
"sha256": "4098b700fa286e642e5f7b358c1afd12e76e46c55d049b681f9580e4b137c3e6"
},
"downloads": -1,
"filename": "geo_sampling-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ce775ed7f48811d630214142d733f1c6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 13712,
"upload_time": "2025-08-31T01:27:58",
"upload_time_iso_8601": "2025-08-31T01:27:58.133473Z",
"url": "https://files.pythonhosted.org/packages/f1/17/df251347d1b8f88dab814dcd022702a296b0d5d134cb2d4a63a757fcaafe/geo_sampling-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c49c9df4e972a2de4b97b69dbc2f8712f8c18970e9ee605f134668befd1791dc",
"md5": "ace26e1202976cc4d7f88651a1c20dcf",
"sha256": "e897db6a1363463ad6ff8cc8ce1c0ce35969e3e5a59fccdd897c36c6b44f0403"
},
"downloads": -1,
"filename": "geo_sampling-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "ace26e1202976cc4d7f88651a1c20dcf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 17253,
"upload_time": "2025-08-31T01:27:59",
"upload_time_iso_8601": "2025-08-31T01:27:59.571115Z",
"url": "https://files.pythonhosted.org/packages/c4/9c/9df4e972a2de4b97b69dbc2f8712f8c18970e9ee605f134668befd1791dc/geo_sampling-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 01:27:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "geosensing",
"github_project": "geo_sampling",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"lcname": "geo-sampling"
}