Skip to main content

Python map overlay software to read CNO and CNOB files.

Project description

pycno

Python map overlay software to read CNO and CNOB files. This provides a light-weight interface to add overlays to matplotlib plots. For longitude/latitude plots, no additional prerequisites are required. For projections, see "projection support." This allows for pure python installation with supplemental support if desired.

status

Very early development. Useful light weight mapping library, but interface likely to change until stable.

install

pip install https://github.com/barronh/pycno/archive/main.zip

to-do: add to pypi.

example usage

By default, this adds coasts and countries to the current axes. If the current axes has no other data on it, provide the xlim/ylim keywords to define the extents.

import pycno
import matplotlib.pyplot as plt


cno = pycno.cno(xlim=(-180, 180), ylim=(-90, 90))
cno.draw()
plt.savefig('coasts_countries.png')

Use the cnopath keyword to specify another overlay. If you specify a cnopath you don't have, it will automatically be downloaded from the Panoply Overlay website. For example, cno.draw('MWDB_Coasts_NA_1.cnob') will download a high-resolution version of North American coasts, continents, and states.

projection support

pycno.cno supports the pyproj projections. If you provide proj, then overlays will be converted to the projection space and xlim/ylim will need to be provided in projection space. This should work for most projections, but has only been tested with Lambert Conformal Conic and Polar Stereographic. If you test it with another projection, please post a comment under issues and let us know.

import pycno
import pyproj
import matplotlib.pyplot as plt


proj = pyproj.Proj(
  (
    '+proj=stere +lat_0=90 +lat_ts=45 +lon_0=-98 ' +
    '+x_0=10098000 +y_0=10098000 +R=6370000 +to_meter=108000 ' +
    '+no_defs'
  ),
  preserve_units=True
)
plt.axis('image')
cno = pycno.cno(proj=proj, xlim=(0, 187), ylim=(0, 187))
cno.draw()
plt.savefig('coasts_countries_ps.png')

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

pycno-0.0.2.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file pycno-0.0.2.tar.gz.

File metadata

  • Download URL: pycno-0.0.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

File hashes

Hashes for pycno-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b65ed702fcda14f5221c9fb5f1b7b23f36b6be68c51fc74f4bc47d0e77e01f15
MD5 4d3ef628f3e1315af45306347a976837
BLAKE2b-256 5f61ff8def4dffc9378cca6ac6d633cdb8572f0b785cbfbb007d392ab0ed5689

See more details on using hashes here.

Supported by

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