Skip to main content

GeoFactory

This is a faker provider that generates fake geojson data. It simulates all the different types of features and geometries in the geojson specification. There is also a test suite for the class and it's methods run with pytest.

Setup

Install from source:

pip install git+https://github.com/scook12/geofactory.git@master

OR

pipenv install git+https://github.com/scook12/geofactory.git@master#egg=geofactory

Install with pip:

pip install geofactory-scook

Use

GeoFactory is just an additional community provider for geojson.

An example might look like this:

from faker import Faker

from geofactory import GeoFactory

factory = Faker()

factory.add_provider(GeoFactory)

pt = factory.point()

pt is now a valid geojson Point feature. All methods follow this pattern.

Methods

lnglat

Returns a given number of random longitude/latitude pairs.

point

Returns a single geojson point object with random coordinates

multipoint

Returns a multipoint geojson object with a random number of random points :param: count_limit - determines the maxiumum number of points generated

linestring

Returns a linestring geojson object with a random number of nodes :param: node_limit - determines the maxiumum number of nodes generated

multilinestring

Returns a multilinestring with a random number of segments with a random number of nodes :param: node_limit - determines maximum number of nodes for a given linestring :param: count_limit - determines the maximum number of line segments generated

polygon

Returns a randomly arranged polygon with a specific number of nodes :param: node_limit - determines how many nodes will be in the return polygon

multypolygon

Returns a geojson multipolygon with a specific number of randomly arranged polygons :param: count_limit - determines how many polygons will be created

geometry_collection

Returns a specific number of random geojson geometries as a collection :param: count_limit - determines how many geometries will be generated

feature

Returns a random geojson feature object

feature_collection

Returns a specific number of random features in a feature collection object :param: count_limit - determines how many features will be generated

to_file

Writes geojson object to file :param: path - full path and filename for data to be written to :param: data - valid geojson object to dump in path

Contribute

Open an issue, fork the repo, submit a PR. This is a tiny side project I built to be used while developing an app that ingested geojson, so there aren't a ton of guidelines.

If you make changes to existing methods, be sure to run pytest to make sure they all are still passing. If you write a new method or class, please include some basic pytest cases.

Metadata

Release files for geofactory 0.0.1

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

Source distribution (sdist)

Source distribution for geofactory 0.0.1
File Size Uploaded Provenance Actions
geofactory-0.0.1.tar.gz 3.0 kB Without provenance Details for geofactory-0.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 7.0 kB

Release files / geofactory-0.0.1.tar.gz

Download URL geofactory-0.0.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f546b0f6d912a6a1b3a4ea57cb2c160ed3c8c79e5a8a1d662b34333c419e8ed4
BLAKE2b-256 checksum
How to use checksums
829197d88800e9a2d464d59ae47d3305d28cbedb7cf32610dde034f129188bf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.1.post20191125 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3

Release files / geofactory-0.0.1-py3-none-any.whl

Download URL geofactory-0.0.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18598988eb8de31ee17597bab670bad0ad3b89cba33f5dfa22f2c1194fe52d1e
BLAKE2b-256 checksum
How to use checksums
7ef66637d0e0a4b9c17b8cf34e8892c63e8cfb60b39bcfffd99acc8cce783a0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.1.post20191125 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.3

Security for geofactory 0.0.1

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

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