geojson-faker


Namegeojson-faker JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/impocode/geojson-faker
SummaryGeoJson fake generator.
upload_time2024-06-23 11:36:34
maintainerimpocode
docs_urlNone
authorimpocode
requires_python<4.0.0,>=3.8.1
licenseMIT
keywords geojson
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # geojson-faker

## Description

`geojson-faker` is a fake GeoJson data generator.

## Supported GeoJSON objects

|   GeoJSON object   |    Status   |
|:------------------:|:-----------:|
|      Position      |     done    |
|       Point        |     done    |
|     MultiPoint     |     done    |
|     LineString     |     done    |
|  MultiLineString   |     done    |
|      Polygon       |     done    |
|    MultiPolygon    |     done    |
| GeometryCollection |     done    |
|      Feature       | in progress |
|  FeatureCollection | in progress |

## Usage

To generate fake geodata, you can use both methods and a special class `GeoJsonFaker`.

Example of generation a random `Point` using the `fake_point` method:

```python
>>> from geojson_faker import fake_point, Dimension
>>> # Point2D or Point3D
>>> fake_point()
Point(bbox=None, type='Point', coordinates=Position2D(longitude=-97.30689091127957, latitude=56.891859157037686))
>>> fake_point()
Point(bbox=None, type='Point', coordinates=Position3D(longitude=-23.91579574348077, latitude=-29.49843686198053, altitude=38061.79569985675))
>>> # Point2D
>>> fake_point(dimension=Dimension.two)
Point(bbox=None, type='Point', coordinates=Position2D(longitude=-165.04984397840835, latitude=76.97108937919282))
>>> # Point3D
>>> fake_point(dimension=Dimension.three)
Point(bbox=None, type='Point', coordinates=Position3D(longitude=-118.39348949345089, latitude=27.81106033708747, altitude=8475.464707933897))
```

Example of generation using the class:

```python
>>> from geojson_faker import GeoJsonFaker
>>> geojson_faker = GeoJsonFaker()
>>> # Point2D or Point3D
>>> geojson_faker.point
Point(bbox=None, type='Point', coordinates=Position2D(longitude=-50.56703965217093, latitude=19.72513434718111))
>>> geojson_faker.point
Point(bbox=None, type='Point', coordinates=Position3D(longitude=111.84911865610678, latitude=-19.488979926988165, altitude=7921.968274391678))
>>> # Point2D
>>> geojson_faker.point2d
Point(bbox=None, type='Point', coordinates=Position2D(longitude=29.98434638920918, latitude=36.476444735501616))
>>> # Point3D
>>> geojson_faker.point3d
Point(bbox=None, type='Point', coordinates=Position3D(longitude=-76.36126084558762, latitude=30.682266859380533, altitude=15816.987234147065))
```

The class has some advantages, so I would recommend using it preferably.

### Random always

The `random_always` setting allows you to specify whether to generate random data permanently or to remember the last result and reuse it.

An example with `Point`:

