Skip to main content

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’

Release files for latlonconv 1.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 latlonconv 1.0.1
File Size Uploaded
latlonconv-1.0.1.tar.gz 5.7 kB Details

Built distribution (wheel)

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

Total release size: 24.4 kB

Release files / latlonconv-1.0.1.tar.gz

Download URL latlonconv-1.0.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5eef54e8607d23cb2c847408a526ea3865bf4ee9191bc85b486c5d7e6126a9d6
BLAKE2b-256 checksum
How to use checksums
5cdbf6d3ff1b3b68aa2f2b2e9061e042d4ab3521ca5fe3ab13447c6258b66025
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / latlonconv-1.0.1-py3-none-any.whl

Download URL latlonconv-1.0.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ab0cd1f90611837745921d454cf69937fdf5ad6aee024a0ab52c092f88ba701
BLAKE2b-256 checksum
How to use checksums
fa6fae30fa46eb4587c2f4f2b4f0df0d7c3cab2e493c5a224d8b02c57cc47941
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

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