Skip to main content

Add surveyor mathematics easily to your projects.

Project description

Survey Toolbox

Coordinate mathematics and tools for surveyors and game-makers (currently) working in flat plane.

Simple mathematics library for working with coordinates.

License: MIT

Installation

Python:

pip install surveyor-toolbox

Usage example

# Declare some constants.
from surveytoolbox.config import EASTING, NORTHING, ELEVATION

# Import functions.
from surveytoolbox.PointStore import NewPointStore
from surveytoolbox.SurveyPoint import NewSurveyPoint

from surveytoolbox.bdc import bearing_distance_from_coordinates
from surveytoolbox.cbd import coordinates_from_bearing_distance
from surveytoolbox.fmt_dms import format_as_dms

# Start a point store so you can track your points.
pointStore = NewPointStore()

# Create some points and add to point store.
point_1 = NewSurveyPoint("JRR")
pointStore.set_new_point(point_1)

point_2 = NewSurveyPoint("JayArghArgh")
pointStore.set_new_point(point_2)

# Start playing
point_1.set_vertex(
    {
        EASTING: 100,
        NORTHING: 100,
        ELEVATION: 30
    }
)

point_2.set_vertex(
    {
        EASTING: 200,
        NORTHING: 100,
        ELEVATION: 30
    }
)

# Calculate and print the bearing and distance between two points.
target_loc = bearing_distance_from_coordinates(point_1.get_vertex(), point_2.get_vertex())
print(
    f"Bearing: {format_as_dms(target_loc[0])}"
    f"\nDistance (2d): {target_loc[1]}"
    f"\nDistance (3d): {target_loc[2]}"
)

# Create a new point using the provided bearing and distance (it shoudl duplicate point 2)
point_3 = NewSurveyPoint("JRR2110141000")
pointStore.set_new_point(point_3)

point_3.set_vertex(
    coordinates_from_bearing_distance(
        point_1.get_vertex(),
        target_loc[0],
        target_loc[1]
    )
)

current_points = pointStore.get_point_store()
for k, v in current_points.items():
    print(
        f"{current_points[k].get_point_name()}: {current_points[k].get_vertex()}"
    )

Here's a bearing example

from surveytoolbox.config import EASTING, NORTHING, ELEVATION, BEARING

# Import functions

from surveytoolbox.SurveyPoint import NewSurveyPoint
from surveytoolbox.bdc import bearing_distance_from_coordinates
from surveytoolbox.fmt_dms import format_as_dms

point_1 = NewSurveyPoint("JRR")
point_2 = NewSurveyPoint("JayArghArgh")

point_1.set_vertex(
    {
        EASTING: 100,
        NORTHING: 100,
        ELEVATION: 30
    }
)

point_2.set_vertex(
    {
        EASTING: 200,
        NORTHING: 300,
        ELEVATION: 30
    }
)


# Calculate and print the bearing and distance between two points.
target_loc = bearing_distance_from_coordinates(point_1.get_vertex(), point_2.get_vertex())
print(
    target_loc
)

print(format_as_dms(target_loc[BEARING]))

For more examples and usage, please refer to the Wiki.

Development setup

Describe how to install all development dependencies and how to run an automated test-suite of some kind. Potentially do this for multiple platforms.

make install
npm test

Release History

  • 0.0.2
    • Removed python-math... actually doesn't require it (DOH!)
  • 0.0.2
    • Fix python-math import in setup.
  • 0.0.1
    • Work in progress

Meta

Justin – @hopBuddyHop – jayarghargh @ gee mail

Distributed under the MIT license. See MIT LICENCE for more information.

https://github.com/JayArghArgh

Contributing

  1. Fork it (https://github.com/JayArghArgh/surveytoolbox/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

survey-toolbox-0.0.3.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

survey_toolbox-0.0.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file survey-toolbox-0.0.3.tar.gz.

File metadata

  • Download URL: survey-toolbox-0.0.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for survey-toolbox-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5943d7d535ffe13404f9ca5b6e2fb6ffcae1259cd97a83f5ab7400f7cf65fe25
MD5 42825153304fd3605ad4faa00e79147c
BLAKE2b-256 26b1ef0e16fa593d4c96163ace8b3316719f2efd4538701d899968316d959fd6

See more details on using hashes here.

File details

Details for the file survey_toolbox-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: survey_toolbox-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for survey_toolbox-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 eb6287bc5d82c86fb27120e836b415f4423cf125c14ae54bd6e5a9a87589e23b
MD5 019ec27624df7ac3b514e3fb9facd1c3
BLAKE2b-256 8ac1786c945d14c2c643ec050c624f263244b3ba518a58578235219f42047bba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page