```python
>>> from geojson_faker import GeoJsonFaker
>>> # random_always is True by default
>>> geojson_faker = GeoJsonFaker()
>>> geojson_faker.point
Point(bbox=None, type='Point', coordinates=Position2D(longitude=136.68932246536838, latitude=-69.51345731343906))
>>> geojson_faker.point
Point(bbox=None, type='Point', coordinates=Position3D(longitude=-86.5130499597834, latitude=-32.985220372899015, altitude=39772.673364264505))
>>>
>>> # Set random_always to False
>>> geojson_faker = GeoJsonFaker(random_always=False)
>>> geojson_faker.point
Point(bbox=None, type='Point', coordinates=Position3D(longitude=-124.54510003846121, latitude=25.225529991773328, altitude=-423.45973067919476))
>>> geojson_faker.point
Point(bbox=None, type='Point', coordinates=Position3D(longitude=-124.54510003846121, latitude=25.225529991773328, altitude=-423.45973067919476))
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/impocode/geojson-faker",
    "name": "geojson-faker",
    "maintainer": "impocode",
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.8.1",
    "maintainer_email": "impocode@impocode.one",
    "keywords": "geojson",
    "author": "impocode",
    "author_email": "impocode@impocode.one",
    "download_url": "https://files.pythonhosted.org/packages/63/cf/4ab1c8ed751fd699b5b9add2ec4d62c0390876537178388743849a6568a6/geojson_faker-1.0.0.tar.gz",
    "platform": null,
    "description": "# geojson-faker\n\n## Description\n\n`geojson-faker` is a fake GeoJson data generator.\n\n## Supported GeoJSON objects\n\n|   GeoJSON object   |    Status   |\n|:------------------:|:-----------:|\n|      Position      |     done    |\n|       Point        |     done    |\n|     MultiPoint     |     done    |\n|     LineString     |     done    |\n|  MultiLineString   |     done    |\n|      Polygon       |     done    |\n|    MultiPolygon    |     done    |\n| GeometryCollection |     done    |\n|      Feature       | in progress |\n|  FeatureCollection | in progress |\n\n## Usage\n\nTo generate fake geodata, you can use both methods and a special class `GeoJsonFaker`.\n\nExample of generation a random `Point` using the `fake_point` method:\n\n```python\n>>> from geojson_faker import fake_point, Dimension\n>>> # Point2D or Point3D\n>>> fake_point()\nPoint(bbox=None, type='Point', coordinates=Position2D(longitude=-97.30689091127957, latitude=56.891859157037686))\n>>> fake_point()\nPoint(bbox=None, type='Point', coordinates=Position3D(longitude=-23.91579574348077, latitude=-29.49843686198053, altitude=38061.79569985675))\n>>> # Point2D\n>>> fake_point(dimension=Dimension.two)\nPoint(bbox=None, type='Point', coordinates=Position2D(longitude=-165.04984397840835, latitude=76.97108937919282))\n>>> # Point3D\n>>> fake_point(dimension=Dimension.three)\nPoint(bbox=None, type='Point', coordinates=Position3D(longitude=-118.39348949345089, latitude=27.81106033708747, altitude=8475.464707933897))\n```\n\nExample of generation using the class:\n\n```python\n>>> from geojson_faker import GeoJsonFaker\n>>> geojson_faker = GeoJsonFaker()\n>>> # Point2D or Point3D\n>>> geojson_faker.point\nPoint(bbox=None, type='Point', coordinates=Position2D(longitude=-50.56703965217093, latitude=19.72513434718111))\n>>> geojson_faker.point\nPoint(bbox=None, type='Point', coordinates=Position3D(longitude=111.84911865610678, latitude=-19.488979926988165, altitude=7921.968274391678))\n>>> # Point2D\n>>> geojson_faker.point2d\nPoint(bbox=None, type='Point', coordinates=Position2D(longitude=29.98434638920918, latitude=36.476444735501616))\n>>> # Point3D\n>>> geojson_faker.point3d\nPoint(bbox=None, type='Point', coordinates=Position3D(longitude=-76.36126084558762, latitude=30.682266859380533, altitude=15816.987234147065))\n```\n\nThe class has some advantages, so I would recommend using it preferably.\n\n### Random always\n\nThe `random_always` setting allows you to specify whether to generate random data permanently or to remember the last result and reuse it.\n\nAn example with `Point`:\n\n```python\n>>> from geojson_faker import GeoJsonFaker\n>>> # random_always is True by default\n>>> geojson_faker = GeoJsonFaker()\n>>> geojson_faker.point\nPoint(bbox=None, type='Point', coordinates=Position2D(longitude=136.68932246536838, latitude=-69.51345731343906))\n>>> geojson_faker.point\nPoint(bbox=None, type='Point', coordinates=Position3D(longitude=-86.5130499597834, latitude=-32.985220372899015, altitude=39772.673364264505))\n>>>\n>>> # Set random_always to False\n>>> geojson_faker = GeoJsonFaker(random_always=False)\n>>> geojson_faker.point\nPoint(bbox=None, type='Point', coordinates=Position3D(longitude=-124.54510003846121, latitude=25.225529991773328, altitude=-423.45973067919476))\n>>> geojson_faker.point\nPoint(bbox=None, type='Point', coordinates=Position3D(longitude=-124.54510003846121, latitude=25.225529991773328, altitude=-423.45973067919476))\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "GeoJson fake generator.",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://github.com/impocode/geojson-faker",
        "Homepage": "https://github.com/impocode/geojson-faker",
        "Repository": "https://github.com/impocode/geojson-faker"
    },
    "split_keywords": [
        "geojson"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2147c3cd3ba0938f8b387a36be5c2c7738d42407c29a0ab95d80ddf24803d5b1",
                "md5": "1fe863fd08cf6fecfb62fd3c551f7569",
                "sha256": "ce540bffd13a4576d4d51fe8fcde245fa1082dfccc4ea0d5f537852111441210"
            },
            "downloads": -1,
            "filename": "geojson_faker-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1fe863fd08cf6fecfb62fd3c551f7569",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.8.1",
            "size": 5551,
            "upload_time": "2024-06-23T11:36:32",
            "upload_time_iso_8601": "2024-06-23T11:36:32.097603Z",
            "url": "https://files.pythonhosted.org/packages/21/47/c3cd3ba0938f8b387a36be5c2c7738d42407c29a0ab95d80ddf24803d5b1/geojson_faker-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "63cf4ab1c8ed751fd699b5b9add2ec4d62c0390876537178388743849a6568a6",
                "md5": "21806dfdd40658f38d8045d028bfccdf",
                "sha256": "c674b078a13757e444215b80beab9ecf37684c0021309c44ab52f3fb536fc5bf"
            },
            "downloads": -1,
            "filename": "geojson_faker-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "21806dfdd40658f38d8045d028bfccdf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.8.1",
            "size": 4484,
            "upload_time": "2024-06-23T11:36:34",
            "upload_time_iso_8601": "2024-06-23T11:36:34.265785Z",
            "url": "https://files.pythonhosted.org/packages/63/cf/4ab1c8ed751fd699b5b9add2ec4d62c0390876537178388743849a6568a6/geojson_faker-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-23 11:36:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "impocode",
    "github_project": "geojson-faker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "geojson-faker"
}
        
Elapsed time: 0.27400s