Skip to main content

Methods for representing geographic coordinates

Project description

latlonconv

A copy of the LatLon package that actually works (and does not depend on pyproj), but has reduced functionality focusing on format conversion only:

Example

import latlonconv as ll

coord1 = ll.LatLon(32.30642, 122.61458)
coord2 = ll.string2latlon("""32.30642° N""", """122.61458° W""", """D%° %H""")
conv1 = coord1.to_string("""d%° %m%' %S%" %H""")
conv2 = coord2.to_string("""d%° %m%' %S%" %H""")

print(conv1)
print(conv2)

Format string syntax

latlonconv.string2latlon and latlonconv.LatLon.to_string both take a formatter string which is loosely modeled on the format keyword used in datetime’s strftime function. Indicator characters (e.g. H or D) are placed between a specific separator character (%) to specify the way in which a coordinate string is formatted. Possible values are as follows:

H is a hemisphere identifier (e.g. N, S, E or W)

D is a coordinate in decimal degrees notation (e.g. 5.833)

d is a coordinate in degrees notation (e.g. 5)

M is a coordinate in decimal minutes notation (e.g. 54.35)

m is a coordinate in minutes notation (e.g. 54)

S is a coordinate in seconds notation (e.g. 28.93)

Any other characters (e.g. ‘ ‘ or ‘, ‘) will be treated as a separator between the above components.

All components should be separated by the % character. For example, if the coord_str is ‘5, 52, 59.88_N’, the format_str would be ‘d%, %m%, %S%_%H’

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

latlonconv-1.0.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

latlonconv-1.0.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file latlonconv-1.0.1.tar.gz.

File metadata

  • Download URL: latlonconv-1.0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for latlonconv-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5eef54e8607d23cb2c847408a526ea3865bf4ee9191bc85b486c5d7e6126a9d6
MD5 086024e641712ea9c957f88e4b73f374
BLAKE2b-256 5cdbf6d3ff1b3b68aa2f2b2e9061e042d4ab3521ca5fe3ab13447c6258b66025

See more details on using hashes here.

File details

Details for the file latlonconv-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: latlonconv-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for latlonconv-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ab0cd1f90611837745921d454cf69937fdf5ad6aee024a0ab52c092f88ba701
MD5 77fda03bc267f810ca828e3bca6dc30d
BLAKE2b-256 fa6fae30fa46eb4587c2f4f2b4f0df0d7c3cab2e493c5a224d8b02c57cc47941

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