pax_global_header 0000666 0000000 0000000 00000000064 14502715416 0014517 g ustar 00root root 0000000 0000000 52 comment=0c5159aab8c32488584ae472b3752203f1005559
pyproj-3.6.1/ 0000775 0000000 0000000 00000000000 14502715416 0013051 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/.all-contributorsrc 0000664 0000000 0000000 00000041434 14502715416 0016710 0 ustar 00root root 0000000 0000000 {
"projectName": "pyproj",
"projectOwner": "pyproj4",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "none",
"contributors": [
{
"login": "jswhit",
"name": "Jeff Whitaker",
"avatar_url": "https://avatars2.githubusercontent.com/u/579593?v=4",
"profile": "https://github.com/jswhit",
"contributions": [
"doc",
"test",
"code",
"example",
"ideas",
"review",
"question",
"maintenance",
"infra",
"bug"
]
},
{
"login": "snowman2",
"name": "Alan D. Snow",
"avatar_url": "https://avatars3.githubusercontent.com/u/8699967?v=4",
"profile": "https://github.com/snowman2",
"contributions": [
"doc",
"test",
"code",
"example",
"maintenance",
"infra",
"ideas",
"review",
"question",
"bug"
]
},
{
"login": "micahcochran",
"name": "Micah Cochran",
"avatar_url": "https://avatars0.githubusercontent.com/u/7433104?v=4",
"profile": "https://github.com/micahcochran",
"contributions": [
"doc",
"test",
"code",
"maintenance",
"infra",
"review",
"question",
"bug"
]
},
{
"login": "jorisvandenbossche",
"name": "Joris Van den Bossche",
"avatar_url": "https://avatars2.githubusercontent.com/u/1020496?v=4",
"profile": "https://jorisvandenbossche.github.io/",
"contributions": [
"doc",
"code",
"ideas",
"review",
"question",
"bug",
"test"
]
},
{
"login": "cjmayo",
"name": "Chris Mayo",
"avatar_url": "https://avatars1.githubusercontent.com/u/921089?v=4",
"profile": "https://github.com/cjmayo",
"contributions": [
"test"
]
},
{
"login": "cffk",
"name": "Charles Karney",
"avatar_url": "https://avatars1.githubusercontent.com/u/2298266?v=4",
"profile": "https://www.petrel.org",
"contributions": [
"code",
"test"
]
},
{
"login": "zippy1981",
"name": "Justin Dearing",
"avatar_url": "https://avatars3.githubusercontent.com/u/146930?v=4",
"profile": "http://www.justaprogrammer.net/profile/justin",
"contributions": [
"infra"
]
},
{
"login": "jdkloe",
"name": "Jos de Kloe",
"avatar_url": "https://avatars3.githubusercontent.com/u/1906112?v=4",
"profile": "https://github.com/jdkloe",
"contributions": [
"code",
"test",
"bug"
]
},
{
"login": "georgeouzou",
"name": "George Ouzounoudis",
"avatar_url": "https://avatars3.githubusercontent.com/u/16732042?v=4",
"profile": "https://github.com/georgeouzou",
"contributions": [
"code",
"ideas"
]
},
{
"login": "djhoese",
"name": "David Hoese",
"avatar_url": "https://avatars3.githubusercontent.com/u/1828519?v=4",
"profile": "https://github.com/djhoese",
"contributions": [
"review",
"ideas",
"platform",
"doc",
"test",
"code"
]
},
{
"login": "mitkin",
"name": "Mikhail Itkin",
"avatar_url": "https://avatars3.githubusercontent.com/u/3927849?v=4",
"profile": "http://mitkin.github.io",
"contributions": [
"code"
]
},
{
"login": "dopplershift",
"name": "Ryan May",
"avatar_url": "https://avatars2.githubusercontent.com/u/221526?v=4",
"profile": "http://dopplershift.github.io",
"contributions": [
"code"
]
},
{
"login": "artttt",
"name": "artttt",
"avatar_url": "https://avatars3.githubusercontent.com/u/4626281?v=4",
"profile": "https://github.com/artttt",
"contributions": [
"ideas"
]
},
{
"login": "ocefpaf",
"name": "Filipe",
"avatar_url": "https://avatars1.githubusercontent.com/u/950575?v=4",
"profile": "http://ocefpaf.github.io/python4oceanographers",
"contributions": [
"infra",
"code",
"platform",
"doc"
]
},
{
"login": "heitorPB",
"name": "Heitor",
"avatar_url": "https://avatars2.githubusercontent.com/u/13461702?v=4",
"profile": "https://github.com/heitorPB",
"contributions": [
"doc"
]
},
{
"login": "sebastic",
"name": "Bas Couwenberg",
"avatar_url": "https://avatars3.githubusercontent.com/u/4605306?v=4",
"profile": "https://github.com/sebastic",
"contributions": [
"code",
"platform",
"test"
]
},
{
"login": "nickeubank",
"name": "Nick Eubank",
"avatar_url": "https://avatars0.githubusercontent.com/u/9683693?v=4",
"profile": "https://github.com/nickeubank",
"contributions": [
"code"
]
},
{
"login": "mdunphy",
"name": "Michael Dunphy",
"avatar_url": "https://avatars3.githubusercontent.com/u/9088426?v=4",
"profile": "https://www.math.uwaterloo.ca/~mdunphy/",
"contributions": [
"doc"
]
},
{
"login": "matthew-brett",
"name": "Matthew Brett",
"avatar_url": "https://avatars2.githubusercontent.com/u/67612?v=4",
"profile": "http://matthew.dynevor.org",
"contributions": [
"infra",
"platform"
]
},
{
"login": "jdemaeyer",
"name": "Jakob de Maeyer ",
"avatar_url": "https://avatars1.githubusercontent.com/u/10531844?v=4",
"profile": "https://naboa.de",
"contributions": [
"code"
]
},
{
"login": "gitter-badger",
"name": "The Gitter Badger",
"avatar_url": "https://avatars2.githubusercontent.com/u/8518239?v=4",
"profile": "https://gitter.im",
"contributions": [
"doc"
]
},
{
"login": "bmwiedemann",
"name": "Bernhard M. Wiedemann",
"avatar_url": "https://avatars3.githubusercontent.com/u/637990?v=4",
"profile": "http://lizards.opensuse.org/author/bmwiedemann/",
"contributions": [
"code"
]
},
{
"login": "ReallyNiceGuy",
"name": "Marco Aurélio da Costa",
"avatar_url": "https://avatars0.githubusercontent.com/u/6545730?v=4",
"profile": "https://github.com/ReallyNiceGuy",
"contributions": [
"code"
]
},
{
"login": "ChrisBarker-NOAA",
"name": "Christopher H. Barker",
"avatar_url": "https://avatars2.githubusercontent.com/u/916576?v=4",
"profile": "https://github.com/ChrisBarker-NOAA",
"contributions": [
"code"
]
},
{
"login": "kbevers",
"name": "Kristian Evers",
"avatar_url": "https://avatars3.githubusercontent.com/u/13132571?v=4",
"profile": "https://evers.dev/",
"contributions": [
"question",
"ideas",
"doc"
]
},
{
"login": "rouault",
"name": "Even Rouault",
"avatar_url": "https://avatars2.githubusercontent.com/u/1192433?v=4",
"profile": "http://www.spatialys.com/en/about/",
"contributions": [
"question"
]
},
{
"login": "cgohlke",
"name": "Christoph Gohlke",
"avatar_url": "https://avatars3.githubusercontent.com/u/483428?v=4",
"profile": "https://github.com/cgohlke",
"contributions": [
"platform",
"question",
"bug",
"test"
]
},
{
"login": "chrrrisw",
"name": "Chris Willoughby",
"avatar_url": "https://avatars0.githubusercontent.com/u/5555320?v=4",
"profile": "https://github.com/chrrrisw",
"contributions": [
"code"
]
},
{
"login": "glostis",
"name": "Guillaume Lostis",
"avatar_url": "https://avatars0.githubusercontent.com/u/25295717?v=4",
"profile": "https://github.com/glostis",
"contributions": [
"doc"
]
},
{
"login": "edpop",
"name": "Eduard Popov",
"avatar_url": "https://avatars3.githubusercontent.com/u/13479292?v=4",
"profile": "https://github.com/edpop",
"contributions": [
"doc"
]
},
{
"login": "jranalli",
"name": "Joe Ranalli",
"avatar_url": "https://avatars2.githubusercontent.com/u/7864460?v=4",
"profile": "http://www.personal.psu.edu/jar339",
"contributions": [
"bug",
"code",
"test"
]
},
{
"login": "gberardinelli",
"name": "Greg Berardinelli",
"avatar_url": "https://avatars0.githubusercontent.com/u/13799588?v=4",
"profile": "https://github.com/gberardinelli",
"contributions": [
"bug",
"code",
"ideas",
"test"
]
},
{
"login": "mraspaud",
"name": "Martin Raspaud",
"avatar_url": "https://avatars1.githubusercontent.com/u/167802?v=4",
"profile": "https://github.com/mraspaud",
"contributions": [
"bug",
"code",
"test",
"ideas"
]
},
{
"login": "mwtoews",
"name": "Mike Taves",
"avatar_url": "https://avatars1.githubusercontent.com/u/895458?v=4",
"profile": "https://sites.google.com/site/mwtoews/",
"contributions": [
"test"
]
},
{
"login": "habi",
"name": "David Haberthür",
"avatar_url": "https://avatars2.githubusercontent.com/u/1651235?v=4",
"profile": "http://davidhaberthür.ch",
"contributions": [
"doc"
]
},
{
"login": "mmodenesi",
"name": "mmodenesi",
"avatar_url": "https://avatars2.githubusercontent.com/u/5569789?v=4",
"profile": "https://github.com/mmodenesi",
"contributions": [
"bug",
"code",
"test"
]
},
{
"login": "jacob-indigo",
"name": "jacob-indigo",
"avatar_url": "https://avatars0.githubusercontent.com/u/48448372?v=4",
"profile": "https://www.indigoag.com/",
"contributions": [
"bug",
"code"
]
},
{
"login": "rahulporuri",
"name": "Poruri Sai Rahul",
"avatar_url": "https://avatars0.githubusercontent.com/u/1926457?v=4",
"profile": "https://rahulporuri.github.io",
"contributions": [
"test"
]
},
{
"login": "underchemist",
"name": "Yann-Sebastien Tremblay-Johnston",
"avatar_url": "https://avatars1.githubusercontent.com/u/5283998?v=4",
"profile": "https://medium.com/@underchemist",
"contributions": [
"doc"
]
},
{
"login": "odidev",
"name": "odidev",
"avatar_url": "https://avatars2.githubusercontent.com/u/40816837?v=4",
"profile": "https://github.com/odidev",
"contributions": [
"platform"
]
},
{
"login": "idanmiara",
"name": "Idan Miara",
"avatar_url": "https://avatars.githubusercontent.com/u/26349741?v=4",
"profile": "https://github.com/idanmiara",
"contributions": [
"code",
"doc",
"example",
"test"
]
},
{
"login": "direvus",
"name": "Brendan Jurd",
"avatar_url": "https://avatars.githubusercontent.com/u/312229?v=4",
"profile": "https://github.com/direvus",
"contributions": [
"doc",
"design"
]
},
{
"login": "bjlittle",
"name": "Bill Little",
"avatar_url": "https://avatars.githubusercontent.com/u/2051656?v=4",
"profile": "https://www.metoffice.gov.uk/",
"contributions": [
"doc"
]
},
{
"login": "gerritholl",
"name": "Gerrit Holl",
"avatar_url": "https://avatars.githubusercontent.com/u/500246?v=4",
"profile": "https://github.com/gerritholl",
"contributions": [
"doc"
]
},
{
"login": "Kirill888",
"name": "Kirill Kouzoubov",
"avatar_url": "https://avatars.githubusercontent.com/u/1428024?v=4",
"profile": "https://github.com/Kirill888",
"contributions": [
"code"
]
},
{
"login": "hemberger",
"name": "Dan Hemberger",
"avatar_url": "https://avatars.githubusercontent.com/u/846186?v=4",
"profile": "https://github.com/hemberger",
"contributions": [
"bug",
"code"
]
},
{
"login": "martinfleis",
"name": "Martin Fleischmann",
"avatar_url": "https://avatars.githubusercontent.com/u/36797143?v=4",
"profile": "https://github.com/martinfleis",
"contributions": [
"bug",
"code",
"test"
]
},
{
"login": "orontee",
"name": "Matthias Meulien",
"avatar_url": "https://avatars.githubusercontent.com/u/2065954?v=4",
"profile": "https://github.com/orontee",
"contributions": [
"code",
"bug"
]
},
{
"login": "iboates",
"name": "Isaac Boates",
"avatar_url": "https://avatars.githubusercontent.com/u/13814358?v=4",
"profile": "https://github.com/iboates",
"contributions": [
"code",
"bug",
"test"
]
},
{
"login": "kdpenner",
"name": "Kyle Penner",
"avatar_url": "https://avatars.githubusercontent.com/u/9297904?v=4",
"profile": "https://github.com/kdpenner",
"contributions": [
"code",
"bug",
"doc"
]
},
{
"login": "paulcochrane",
"name": "paulcochrane",
"avatar_url": "https://avatars.githubusercontent.com/u/18310598?v=4",
"profile": "https://github.com/paulcochrane",
"contributions": [
"code",
"doc",
"test",
"bug"
]
},
{
"login": "vot4anto",
"name": "Antonio Ettorre",
"avatar_url": "https://avatars.githubusercontent.com/u/56338190?v=4",
"profile": "https://github.com/vot4anto",
"contributions": [
"platform"
]
},
{
"login": "DWesl",
"name": "DWesl",
"avatar_url": "https://avatars.githubusercontent.com/u/22566757?v=4",
"profile": "https://github.com/DWesl",
"contributions": [
"code"
]
},
{
"login": "molinav",
"name": "Víctor Molina García",
"avatar_url": "https://avatars.githubusercontent.com/u/9979942?v=4",
"profile": "https://github.com/molinav",
"contributions": [
"platform"
]
},
{
"login": "skogler",
"name": "Samuel Kogler",
"avatar_url": "https://avatars.githubusercontent.com/u/1032405?v=4",
"profile": "https://github.com/skogler",
"contributions": [
"bug",
"code"
]
},
{
"login": "shadchin",
"name": "Alexander Shadchin",
"avatar_url": "https://avatars.githubusercontent.com/u/61256?v=4",
"profile": "https://github.com/shadchin",
"contributions": [
"bug",
"code"
]
},
{
"login": "greglucas",
"name": "Greg Lucas",
"avatar_url": "https://avatars.githubusercontent.com/u/12417828?v=4",
"profile": "https://github.com/greglucas",
"contributions": [
"code",
"ideas"
]
},
{
"login": "dmahr1",
"name": "Dan Mahr",
"avatar_url": "https://avatars.githubusercontent.com/u/8354515?v=4",
"profile": "https://github.com/dmahr1",
"contributions": [
"code",
"doc",
"test"
]
},
{
"login": "rhugonnet",
"name": "Romain Hugonnet",
"avatar_url": "https://avatars.githubusercontent.com/u/28896516?v=4",
"profile": "https://github.com/rhugonnet",
"contributions": [
"code",
"doc",
"test"
]
},
{
"login": "jjimenezshaw",
"name": "Javier Jimenez Shaw",
"avatar_url": "https://avatars.githubusercontent.com/u/15678366?v=4",
"profile": "https://javier.jimenezshaw.com/",
"contributions": [
"code",
"doc",
"test"
]
},
{
"login": "djm93dev",
"name": "Daniel McDonald",
"avatar_url": "https://avatars.githubusercontent.com/u/101536185?v=4",
"profile": "https://github.com/djm93dev",
"contributions": [
"doc"
]
},
{
"login": "cyschneck",
"name": "Cora Schneck",
"avatar_url": "https://avatars.githubusercontent.com/u/22159116?v=4",
"profile": "https://cyschneck.com/",
"contributions": [
"doc"
]
},
{
"login": "zanejgr",
"name": "zanejgr",
"avatar_url": "https://avatars.githubusercontent.com/u/14795919?v=4",
"profile": "https://github.com/zanejgr",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7
}
pyproj-3.6.1/.cirrus.yml 0000664 0000000 0000000 00000002642 14502715416 0015165 0 ustar 00root root 0000000 0000000 build_and_store_wheels: &BUILD_AND_STORE_WHEELS
install_cibuildwheel_script:
- python -m pip install cibuildwheel==2.16
run_cibuildwheel_script:
- cibuildwheel
wheels_artifacts:
path: "wheelhouse/*"
macos_task:
skip: $CIRRUS_BRANCH =~ 'pull/.*'
name: Build macOS arm64 wheels.
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode
env:
PATH: /opt/homebrew/opt/python@3.10/bin:$PATH
CIBW_SKIP: "*musllinux* pp*"
CIBW_ARCHS_MACOS: arm64
CIBW_ENVIRONMENT_MACOS:
PROJ_WHEEL=true
PROJ_NETWORK=ON
PROJ_VERSION=9.3.0
PROJ_DIR=${CIRRUS_WORKING_DIR}/pyproj/proj_dir
BUILD_PREFIX=${CIRRUS_WORKING_DIR}/build/
MACOSX_DEPLOYMENT_TARGET=10.9
CMAKE_OSX_ARCHITECTURES='arm64'
LDFLAGS="${LDFLAGS} -Wl,-rpath,${CIRRUS_WORKING_DIR}/pyproj/proj_dir/lib"
CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh
CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true"
CIBW_BEFORE_TEST: python -m pip install shapely pandas xarray || echo "Optional requirements install failed"
CIBW_TEST_COMMAND: >
pyproj -v &&
python -c "import pyproj; pyproj.Proj(init='epsg:4269')" &&
cp -r {package}/test . &&
python -m pytest test -v -s
install_pre_requirements_script:
- brew install python@3.10
- ln -s python3 /opt/homebrew/opt/python@3.10/bin/python
<<: *BUILD_AND_STORE_WHEELS
pyproj-3.6.1/.coveragerc 0000664 0000000 0000000 00000000165 14502715416 0015174 0 ustar 00root root 0000000 0000000 [run]
plugins = Cython.Coverage
[report]
# number of decimal points to report for coverage percentage
precision = 2
pyproj-3.6.1/.flake8 0000664 0000000 0000000 00000000532 14502715416 0014224 0 ustar 00root root 0000000 0000000 [flake8]
max-line-length = 88
ignore =
# Unnecessary dict/list/tuple call - rewrite as a literal
C408
# whitespace before ':' - doesn't work well with black
E203
# missing whitespace around operator - let black worry about that
E225
# line break occurred before a binary operator - let black worry about that
W503
pyproj-3.6.1/.github/ 0000775 0000000 0000000 00000000000 14502715416 0014411 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 14502715416 0016574 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/.github/ISSUE_TEMPLATE/bug_report.md 0000664 0000000 0000000 00000003151 14502715416 0021266 0 ustar 00root root 0000000 0000000 ---
name: Bug report
about: Create a report to help us improve
labels: bug
---
#### Code Sample, a copy-pastable example if possible
A "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you:
http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
```python
# Your code here
```
#### Problem description
[this should explain **why** the current behavior is a problem and why the expected output is a better solution.]
#### Expected Output
#### Environment Information
- Output from: `pyproj -v`
- Output from: `python -m pyproj -v`
- Output from: `python -c "import pyproj; pyproj.show_versions()"`
- pyproj version (`python -c "import pyproj; print(pyproj.__version__)"`)
- PROJ version (`python -c "import pyproj; print(pyproj.proj_version_str)"`)
- PROJ data directory (`python -c "import pyproj; print(pyproj.datadir.get_data_dir())"`)
- Python version (`python -c "import sys; print(sys.version.replace('\n', ' '))"`)
- Operation System Information (`python -c "import platform; print(platform.platform())"`)
#### Installation method
- conda, pip wheel, from source, etc...
#### Conda environment information (if you installed with conda):
Environment (conda list):
```
$ conda list proj
```
Details about conda and system ( conda info ):
```
$ conda info
```
pyproj-3.6.1/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000567 14502715416 0020574 0 ustar 00root root 0000000 0000000 contact_links:
- name: Ask questions
url: https://github.com/pyproj4/pyproj/discussions
about: Please ask and answer questions here.
- name: Ask questions from the GIS community
url: https://gis.stackexchange.com/questions/tagged/pyproj
about: To get answers from questions in the GIS commminuty, please ask and answer questions here with the pyproj tag.
pyproj-3.6.1/.github/ISSUE_TEMPLATE/feature_request.md 0000664 0000000 0000000 00000000310 14502715416 0022313 0 ustar 00root root 0000000 0000000 ---
name: Feature request
about: Suggest an idea for this project
labels: proposal
---
pyproj-3.6.1/.github/ISSUE_TEMPLATE/installation_issues.md 0000664 0000000 0000000 00000001372 14502715416 0023215 0 ustar 00root root 0000000 0000000 ---
name: Installation issues
about: Issues installing pyproj (http://pyproj4.github.io/pyproj/stable/installation.html)
labels: installation-issues
---
#### Installation method/steps
- Installation method (conda, pip wheel, from source, etc...)
- How did you install PROJ? Where is it installed?
- Please provide all commands/steps you used to install pyproj and PROJ.
#### Environment Information
- pyproj version you are attempting to install
- PROJ version (Execute `proj` command and give version here.)
- Python version (`python -c "import sys; print(sys.version.replace('\n', ' '))"`)
- Operation System Information (`python -c "import platform; print(platform.platform())"`)
pyproj-3.6.1/.github/PULL_REQUEST_TEMPLATE.md 0000664 0000000 0000000 00000000322 14502715416 0020207 0 ustar 00root root 0000000 0000000
- [ ] Closes #xxxx
- [ ] Tests added
- [ ] Fully documented, including `history.rst` for all changes and `api/*.rst` for new API
pyproj-3.6.1/.github/dependabot.yml 0000664 0000000 0000000 00000000332 14502715416 0017237 0 ustar 00root root 0000000 0000000 version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
pyproj-3.6.1/.github/workflows/ 0000775 0000000 0000000 00000000000 14502715416 0016446 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/.github/workflows/build_docs.yaml 0000664 0000000 0000000 00000002767 14502715416 0021455 0 ustar 00root root 0000000 0000000 name: Publish Docs
on:
push:
branches: [ main ]
release:
types: [ created ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
docs:
name: Publish Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
python-version: 3.9
conda-channels: conda-forge
- name: Install and Build
shell: bash
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n docs python=3.9 cython proj
source activate docs
python -m pip install -e .
python -m pip install -r requirements-docs.txt
sphinx-build -b html docs/ docs/_build/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.event_name == 'release' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/_build/
clean: false
target-folder: ${{ github.ref }}
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.event_name == 'push' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/_build/
clean: false
target-folder: latest
pyproj-3.6.1/.github/workflows/release.yaml 0000664 0000000 0000000 00000013566 14502715416 0020765 0 ustar 00root root 0000000 0000000 name: Wheels & sdist
on:
push:
branches: [ main ]
release:
types: [ created ]
pull_request: # also build on PRs touching this file
paths:
- ".github/workflows/release.yaml"
- "ci/proj-compile-wheels.sh"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
PROJ_VERSION: "9.3.0"
DEBIAN_FRONTEND: noninteractive
jobs:
make_sdist:
name: Make sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
conda-channels: conda-forge
- name: Make sdist
shell: bash
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n sdist_env build twine cython proj=${{ env.PROJ_VERSION }}
source activate sdist_env
python -m build --sdist
- name: Check packages
shell: bash
run: |
source activate sdist_env
twine check --strict dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz
retention-days: 5
build_wheels:
name: Build ${{ matrix.arch }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
arch: x86_64
# - os: ubuntu-22.04
# arch: i686
- os: macos-11
arch: x86_64
cmake_osx_architectures: x86_64
# - os: macos-11
# arch: arm64
# cmake_osx_architectures: arm64
# - os: macos-11
# arch: universal2
# cmake_osx_architectures: "x86_64;arm64"
- os: "windows-2022"
arch: "auto64"
triplet: "x64-windows"
vcpkg_cache: "c:\\vcpkg\\installed"
vcpkg_logs: "c:\\vcpkg\\buildtrees\\**\\*.log"
- os: "windows-2022"
arch: "auto32"
triplet: "x86-windows"
vcpkg_cache: "c:\\vcpkg\\installed"
vcpkg_logs: "c:\\vcpkg\\buildtrees\\**\\*.log"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- name: Setup MSVC (32-bit)
if: ${{ matrix.triplet == 'x86-windows' }}
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
with:
architecture: 'x86'
- name: Cache vcpkg
if: contains(matrix.os, 'windows')
uses: actions/cache@v3
id: vcpkgcache
with:
path: |
${{ matrix.vcpkg_cache }}
# bump the last digit to avoid using previous build cache
key: ${{ matrix.os }}-${{ matrix.triplet }}-vcpkg-proj${{ env.PROJ_VERSION }}-cache0
- name: Install PROJ with vcpkg
if: contains(matrix.os, 'windows')
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
shell: bash
run: |
cd "$VCPKG_INSTALLATION_ROOT"
git pull > nul
./bootstrap-vcpkg.bat -disableMetrics
vcpkg install --feature-flags="versions,manifests" --x-manifest-root=${GITHUB_WORKSPACE}/ci --x-install-root=$VCPKG_INSTALLATION_ROOT/installed
mkdir -p ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj
cp "$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/share/proj/"* ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj/
- name: Build wheels
uses: pypa/cibuildwheel@v2.16
env:
CIBW_SKIP: "*musllinux* pp*-win* pp31*"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_LINUX:
PROJ_WHEEL=true
PROJ_NETWORK=ON
PROJ_VERSION=${{ env.PROJ_VERSION }}
PROJ_DIR=/project/pyproj/proj_dir
CIBW_ENVIRONMENT_MACOS:
PROJ_WHEEL=true
PROJ_NETWORK=ON
PROJ_VERSION=${{ env.PROJ_VERSION }}
PROJ_DIR=${GITHUB_WORKSPACE}/pyproj/proj_dir
MACOSX_DEPLOYMENT_TARGET=10.9
CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}'
LDFLAGS="${LDFLAGS} -Wl,-rpath,${GITHUB_WORKSPACE}/pyproj/proj_dir/lib"
CIBW_ENVIRONMENT_WINDOWS:
PROJ_WHEEL=true
PROJ_NETWORK=ON
PROJ_VERSION=${{ env.PROJ_VERSION }}
PROJ_DIR=$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}
CIBW_BEFORE_BUILD_WINDOWS: "python -m pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}"
CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh
CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh
CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true"
CIBW_BEFORE_TEST: python -m pip install shapely pandas xarray || echo "Optional requirements install failed"
CIBW_TEST_COMMAND: >
pyproj -v &&
python -c "import pyproj; pyproj.Proj(init='epsg:4269')" &&
cp -r {package}/test . &&
python -m pytest test -v -s
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
retention-days: 5
publish:
name: Publish on PyPI
needs: [make_sdist,build_wheels]
runs-on: ubuntu-latest
# release on every tag
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Upload Wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
# repository_url: https://test.pypi.org/legacy/ # To test
pyproj-3.6.1/.github/workflows/test_proj_latest.yaml 0000664 0000000 0000000 00000003675 14502715416 0022732 0 ustar 00root root 0000000 0000000 name: Test PROJ Latest
on:
push:
branches: [ main ]
schedule:
- cron: '0 0 * * 0'
pull_request: # also build on PRs touching this file
paths:
- ".github/workflows/test_proj_latest.yaml"
- "ci/proj-compile.sh"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
DEBIAN_FRONTEND: noninteractive
jobs:
test_proj_latest:
name: PROJ Latest
runs-on: ubuntu-latest
env:
PYPROJ_FULL_COVERAGE: YES
PROJ_DIR: ${{ github.workspace }}/proj_install
PROJ_DATA: ${{ github.workspace }}/proj_install/share/proj
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install PROJ
shell: bash
run: |
sudo apt-get update
sudo apt-get install -qq sqlite3 libsqlite3-dev libtiff-dev libcurl4-openssl-dev cmake
bash ci/proj-compile.sh git
- name: Install and Log Environment
shell: bash
run: |
python -V
python -m pip install cython
python -m pip install -e .
python -m pip install -r requirements-test.txt
pyproj -v
- name: Test
shell: bash
run: |
python -m pytest --cov-report term-missing --cov=pyproj --cov-report xml
- name: Test Network
shell: bash
env:
PROJ_NETWORK: ON
run: |
python -m pytest
- name: Test Global Context
shell: bash
env:
PYPROJ_GLOBAL_CONTEXT: ON
run: |
python -m pytest
- name: Test Network & Global Context
shell: bash
env:
PROJ_NETWORK: ON
PYPROJ_GLOBAL_CONTEXT: ON
run: |
python -m pytest
- name: Test Grids
shell: bash
run: |
$PROJ_DIR/bin/projsync --quiet --bbox -175,0,-50,85
python -m pytest
pyproj-3.6.1/.github/workflows/tests.yaml 0000664 0000000 0000000 00000015722 14502715416 0020503 0 ustar 00root root 0000000 0000000 name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 0'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
PYPROJ_FULL_COVERAGE: YES
DEBIAN_FRONTEND: noninteractive
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: pre-commit/action@v3.0.0
- name: Install mypy
run: |
python -m pip install mypy types-certifi
- name: mypy
run: |
mypy pyproj
docker_tests:
needs: linting
runs-on: ubuntu-latest
name: Docker | python=${{ matrix.python-version }} | PROJ=${{ matrix.proj-version }}
container: ghcr.io/osgeo/proj:${{ matrix.proj-version }}
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
proj-version: ['9.3.0']
include:
- python-version: '3.9'
proj-version: '9.2.1'
- python-version: '3.9'
proj-version: '9.1.1'
- python-version: '3.9'
proj-version: '9.1.0'
- python-version: '3.9'
proj-version: '9.0.1'
steps:
- uses: actions/checkout@v4
- name: Update
run: |
apt-get update
apt-get -y install software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update
- name: Set up Python ${{ matrix.python-version }}
run: |
apt-get install -y --no-install-recommends \
python${{ matrix.python-version }} \
python${{ matrix.python-version }}-dev \
python${{ matrix.python-version }}-venv \
python3-pip \
g++
- name: Install dependencies
run: |
python${{ matrix.python-version }} -m venv testenv
. testenv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install -e .
python -m pip install -r requirements-test.txt
- name: Test
shell: bash
run: |
. testenv/bin/activate
python -m pytest --cov-report term-missing --cov=pyproj --cov-report xml
- name: Test Network
shell: bash
env:
PROJ_NETWORK: ON
run: |
. testenv/bin/activate
python -m pytest
- name: Test Global Context
shell: bash
env:
PYPROJ_GLOBAL_CONTEXT: ON
run: |
. testenv/bin/activate
python -m pytest
- name: Test Network & Global Context
shell: bash
env:
PROJ_NETWORK: ON
PYPROJ_GLOBAL_CONTEXT: ON
run: |
. testenv/bin/activate
python -m pytest
- name: Test Grids
shell: bash
run: |
. testenv/bin/activate
projsync --quiet --bbox -175,0,-50,85
python -m pytest
conda_tests:
needs: linting
name: Conda ${{ matrix.os }} | ${{ matrix.python-implementation }}=${{ matrix.python-version }} | PROJ=${{ matrix.proj-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
python-implementation: [python]
proj-version: ['*']
include:
- os: ubuntu-latest
python-version: '*'
python-implementation: pypy
proj-version: '*'
- os: ubuntu-latest
python-version: '*'
python-implementation: python
proj-version: '9.1.1'
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
conda-channels: conda-forge
- name: Install Env
shell: bash
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
export INSTALL_DEPS='${{ matrix.python-implementation }}=${{ matrix.python-version }} cython proj=${{ matrix.proj-version }} numpy'
if [ "${{ matrix.os }}" = "macos-latest" -a "${{ matrix.python-version }}" = "3.10" ]; then
sed -i.bak '/shapely/d' requirements-test.txt;
else
export INSTALL_DEPS="${INSTALL_DEPS} shapely";
fi;
if [ "${{ matrix.python-implementation }}" = "pypy" ]; then
sed -i.bak '/xarray/d' requirements-test.txt;
sed -i.bak '/pandas/d' requirements-test.txt;
else
export INSTALL_DEPS="${INSTALL_DEPS} xarray pandas";
fi;
conda create -n test $INSTALL_DEPS
source activate test
python -m pip install -e .
python -m pip install -r requirements-test.txt
- name: Check and Log Environment
shell: bash
run: |
source activate test
python -V
pyproj -v
conda info
- name: Install pylint
shell: bash
if: matrix.python-implementation == 'python'
run: |
source activate test
python -m pip install pylint
- name: pylint
shell: bash
if: matrix.python-implementation == 'python'
run: |
source activate test
pylint pyproj
- name: Test with Coverage
shell: bash
if: matrix.python-implementation == 'python'
run: |
source activate test
python -m pytest --cov-report term-missing --cov=pyproj --cov-report xml
- name: Test
shell: bash
if: matrix.python-implementation == 'pypy'
env:
PROJ_NETWORK: OFF
run: |
source activate test
python -m pytest
- name: Test Network
shell: bash
env:
PROJ_NETWORK: ON
run: |
source activate test
python -m pytest
- name: Test Global Context
shell: bash
env:
PROJ_NETWORK: OFF
PYPROJ_GLOBAL_CONTEXT: ON
run: |
source activate test
python -m pytest
- name: Test Network & Global Context
shell: bash
env:
PROJ_NETWORK: ON
PYPROJ_GLOBAL_CONTEXT: ON
run: |
source activate test
python -m pytest
- name: Test Grids
shell: bash
env:
PROJ_NETWORK: OFF
run: |
source activate test
projsync --quiet --bbox -175,0,-50,85
python -m pytest
- name: Test Build docs
shell: bash
if: contains(matrix.os, 'ubuntu') && matrix.python-implementation == 'python'
run: |
source activate test
python -m pip install -r requirements-docs.txt
sphinx-build -b html docs/ docs/_build/
sphinx-build -b man docs/ docs/_build/
- uses: codecov/codecov-action@v3
pyproj-3.6.1/.gitignore 0000664 0000000 0000000 00000002456 14502715416 0015050 0 ustar 00root root 0000000 0000000 pyproj/proj_dir/
pyproj/*.c
pyproj/*/*.c
pyproj/*/*.html
pyproj/*.html
proj-*/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
wheelhouse/
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# dotenv
.env
# virtualenv
.venv
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# pycharm
.idea/
# pytest
.pytest_cache/
# vscode
.vscode/
pyproj-3.6.1/.isort.cfg 0000664 0000000 0000000 00000000067 14502715416 0014753 0 ustar 00root root 0000000 0000000 [settings]
known_first_party=pyproj,test
profile=black
pyproj-3.6.1/.pre-commit-config.yaml 0000664 0000000 0000000 00000001703 14502715416 0017333 0 ustar 00root root 0000000 0000000 repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
args: [setup.py, pyproj/, test/, docs/]
- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
args: [--skip-errors]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-comprehensions>=3.1.0]
- id: flake8
name: flake8-pyx
files: \.(pyx|pxd)$
types:
- file
args: [--append-config=flake8/cython.cfg]
pyproj-3.6.1/.pylintrc 0000664 0000000 0000000 00000001240 14502715416 0014713 0 ustar 00root root 0000000 0000000 [MASTER]
extension-pkg-whitelist=pyproj._crs,
pyproj._transformer,
pyproj._sync,
pyproj._network,
pyproj._geod,
pyproj._datadir,
pyproj._compat,
pyproj.database,
pyproj.list
[MESSAGES CONTROL]
disable=cyclic-import,
duplicate-code,
line-too-long,
logging-fstring-interpolation,
protected-access,
too-few-public-methods,
too-many-arguments,
too-many-locals,
too-many-public-methods
[FORMAT]
max-module-lines=1500
pyproj-3.6.1/.stickler.yml 0000664 0000000 0000000 00000000137 14502715416 0015473 0 ustar 00root root 0000000 0000000 linters:
black:
config: ./pyproject.toml
flake8:
python: 3
max-line-length: 88
pyproj-3.6.1/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000006400 14502715416 0015650 0 ustar 00root root 0000000 0000000 # Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
pyproj-3.6.1/CONTRIBUTING.md 0000664 0000000 0000000 00000033260 14502715416 0015306 0 ustar 00root root 0000000 0000000 # Contributors Guide
Based on the guide from: https://github.com/Unidata/MetPy
Interested in helping build pyproj? Have code from your research that you believe others will find useful? Have a few minutes to tackle an issue? In this guide we will get you setup and integrated into contributing to pyproj!
## Introduction
First off, thank you for considering contributing to pyproj. pyproj is community-driven
project. It's people like you that make pyproj useful and successful. There are many ways
to contribute, from writing tutorials or examples, improvements to the documentation,
submitting bug reports and feature requests, or even writing code which can be incorporated into pyproj for everyone to use.
Following these guidelines helps to communicate that you respect the time of the
developers managing and developing this open source project. In return, they
should reciprocate that respect in addressing your issue, assessing changes, and
helping you finalize your pull requests.
So, please take a few minutes to read through this guide and get setup for success with your pyproj contributions. We're glad you're here!
## What Can I Do?
* Tackle any [issues](https://github.com/pyproj4/pyproj/issues) you wish! We have a special
label for issues that beginners might want to try. Have a look at our
[current beginner issues](https://github.com/pyproj4/pyproj/issues?q=is%3Aopen+is%3Aissue+label%3Agood-first-issue).
Also have a look at if the issue is already assigned to someone - this helps us make sure that work is not duplicated if the issue is already being worked on by someone else.
* Contribute code you already have. It does not need to be perfect! We will help you clean
things up, test it, etc.
* Make a tutorial or example of how to do something.
* Improve documentation of a feature you found troublesome.
* File a new issue if you run into problems!
## Ground Rules
The goal is to maintain a diverse community that's pleasant for everyone. Please
be considerate and respectful of others by following our
[code of conduct](https://github.com/pyproj4/pyproj/blob/main/CODE_OF_CONDUCT.md).
Other items:
* Each pull request should consist of a logical collection of changes. You can
include multiple bug fixes in a single pull request, but they should be related.
For unrelated changes, please submit multiple pull requests.
* Do not commit changes to files that are irrelevant to your feature or bugfix
(eg: .gitignore).
* Be willing to accept criticism and work on improving your code; we don't want
to break other users' code, so care must be taken not to introduce bugs.
* Be aware that the pull request review process is not immediate, and is
generally proportional to the size of the pull request.
## Reporting a bug
The easiest way to get involved is to report issues you encounter when using pyproj or by
requesting something you think is missing.
* Head over to the [issues](https://github.com/pyproj4/pyproj/issues) page.
* Search to see if your issue already exists or has even been solved previously.
* If you indeed have a new issue or request, click the "New Issue" button.
* Fill in as much of the issue template as is relevant. Please be as specific as possible.
Include the version of the code you were using, as well as what operating system you
are running. If possible, include complete, minimal example code that reproduces the problem.
## Setting up your development environment
We recommend using the [conda](https://conda.io/docs/) package manager for your Python
environments. Our recommended setup for contributing is:
* Install [miniconda](https://docs.conda.io/en/latest/miniconda.html) on your system.
* Install git on your system if it is not already there (install XCode command line tools on
a Mac or git bash on Windows)
* Login to your GitHub account and make a fork of the
[pyproj repository](https://github.com/pyproj4/pyproj/) by clicking the "Fork" button.
* Clone your fork of the pyproj repository (in terminal on Mac/Linux or git shell/
GUI on Windows) in the location you'd like to keep it. We are partial to creating a
``git_repos`` directory in our home folder.
``git clone https://github.com/your-user-name/pyproj.git``
* Navigate to that folder in the terminal or in Anaconda Prompt if you're on Windows.
``cd pyproj``
* Connect your repository to the upstream (main project).
``git remote add upstream https://github.com/pyproj4/pyproj.git``
* Create the development environment by running ``conda create -n devel -c conda-forge cython proj numpy shapely xarray pandas``.
* If the minimum PROJ version is not yet available, you can build PROJ from source using:
```bash
export PROJ_DIR=$PWD/pyproj/proj_dir
mkdir $PROJ_DIR
bash ci/proj-compile.sh git
```
* Activate our new development environment ``conda activate devel`` on Mac/Linux or
``activate devel`` on Windows.
* Install development requirements ``python -m pip install -r requirements-dev.txt``
* Make an editable install of pyproj by running ``python -m pip install -e .``
* Setup pre-commit hooks ``pre-commit install``
Now you're all set! You have an environment called ``devel`` that you can work in. You'll need
to make sure to activate that environment next time you want to use it after closing the
terminal or your system. If you want to get back to the root environment, just run
``source deactivate`` (just ``deactivate`` on Windows).
## Pull Requests
The changes to the pyproj source (and documentation) should be made via GitHub pull requests against ``main``, even for those with administration rights. While it's tempting to make changes directly to ``main`` and push them up, it is better to make a pull request so that others can give feedback. If nothing else, this gives a chance for the automated tests to run on the PR. This can eliminate "brown paper bag" moments with buggy commits on the main branch.
During the Pull Request process, before the final merge, it's a good idea to rebase the branch and squash together smaller commits. It's not necessary to flatten the entire branch, but it can be nice to eliminate small fixes and get the merge down to logically arranged commits. This can also be used to hide sins from history--this is the only chance, since once it hits ``main``, it's there forever!
**Working on your first Pull Request?** You can learn how from this *free* video series
[How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github), Aaron Meurer's [tutorial on the git workflow](https://www.asmeurer.com/git-workflow/), or the guide [“How to Contribute to Open Source"](https://opensource.guide/how-to-contribute/).
Commit the changes you made. Chris Beams has written a [guide](https://chris.beams.io/posts/git-commit/) on how to write good commit messages.
Push to your fork and [submit a pull request]( https://github.com/pyproj4/pyproj/compare/).
## Documentation
Now that you've made your awesome contribution, it's time to tell the world how to use it.
Writing documentation strings is really important to make sure others use your functionality properly. Didn't write new functions? That's fine, but be sure that the documentation for the code you touched is still in great shape. It is not uncommon to find some strange wording or clarification that you can take care of while you are here. If you added a new function make sure that it gets marked as included if appropriate in the GEMPAK conversion table.
You can write examples in the documentation if they are simple concepts to demonstrate. If
your feature is more complex, consider adding to the examples or tutorials for pyproj.
You can build the documentation locally to see how your changes will look.
* Install docs requirements: ``make install-docs``
* Build the docs: ``make docs``
* Or, to build and open in a browser: ``make docs-browser``
## Tests
Unit tests are the lifeblood of the project, as it ensures that we can continue to add and
change the code and stay confident that things have not broken. Running the tests requires
``pytest``, which is easily available through ``conda`` or ``pip``. It was also installed if you made our default ``devel`` environment.
### Running Tests
Running the tests can be done by running ``python -m pytest``. Make sure you install the test requirements before running the tests ``python -m pip install -r requirements-test.txt``.
Running the whole test suite isn't that slow, but can be a burden if you're working on just
one module or a specific test. It is easy to run tests on a single directory:
python -m pytest pyproj/calc
A specific test can be run as:
python -m pytest -k test_my_test_func_name
### Writing Tests
Tests should ideally hit all of the lines of code added or changed. We have automated
services that can help track down lines of code that are missed by tests. Watching the
coverage has even helped find sections of dead code that could be removed!
Let's say we are adding a simple function to add two numbers and return the result as a float or as a string. (This would be a silly function, but go with us here for demonstration purposes.)
def add_as_float_or_string(a, b, as_string=False):
res = a + b
if as_string:
return string(res)
return res
I can see two easy tests here: one for the results as a float and one for the results as a
string. If I had added this to the ``calc`` module, I'd add those two tests in
``tests/test_calc.py``.
def test_add_as_float_or_string_defaults():
res = add_as_float_or_string(3, 4)
assert(res, 7)
def test_add_as_float_or_string_string_return():
res = add_as_float_or_string(3, 4, as_string=True)
assert(res, '7')
There are plenty of more advanced testing concepts, like dealing with floating point
comparisons, parameterizing tests, testing that exceptions are raised, and more. Have a look at the existing tests to get an idea of some of the common patterns.
## Code Style
pyproj uses the Python code style outlined in [PEP8](https://pep8.org) and [black](https://github.com/python/black).
We enforce this style as code is added to keep everything clean and uniform. To this end, part of the automated testing for pyproj checks style. To check style
locally within the source directory you can use the ``flake8`` and ``black`` tools. Running it from the root of the source directory is as easy as running ``pre-commit run --all`` in the base of the repository.
You can also just submit your PR and the kind robots will comment on all style violations as well. It can be a pain to make sure you have the right number of spaces around things, imports in order, and all of the other nits that the bots will find. It is very important though as this consistent style helps us keep pyproj readable, maintainable, and uniform.
## What happens after the pull request
You've make your changes, documented them, added some tests, and submitted a pull request.
What now?
### Automated Testing
First, our army of never sleeping robots will begin a series of automated checks.
The test suite, documentation, style, and more will be checked on various versions of Python with current and legacy packages. Travis CI will run testing on Linux and Mac, Appveyor will run tests on Windows. Other services will kick in and check if there is a drop in code coverage or any style variations that should be corrected. If you see a red mark by a service, something failed and clicking the "Details" link will give you more information. We're happy to help if you are stuck.
The robots can be difficult to satisfy, but they are there to help everyone write better code. In some cases, there will be exceptions to their suggestions, but these are rare. If you make changes to your code and push again, the tests will automatically run again.
### Code Review
At this point you're waiting on us. You should expect to hear at least a comment within a
couple of days. We may suggest some changes or improvements or alternatives.
Some things that will increase the chance that your pull request is accepted quickly:
* Write tests.
* Follow [PEP8](https://pep8.org) for style. (The `flake8` utility can help with this.)
* Use [black](https://github.com/python/black)
* Write a [good commit message](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) and consider using commit [conventions](https://www.conventionalcommits.org/).
Pull requests will automatically have tests run by Travis. This includes
running both the unit tests as well as the `flake8` code linter.
### Merging
Once we're all happy with the pull request, it's time for it to get merged in. Only the
maintainers can merge pull requests and you should never merge a pull request you have commits on as it circumvents the code review. If this is your first or second pull request, we'll likely help by rebasing and cleaning up the commit history for you. As your development skills increase, we'll help you learn how to do this.
## Allcontributors Recognition
We do our best to recognize contributions, but we may miss some. If we did, please let us know. Also, if you would prefer not to be recognized on the README, please let us know.
## More Questions?
If you're stuck somewhere or are interested in being a part of the community in
other ways, feel free to contact us:
* [pyproj's Gitter Channel](https://gitter.im/pyproj4-pyproj/community)
* ["pyproj" tag on GIS Stack Exchange](https://gis.stackexchange.com/questions/tagged/pyproj)
## Further Reading
There are a ton of great resources out there on contributing to open source and on the
importance of writing tested and maintainable software.
* [GitHub's Contributing to Open Source Guide](https://guides.github.com/activities/contributing-to-open-source/)
* [Zen of Scientific Software Maintenance](https://jrleeman.github.io/ScientificSoftwareMaintenance/)
pyproj-3.6.1/HOW_TO_RELEASE.md 0000664 0000000 0000000 00000005135 14502715416 0015576 0 ustar 00root root 0000000 0000000 # Preparing a pyproj release
Preparing a pyproj release is a two-phase process.
## Phase 1: Release Candidate
In this phase, we want to ensure all the builds work on all platforms and methods
of distribution for the next release.
### Add the rc postfix
The first step in this phase is to update the version number `__version__` in `__init__.py`
to the next release `..`. Then, add the `rc` style posfix following the [PEP-440](https://www.python.org/dev/peps/pep-0440/#pre-releases) conventions.
### Create a tag on the repository
The next step is to create a tag with the same name as the version just added. This can be done using the git command line or from https://github.com/pyproj4/pyproj/tags.
### Test the release builds
1. Create a draft PR at https://github.com/pyproj4/pyproj-wheels and verify tests pass.
2. Create a draft PR at https://github.com/conda-forge/pyproj-feedstock and verify tests pass.
3. Check the wheels built at https://github.com/pyproj4/pyproj using GitHub Actions.
4. Verify Debian builds were successful.
4. Verify Fedora builds were successful.
5. Verify the docs build successfully.
## Phase 2: Make the release
After the candidate has proven itself, it will be promoted to a final release.
### Remove the rc postfix
Remove the `rc` postfix from the the version number `__version__` in `__init__.py`.
### Create a tag on the repository
The next step is to create a tag with the name `..`. This can be done using the git command line or from https://github.com/pyproj4/pyproj/tags.
Next, go through the history and add release notes (see: [automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)). Make sure to acknowledge contributions made by others in the release.
### The wheels
Most of the wheels are tested with each merge to main and uploaded to pypi on release in GitHub Actions. However, the arm64 wheels are built separately. This provides instructions for those wheels:
1. linux arm64: Update the PR at https://github.com/pyproj4/pyproj-wheels with the release tag & merge. The wheels will automatically upload to pypi when the CI runs suceed.
2. macos arm64: Download the release wheel artifacts from the Cirrus CI build and upload manually to pypi.
### Verify conda-forge build is correct
A PR for `pyproj` will be generated automatically after you push to pypi.
Verify all is correct on the PR at https://github.com/conda-forge/pyproj-feedstock.
### Update the docs
On the `gh-pages` branch, update the stable symlink to point to the next version.
pyproj-3.6.1/LICENSE 0000664 0000000 0000000 00000002136 14502715416 0014060 0 ustar 00root root 0000000 0000000 Copyright (c) 2006-2018, Jeffrey Whitaker.
Copyright (c) 2019-2023, Open source contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
pyproj-3.6.1/LICENSE_proj 0000664 0000000 0000000 00000003270 14502715416 0015112 0 ustar 00root root 0000000 0000000
All source, data files and other contents of the PROJ.4 package are
available under the following terms. Note that the PROJ 4.3 and earlier
was "public domain" as is common with US government work, but apparently
this is not a well defined legal term in many countries. I am placing
everything under the following MIT style license because I believe it is
effectively the same as public domain, allowing anyone to use the code as
they wish, including making proprietary derivatives.
Though I have put my own name as copyright holder, I don't mean to imply
I did the work. Essentially all work was done by Gerald Evenden.
--------------
Copyright (c) 2000, Frank Warmerdam
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
pyproj-3.6.1/MANIFEST.in 0000664 0000000 0000000 00000000604 14502715416 0014607 0 ustar 00root root 0000000 0000000 include README.md
include MANIFEST.in
include pyproject.toml
include LICENSE
include Makefile
include pytest.ini
include pyproj/py.typed
include pyproj/*.pyd
include pyproj/*.pyx
include pyproj/*.pxd
include pyproj/*.pxi
include pyproj/*.pyi
include test/sample.out
include test/*.py
include test/*/*.py
exclude pyproj/*.c
recursive-include docs *
prune docs/_build
prune pyproj/proj_dir
pyproj-3.6.1/Makefile 0000664 0000000 0000000 00000005157 14502715416 0014521 0 ustar 00root root 0000000 0000000 # This was based on a Makefile by Kirk Hansen
.PHONY: clean clean-test clean-pyc clean-build clean-setup clean-cython docs help test
.DEFAULT_GOAL := help
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
BROWSER := python3 -c "$$BROWSER_PYSCRIPT"
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
clean: clean-build clean-pyc clean-test clean-setup clean-cython ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
clean-setup: ## run python setup.py clean
python setup.py clean
clean-cython: ## clean the cython files
rm -f pyproj/*.so
rm -f pyproj/*/*.so
rm -f pyproj/*/*.c
rm -f pyproj/*.c
check-type:
mypy pyproj
check: check-type
pre-commit run --show-diff-on-failure --all-files
test: ## run tests
py.test
test-verbose: ## run tests with full verbosity
py.test -vv -s
test-coverage: ## run tests and generate coverage report
py.test --cov-report term-missing --cov=pyproj -v -s
install-docs: ## Install requirements for building documentation
python -m pip install -r requirements-docs.txt
docs: ## generate Sphinx HTML documentation, including API docs
$(MAKE) -C docs clean
$(MAKE) -C docs html
docs-browser: docs ## generate Sphinx HTML documentation, including API docs and open in a browser
$(BROWSER) docs/_build/html/index.html
docs-man: ## generate Sphinx man pages for CLI
$(MAKE) -C docs clean
$(MAKE) -C docs man
install: clean ## install the package to the active Python's site-packages
python -m pip install .
install-dev: clean ## install development version to active Python's site-packages
python -m pip install -r requirements-dev.txt
pre-commit install
python -m pip install -r requirements-test.txt
PYPROJ_FULL_COVERAGE=YES python -m pip install -e .
pyproj-3.6.1/README.md 0000664 0000000 0000000 00000071713 14502715416 0014341 0 ustar 00root root 0000000 0000000 
# pyproj
Python interface to [PROJ](http://proj.org) (cartographic projections and coordinate transformations library).
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
pyproj-3.6.1/appveyor.yml 0000664 0000000 0000000 00000011056 14502715416 0015444 0 ustar 00root root 0000000 0000000 platform:
- x64
# This is based on file and files in ci/appveyor are from
# https://github.com/ogrisel/python-appveyor-demo
environment:
global:
PROJ_BASE_DIR: "%APPVEYOR_BUILD_FOLDER%\\proj_install"
PROJ_NETWORK: "ON"
matrix:
# Pre-installed Python versions
# See: http://www.appveyor.com/docs/installed-software#python
# build is limited to 60 minutes, without caching each build takes 10-30 minutes
# with caching build takes less than 1 minute
- PYTHON: "C:\\Python39-x64"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PROJSOURCE: 9.3.0
BUILD_SHARED_LIBS: ON
# - PYTHON: "C:\\Python39-x64"
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PROJSOURCE: git
# BUILD_SHARED_LIBS: ON
# matrix:
# allow_failures:
# - PYTHON: "C:\\Python39-x64"
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PROJSOURCE: git
# BUILD_SHARED_LIBS: ON
shallow_clone: true
cache:
- C:\Tools\vcpkg\installed\ -> appveyor.yml
- C:\Users\appveyor\AppData\Local\pip\Cache\wheels -> appveyor.yml
- "%PROJ_BASE_DIR%"
build_script:
- set VCPKG_INSTALLED=C:\Tools\vcpkg\installed\%platform%-windows
# If cached directory does not exist, update vcpkg and install dependencies
- if not exist %VCPKG_INSTALLED%\bin (
cd "C:\Tools\vcpkg" &
git pull > nul &
.\bootstrap-vcpkg.bat -disableMetrics &
vcpkg install sqlite3[core,tool]:"%platform%"-windows &
vcpkg install tiff:"%platform%"-windows &
vcpkg install curl:"%platform%"-windows &
cd %APPVEYOR_BUILD_FOLDER%
)
- dir %VCPKG_INSTALLED%\bin
- set PATH=%VCPKG_INSTALLED%\bin;%PATH%
# See https://www.appveyor.com/docs/lang/cpp/
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019"
(call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %platform% )
# setup PROJ
- set PROJ_DIR=%PROJ_BASE_DIR%\proj-%PROJSOURCE:~0,5%
- if "%PROJSOURCE%" == "git" git clone https://github.com/OSGeo/PROJ.git proj-git
- if "%PROJSOURCE%" == "git" rmdir /s /q %PROJ_DIR%
- if not "%PROJSOURCE%" == "git" if not exist %PROJ_DIR% set BUILD_PROJ_STABLE=1
- if defined BUILD_PROJ_STABLE curl -o "proj-%PROJSOURCE:~0,5%.zip" "https://download.osgeo.org/proj/proj-%PROJSOURCE%.zip"
- if defined BUILD_PROJ_STABLE 7z x -aoa -y "proj-%PROJSOURCE:~0,5%.zip"
- if not exist %PROJ_DIR% cd "%APPVEYOR_BUILD_FOLDER%\proj-%PROJSOURCE:~0,5%"
- if "%PROJSOURCE%" == "git" set BUILD_PROJ=1
- if defined BUILD_PROJ_STABLE set BUILD_PROJ=1
- if defined BUILD_PROJ mkdir build
- if defined BUILD_PROJ cd build
- if defined BUILD_PROJ cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="%BUILD_SHARED_LIBS%" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
- if defined BUILD_PROJ ninja -v
- if defined BUILD_PROJ ninja install
- set PATH=%PROJ_DIR%\bin;%PATH%
- set PROJ_DATA=%PROJ_DIR%\share\proj
- cd %APPVEYOR_BUILD_FOLDER%
- proj
# Build and install pyproj wheel
- python -m pip install -r requirements-dev.txt
- mkdir pyproj\proj_dir\share\proj
- copy %PROJ_DATA%\* pyproj\proj_dir\share\proj
- set PROJ_WHEEL=true
- python -m build --wheel
- FOR %%F IN (dist\*.whl) DO (set PYPROJ_WHEEL=%%F)
- delvewheel repair %PYPROJ_WHEEL%
- FOR %%F IN (wheelhouse\*.whl) DO (set PYPROJ_WHEEL=%%F)
- python -m pip install %PYPROJ_WHEEL%
install:
# Prepend newly installed Python to the PATH of this build
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
- SET BASE_PATH=%PATH%
# Check that we have the expected version and architecture for Python
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
# install wheel, caching
- python -m pip install --disable-pip-version-check --user --upgrade pip
- python -m pip install build wheel delvewheel
test_script:
# reset environment variables for test
- set PROJ_DATA=
- set PROJ_DIR=
- SET PATH=%BASE_PATH%
# run the project tests
- python -m pip install -r requirements-test.txt
- RD /S /Q pyproj\ # make sure src does not impact installed wheel
- python -c "import pyproj; pyproj.Proj('epsg:4269')"
- python -m pytest --cov-report term-missing --cov=pyproj -v -s
# cleanup for test dir
- rmdir /s /q dist\ 2>nul
- if %PROJSOURCE% == git rmdir /s /q wheelhouse\ 2>nul
artifacts:
# Archive the generated packages in the ci.appveyor.com build report.
- path: wheelhouse\*
#on_success:
# - TODO: upload the content of dist/*.whl to a public wheelhouse
#
pyproj-3.6.1/ci/ 0000775 0000000 0000000 00000000000 14502715416 0013444 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/ci/proj-compile-wheels.sh 0000664 0000000 0000000 00000022440 14502715416 0017667 0 ustar 00root root 0000000 0000000 # INSTALL PROJ & DEPENDENCIES FOR WHEELS
# Test for macOS with [ -n "$IS_MACOS" ]
SQLITE_VERSION=3420000
LIBTIFF_VERSION=4.5.0
CURL_VERSION=8.1.2
NGHTTP2_VERSION=1.54.0
# ------------------------------------------
# From: https://github.com/multi-build/multibuild/
# ------------------------------------------
BUILD_PREFIX="${BUILD_PREFIX:-/usr/local}"
OPENSSL_ROOT=${OPENSSL_ROOT:-openssl-1.1.1l}
# Hash from https://www.openssl.org/source/openssl-1.1.1?.tar.gz.sha256
OPENSSL_HASH=${OPENSSL_HASH:-0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1}
OPENSSL_DOWNLOAD_URL=${OPENSSL_DOWNLOAD_URL:-https://www.openssl.org/source}
if [ $(uname) == "Darwin" ]; then
IS_MACOS=1;
fi
if [ -z "$IS_MACOS" ]; then
# Strip all binaries after compilation.
STRIP_FLAGS=${STRIP_FLAGS:-"-Wl,-strip-all"}
export CFLAGS="${CFLAGS:-$STRIP_FLAGS}"
export CXXFLAGS="${CXXFLAGS:-$STRIP_FLAGS}"
export FFLAGS="${FFLAGS:-$STRIP_FLAGS}"
fi
export CPPFLAGS_BACKUP="$CPPFLAGS"
export LIBRARY_PATH_BACKUP="$LIBRARY_PATH"
export PKG_CONFIG_PATH_BACKUP="$PKG_CONFIG_PATH"
function update_env_for_build_prefix {
# Promote BUILD_PREFIX on search path to any newly built libs
export CPPFLAGS="-I$BUILD_PREFIX/include $CPPFLAGS_BACKUP"
export LIBRARY_PATH="$BUILD_PREFIX/lib:$LIBRARY_PATH_BACKUP"
export PKG_CONFIG_PATH="$BUILD_PREFIX/lib/pkgconfig/:$PKG_CONFIG_PATH_BACKUP"
# Add binary path for configure utils etc
export PATH="$BUILD_PREFIX/bin:$PATH"
}
function rm_mkdir {
# Remove directory if present, then make directory
local path=$1
if [ -z "$path" ]; then echo "Need not-empty path"; exit 1; fi
if [ -d "$path" ]; then rm -rf $path; fi
mkdir $path
}
function untar {
local in_fname=$1
if [ -z "$in_fname" ];then echo "in_fname not defined"; exit 1; fi
local extension=${in_fname##*.}
case $extension in
tar) tar -xf $in_fname ;;
gz|tgz) tar -zxf $in_fname ;;
bz2) tar -jxf $in_fname ;;
zip) unzip -qq $in_fname ;;
xz) if [ -n "$IS_MACOS" ]; then
tar -xf $in_fname
else
if [[ ! $(type -P "unxz") ]]; then
echo xz must be installed to uncompress file; exit 1
fi
unxz -c $in_fname | tar -xf -
fi ;;
*) echo Did not recognize extension $extension; exit 1 ;;
esac
}
function suppress {
# Run a command, show output only if return code not 0.
# Takes into account state of -e option.
# Compare
# https://unix.stackexchange.com/questions/256120/how-can-i-suppress-output-only-if-the-command-succeeds#256122
# Set -e stuff agonized over in
# https://unix.stackexchange.com/questions/296526/set-e-in-a-subshell
local tmp=$(mktemp tmp.XXXXXXXXX) || return
local errexit_set
echo "Running $@"
if [[ $- = *e* ]]; then errexit_set=true; fi
set +e
( if [[ -n $errexit_set ]]; then set -e; fi; "$@" > "$tmp" 2>&1 ) ; ret=$?
[ "$ret" -eq 0 ] || cat "$tmp"
rm -f "$tmp"
if [[ -n $errexit_set ]]; then set -e; fi
return "$ret"
}
function yum_install {
# CentOS 5 yum doesn't fail in some cases, e.g. if package is not found
# https://serverfault.com/questions/694942/yum-should-error-when-a-package-is-not-available
yum install -y "$1" && rpm -q "$1"
}
function install_rsync {
# install rsync via package manager
if [ -n "$IS_MACOS" ]; then
# macOS. The colon in the next line is the null command
:
elif [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
[[ $(type -P rsync) ]] || apt-get install -y rsync
else
# centos based distro
[[ $(type -P rsync) ]] || yum_install rsync
fi
}
function fetch_unpack {
# Fetch input archive name from input URL
# Parameters
# url - URL from which to fetch archive
# archive_fname (optional) archive name
#
# Echos unpacked directory and file names.
#
# If `archive_fname` not specified then use basename from `url`
# If `archive_fname` already present at download location, use that instead.
local url=$1
if [ -z "$url" ];then echo "url not defined"; exit 1; fi
local archive_fname=${2:-$(basename $url)}
local arch_sdir="${ARCHIVE_SDIR:-archives}"
if [ -z "$IS_MACOS" ]; then
local extension=${archive_fname##*.}
if [ "$extension" == "xz" ]; then
ensure_xz
fi
fi
# Make the archive directory in case it doesn't exist
mkdir -p $arch_sdir
local out_archive="${arch_sdir}/${archive_fname}"
# If the archive is not already in the archives directory, get it.
if [ ! -f "$out_archive" ]; then
# Source it from multibuild archives if available.
local our_archive="${MULTIBUILD_DIR}/archives/${archive_fname}"
if [ -f "$our_archive" ]; then
ln -s $our_archive $out_archive
else
# Otherwise download it.
curl -L $url > $out_archive
fi
fi
# Unpack archive, refreshing contents, echoing dir and file
# names.
rm_mkdir arch_tmp
install_rsync
(cd arch_tmp && \
untar ../$out_archive && \
ls -1d * &&
rsync --delete -ah * ..)
}
function build_simple {
# Example: build_simple libpng $LIBPNG_VERSION \
# https://download.sourceforge.net/libpng tar.gz \
# --additional --configure --arguments
local name=$1
local version=$2
local url=$3
local ext=${4:-tar.gz}
local configure_args=${@:5}
if [ -e "${name}-stamp" ]; then
return
fi
local name_version="${name}-${version}"
local archive=${name_version}.${ext}
fetch_unpack $url/$archive
(cd $name_version \
&& ./configure --prefix=$BUILD_PREFIX $configure_args \
&& make -j4 \
&& make install)
touch "${name}-stamp"
}
function get_modern_cmake {
# Install cmake >= 2.8
local cmake=cmake
if [ -n "$IS_MACOS" ]; then
brew install cmake > /dev/null
elif [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
apt-get install -y cmake
else
if [ "`yum search cmake | grep ^cmake28\.`" ]; then
cmake=cmake28
fi
# centos based distro
yum_install $cmake > /dev/null
fi
echo $cmake
}
function build_zlib {
# Gives an old but safe version
if [ -n "$IS_MACOS" ]; then return; fi # OSX has zlib already
if [ -e zlib-stamp ]; then return; fi
if [[ $MB_ML_VER == "_2_24" ]]; then
# debian:9 based distro
apt-get install -y zlib1g-dev
else
#centos based distro
yum_install zlib-devel
fi
touch zlib-stamp
}
function build_openssl {
if [ -e openssl-stamp ]; then return; fi
fetch_unpack ${OPENSSL_DOWNLOAD_URL}/${OPENSSL_ROOT}.tar.gz
check_sha256sum $ARCHIVE_SDIR/${OPENSSL_ROOT}.tar.gz ${OPENSSL_HASH}
(cd ${OPENSSL_ROOT} \
&& ./config no-ssl2 no-shared -fPIC --prefix=$BUILD_PREFIX \
&& make -j4 \
&& make install)
touch openssl-stamp
}
# ------------------------------------------
function build_nghttp2 {
if [ -e nghttp2-stamp ]; then return; fi
fetch_unpack https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.gz
(cd nghttp2-${NGHTTP2_VERSION} \
&& ./configure --enable-lib-only --prefix=$BUILD_PREFIX \
&& make -j4 \
&& make install)
touch nghttp2-stamp
}
function build_curl_ssl {
if [ -e curl-stamp ]; then return; fi
CFLAGS="$CFLAGS -g -O2"
CXXFLAGS="$CXXFLAGS -g -O2"
suppress build_nghttp2
local flags="--prefix=$BUILD_PREFIX --with-nghttp2=$BUILD_PREFIX --with-zlib=$BUILD_PREFIX"
if [ -n "$IS_MACOS" ]; then
flags="$flags --with-darwinssl"
else # manylinux
suppress build_openssl
flags="$flags --with-ssl"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BUILD_PREFIX/lib
fi
fetch_unpack https://curl.se/download/curl-${CURL_VERSION}.tar.gz
(cd curl-${CURL_VERSION} \
&& if [ -z "$IS_MACOS" ]; then \
LIBS=-ldl ./configure $flags; else \
./configure $flags; fi\
&& make -j4 \
&& make install)
touch curl-stamp
}
function build_libtiff {
if [ -e libtiff-stamp ]; then return; fi
build_simple tiff $LIBTIFF_VERSION https://download.osgeo.org/libtiff
touch libtiff-stamp
}
function build_sqlite {
if [ -z "$IS_MACOS" ]; then
CFLAGS="$CFLAGS -DHAVE_PREAD64 -DHAVE_PWRITE64"
fi
if [ -e sqlite-stamp ]; then return; fi
build_simple sqlite-autoconf $SQLITE_VERSION https://www.sqlite.org/2023
touch sqlite-stamp
}
function build_proj {
if [ -e proj-stamp ]; then return; fi
get_modern_cmake
fetch_unpack https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz
suppress build_curl_ssl
(cd proj-${PROJ_VERSION:0:5} \
&& cmake . \
-DCMAKE_INSTALL_PREFIX=$PROJ_DIR \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_IPO=ON \
-DBUILD_APPS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DCMAKE_PREFIX_PATH=$BUILD_PREFIX \
-DCMAKE_INSTALL_LIBDIR=lib \
&& cmake --build . -j$(nproc) \
&& cmake --install .)
touch proj-stamp
}
# Run installation process
update_env_for_build_prefix
suppress build_zlib
suppress build_sqlite
suppress build_libtiff
build_proj
pyproj-3.6.1/ci/proj-compile.sh 0000775 0000000 0000000 00000001512 14502715416 0016402 0 ustar 00root root 0000000 0000000 #!/bin/bash
pushd .
echo "Building PROJ ($1) from source..."
BUILD_PROJ_DIR=proj-${1:0:5}
# Download PROJ
if [[ $1 == "git" ]]; then
git clone https://github.com/OSGeo/PROJ.git ${BUILD_PROJ_DIR}
else
curl https://download.osgeo.org/proj/proj-$1.tar.gz > ${BUILD_PROJ_DIR}.tar.gz
tar zxf ${BUILD_PROJ_DIR}.tar.gz
rm ${BUILD_PROJ_DIR}.tar.gz
fi
cd ${BUILD_PROJ_DIR}
mkdir build
cd build
# build using cmake
cmake .. \
-DCMAKE_INSTALL_PREFIX=$PROJ_DIR \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_IPO=ON \
-DBUILD_CCT:BOOL=OFF \
-DBUILD_CS2CS:BOOL=OFF \
-DBUILD_GEOD:BOOL=OFF \
-DBUILD_GIE:BOOL=OFF \
-DBUILD_GMOCK:BOOL=OFF \
-DBUILD_PROJINFO:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF
cmake --build . -j$(nproc)
cmake --install .
# cleanup
cd ../..
rm -rf ${BUILD_PROJ_DIR}
popd
pyproj-3.6.1/ci/vcpkg.json 0000664 0000000 0000000 00000000343 14502715416 0015451 0 ustar 00root root 0000000 0000000 {
"name": "pyproj",
"version": "3.6.0",
"dependencies": [
{
"name": "proj",
"version>=": "9.3.0"
}
],
"builtin-baseline": "7b5ca09708ae42dba9517d4e0a0c975d087f1061"
}
pyproj-3.6.1/codecov.yml 0000664 0000000 0000000 00000000243 14502715416 0015215 0 ustar 00root root 0000000 0000000 coverage:
status:
project:
default:
target: 94% # the required coverage value
threshold: 0.2% # the leniency in hitting the target
pyproj-3.6.1/docs/ 0000775 0000000 0000000 00000000000 14502715416 0014001 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/docs/Makefile 0000664 0000000 0000000 00000001140 14502715416 0015435 0 ustar 00root root 0000000 0000000 # Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3 -msphinx
SPHINXPROJ = pyproj
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
pyproj-3.6.1/docs/advanced_examples.rst 0000664 0000000 0000000 00000024254 14502715416 0020205 0 ustar 00root root 0000000 0000000 .. _advanced_examples:
Advanced Examples
=================
Optimize Transformations
------------------------
Here are a few tricks to try out if you want to optimize your transformations.
Repeated transformations
~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 2.1.0
If you use the same transform, using the :class:`pyproj.transformer.Transformer` can help
optimize your transformations.
.. code-block:: python
import numpy
from pyproj import Transformer, transform
transformer = Transformer.from_crs(2263, 4326)
x_coords = numpy.random.randint(80000, 120000)
y_coords = numpy.random.randint(200000, 250000)
Example with :func:`pyproj.transformer.transform`:
.. code-block:: python
transform(2263, 4326, x_coords, y_coords)
Results: 160 ms ± 3.68 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
Example with :class:`pyproj.transformer.Transformer`:
.. code-block:: python
transformer.transform(x_coords, y_coords)
Results: 6.32 µs ± 49.7 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
Transforming with the same projections
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pyproj skips `noop` transformations.
Transformation Group
--------------------
.. versionadded:: 2.3.0
The :class:`pyproj.transformer.TransformerGroup` provides both available
transformations as well as missing transformations.
1. Helpful if you want to use an alternate transformation and have a good reason for it.
.. code-block:: python
>>> from pyproj.transformer import TransformerGroup
>>> trans_group = TransformerGroup("EPSG:4326","EPSG:2964")
>>> trans_group
- transformers: 8
- unavailable_operations: 1
>>> trans_group.best_available
True
>>> trans_group.transformers[0].transform(66, -153)
(149661.2825058747, 5849322.174897663)
>>> trans_group.transformers[1].transform(66, -153)
(149672.928811047, 5849311.372139239)
>>> trans_group.transformers[2].transform(66, -153)
(149748.32734832275, 5849274.621409136)
2. Helpful if want to check that the best possible transformation exists.
And if not, how to get the missing grid.
.. code-block:: python
>>> from pyproj.transformer import TransformerGroup
>>> tg = TransformerGroup("EPSG:4326", "+proj=aea +lat_0=50 +lon_0=-154 +lat_1=55 +lat_2=65 +x_0=0 +y_0=0 +datum=NAD27 +no_defs +type=crs +units=m", always_xy=True)
UserWarning: Best transformation is not available due to missing Grid(short_name=ntv2_0.gsb, full_name=, package_name=proj-datumgrid-north-america, url=https://download.osgeo.org/proj/proj-datumgrid-north-america-latest.zip, direct_download=True, open_license=True, available=False)
f"{operation.grids[0]!r}"
>>> tg
- transformers: 37
- unavailable_operations: 41
>>> tg.transformers[0].description
'axis order change (2D) + Inverse of NAD27 to WGS 84 (3) + axis order change (2D) + unknown'
>>> tg.unavailable_operations[0].name
'Inverse of NAD27 to WGS 84 (33) + axis order change (2D) + unknown'
>>> tg.unavailable_operations[0].grids[0].url
'https://download.osgeo.org/proj/proj-datumgrid-north-america-latest.zip'
Area of Interest
----------------
.. versionadded:: 2.3.0
Depending on the location of your transformation, using the area of interest may impact
which transformation operation is selected in the transformation.
.. code-block:: python
>>> from pyproj.transformer import Transformer, AreaOfInterest
>>> transformer = Transformer.from_crs("EPSG:4326", "EPSG:2694")
>>> transformer
Description: Inverse of Pulkovo 1995 to WGS 84 (2) + 3-degree Gauss-Kruger zone 60
Area of Use:
- name: Russia
- bounds: (18.92, 39.87, -168.97, 85.2)
>>> transformer = Transformer.from_crs(
... "EPSG:4326",
... "EPSG:2694",
... area_of_interest=AreaOfInterest(-136.46, 49.0, -60.72, 83.17),
... )
>>> transformer
Description: Inverse of NAD27 to WGS 84 (13) + Alaska Albers
Area of Use:
- name: Canada - NWT; Nunavut; Saskatchewan
- bounds: (-136.46, 49.0, -60.72, 83.17)
Promote CRS to 3D
-------------------
.. versionadded:: 3.1
In PROJ 6+ you need to explicitly change your CRS to 3D if you have
2D CRS and you want the ellipsoidal height taken into account.
.. code-block:: python
>>> from pyproj import CRS, Transformer
>>> transformer = Transformer.from_crs("EPSG:4326", "EPSG:2056", always_xy=True)
>>> transformer.transform(8.37909, 47.01987, 1000)
(2671499.8913080636, 1208075.1135782297, 1000.0)
>>> transformer_3d = Transformer.from_crs(
... CRS("EPSG:4326").to_3d(),
... CRS("EPSG:2056").to_3d(),
... always_xy=True,
...)
>>> transformer_3d.transform(8.37909, 47.01987, 1000)
(2671499.8913080636, 1208075.1135782297, 951.4265527743846)
Demote CRS to 2D
----------------
.. versionadded:: 3.6
With the need for explicit 3D CRS since PROJ 6+, one might need to retrieve their 2D version,
for example to create another 3D CRS compound between a 2D CRS and a vertical CRS.
.. code-block:: python
>>> from pyproj import CRS, Transformer
>>> from pyproj.crs import CompoundCRS
>>> src_crs = CRS("EPSG:4979") # Any 3D CRS, here the 3D WGS 84
>>> vert_crs = CRS("EPSG:5773") # Any vertical CRS, here the EGM96 geoid
>>> dst_crs = CompoundCRS(src_crs.name + vert_crs.name, components=[src_crs.to_2d(), vert_crs])
>>> transformer_3d = Transformer.from_crs(src_crs, dst_crs, always_xy=True)
>>> transformer_3d.transform(8.37909, 47.01987, 1000)
(8.37909, 47.01987, 951.7851086745321)
Projected CRS Bounds
----------------------
.. versionadded:: 3.1
The boundary of the CRS is given in geographic coordinates.
This is the recommended method for calculating the projected bounds.
.. code-block:: python
>>> from pyproj import CRS, Transformer
>>> crs = CRS("EPSG:3857")
>>> transformer = Transformer.from_crs(crs.geodetic_crs, crs, always_xy=True)
>>> transformer.transform_bounds(*crs.area_of_use.bounds)
(-20037508.342789244, -20048966.104014594, 20037508.342789244, 20048966.104014594)
Multithreading
--------------
As of version 3.1, these objects are thread-safe:
- :class:`pyproj.crs.CRS`
- :class:`pyproj.transformer.Transformer`
If you have pyproj<3.1, you will need to create the object
within the thread that uses it.
Here is a simple demonstration:
.. code-block:: python
import concurrent.futures
from pyproj import Transformer
def transform_point(point):
transformer = Transformer.from_crs(4326, 3857)
return transformer.transform(point, point * 2)
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
for result in executor.map(transform_point, range(5)):
print(result)
Optimizing Single-Threaded Applications
----------------------------------------
If you have a single-threaded application that generates many objects,
enabling the use of the global context can provide performance enhancements.
For information about using the global context, see: :ref:`global_context`
Here is an example where enabling the global context can help:
.. code-block:: python
import pyproj
codes = pyproj.get_codes("EPSG", pyproj.enums.PJType.PROJECTED_CRS, False)
crs_list = [pyproj.CRS.from_epsg(code) for code in codes]
Caching pyproj objects
-----------------------
If you are likely to re-create pyproj objects such as :class:`pyproj.transformer.Transformer`
or :class:`pyproj.crs.CRS`, using a cache can help reduce the cost
of re-creating the objects.
Transformer
~~~~~~~~~~~~
.. code-block:: python
from functools import lru_cache
from pyproj import Transformer
TransformerFromCRS = lru_cache(Transformer.from_crs)
Transformer.from_crs(2263, 4326) # no cache
TransformerFromCRS(2263, 4326) # cache
Try it:
.. code-block:: python
from timeit import timeit
timeit(
"CachedTransformer(2263, 4326)",
setup=(
"from pyproj import Transformer; "
"from functools import lru_cache; "
"CachedTransformer = lru_cache(Transformer.from_crs)"
),
number=1000000,
)
timeit(
"Transformer.from_crs(2263, 4326)",
setup=("from pyproj import Transformer"),
number=100,
)
Without the cache, it takes around 2 seconds to do 100 iterations. With the cache,
it takes 0.1 seconds to do 1 million iterations.
CRS Example
~~~~~~~~~~~~
.. code-block:: python
from functools import lru_cache
from pyproj import CRS
CachedCRS = lru_cache(CRS)
crs = CRS(4326) # no cache
crs = CachedCRS(4326) # cache
Try it:
.. code-block:: python
from timeit import timeit
timeit(
"CachedCRS(4326)",
setup=(
"from pyproj import CRS; "
"from functools import lru_cache; "
"CachedCRS = lru_cache(CRS)"
),
number=1000000,
)
timeit(
"CRS(4326)",
setup=("from pyproj import CRS"),
number=1000,
)
Without the cache, it takes around 1 seconds to do 1000 iterations. With the cache,
it takes 0.1 seconds to do 1 million iterations.
.. _debugging-internal-proj:
Debugging Internal PROJ
------------------------
.. versionadded:: 3.0.0
To get more debugging information from the internal PROJ code:
1. Set the :envvar:`PROJ_DEBUG`
environment variable to the desired level.
2. Activate logging in `pyproj` with the devel `DEBUG`:
More information available here: https://docs.python.org/3/howto/logging.html
Here are examples to get started.
Add handler to the `pyproj` logger:
.. code-block:: python
import logging
console_handler = logging.StreamHandler()
formatter = logging.Formatter("%(levelname)s:%(message)s")
console_handler.setFormatter(formatter)
logger = logging.getLogger("pyproj")
logger.addHandler(console_handler)
logger.setLevel(logging.DEBUG)
Activate default logging config:
.. code-block:: python
import logging
logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.DEBUG)
pyproj-3.6.1/docs/api/ 0000775 0000000 0000000 00000000000 14502715416 0014552 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/docs/api/aoi.rst 0000664 0000000 0000000 00000000626 14502715416 0016060 0 ustar 00root root 0000000 0000000 Area of Interest
==================
pyproj.aoi.AreaOfInterest
--------------------------
.. note:: The backwards compatible import is `pyproj.transformer.AreaOfInterest`
.. autoclass:: pyproj.aoi.AreaOfInterest
:members:
pyproj.aoi.AreaOfUse
---------------------
.. autoclass:: pyproj.aoi.AreaOfUse
:members:
pyproj.aoi.BBox
-----------------
.. autoclass:: pyproj.aoi.BBox
:members:
pyproj-3.6.1/docs/api/crs/ 0000775 0000000 0000000 00000000000 14502715416 0015341 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/docs/api/crs/coordinate_operation.rst 0000664 0000000 0000000 00000012026 14502715416 0022303 0 ustar 00root root 0000000 0000000 .. _coordinate_operation:
Coordinate Operations
=====================
CoordinateOperation
--------------------
.. autoclass:: pyproj.crs.CoordinateOperation
:members:
:inherited-members:
Param
------
.. autoclass:: pyproj._crs.Param
:members:
Grid
----
.. autoclass:: pyproj._crs.Grid
:members:
AlbersEqualAreaConversion
---------------------------
.. autoclass:: pyproj.crs.coordinate_operation.AlbersEqualAreaConversion
:members:
:show-inheritance:
:special-members: __new__
AzimuthalEquidistantConversion
-------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.AzimuthalEquidistantConversion
:members:
:show-inheritance:
:special-members: __new__
EquidistantCylindricalConversion
--------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.EquidistantCylindricalConversion
:members:
:show-inheritance:
:special-members: __new__
GeostationarySatelliteConversion
--------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.GeostationarySatelliteConversion
:members:
:show-inheritance:
:special-members: __new__
LambertAzimuthalEqualAreaConversion
-----------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.LambertAzimuthalEqualAreaConversion
:members:
:show-inheritance:
:special-members: __new__
LambertConformalConic1SPConversion
-----------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.LambertConformalConic1SPConversion
:members:
:show-inheritance:
:special-members: __new__
LambertConformalConic2SPConversion
-----------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.LambertConformalConic2SPConversion
:members:
:show-inheritance:
:special-members: __new__
LambertCylindricalEqualAreaConversion
-------------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.LambertCylindricalEqualAreaConversion
:members:
:show-inheritance:
:special-members: __new__
.. autoclass:: pyproj.crs.coordinate_operation.LambertCylindricalEqualAreaScaleConversion
:members:
:show-inheritance:
:special-members: __new__
MercatorAConversion
--------------------
.. autoclass:: pyproj.crs.coordinate_operation.MercatorAConversion
:members:
:show-inheritance:
:special-members: __new__
MercatorBConversion
-------------------
.. autoclass:: pyproj.crs.coordinate_operation.MercatorBConversion
:members:
:show-inheritance:
:special-members: __new__
HotineObliqueMercatorBConversion
---------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.HotineObliqueMercatorBConversion
:members:
:show-inheritance:
:special-members: __new__
OrthographicConversion
-----------------------
.. autoclass:: pyproj.crs.coordinate_operation.OrthographicConversion
:members:
:show-inheritance:
:special-members: __new__
PlateCarreeConversion
--------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.PlateCarreeConversion
:members:
:show-inheritance:
:special-members: __new__
PolarStereographicAConversion
-----------------------------
.. autoclass:: pyproj.crs.coordinate_operation.PolarStereographicAConversion
:members:
:show-inheritance:
:special-members: __new__
PolarStereographicBConversion
-----------------------------
.. autoclass:: pyproj.crs.coordinate_operation.PolarStereographicBConversion
:members:
:show-inheritance:
:special-members: __new__
SinusoidalConversion
---------------------
.. autoclass:: pyproj.crs.coordinate_operation.SinusoidalConversion
:members:
:show-inheritance:
:special-members: __new__
StereographicConversion
------------------------
.. autoclass:: pyproj.crs.coordinate_operation.StereographicConversion
:members:
:show-inheritance:
:special-members: __new__
UTMConversion
-------------
.. autoclass:: pyproj.crs.coordinate_operation.UTMConversion
:members:
:show-inheritance:
:special-members: __new__
TransverseMercatorConversion
----------------------------
.. autoclass:: pyproj.crs.coordinate_operation.TransverseMercatorConversion
:members:
:show-inheritance:
:special-members: __new__
VerticalPerspectiveConversion
-----------------------------
.. autoclass:: pyproj.crs.coordinate_operation.VerticalPerspectiveConversion
:members:
:show-inheritance:
:special-members: __new__
RotatedLatitudeLongitudeConversion
----------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.RotatedLatitudeLongitudeConversion
:members:
:show-inheritance:
:special-members: __new__
PoleRotationNetCDFCFConversion
----------------------------------
.. autoclass:: pyproj.crs.coordinate_operation.PoleRotationNetCDFCFConversion
:members:
:show-inheritance:
:special-members: __new__
ToWGS84Transformation
---------------------
.. autoclass:: pyproj.crs.coordinate_operation.ToWGS84Transformation
:members:
:show-inheritance:
:special-members: __new__
pyproj-3.6.1/docs/api/crs/coordinate_system.rst 0000664 0000000 0000000 00000001701 14502715416 0021625 0 ustar 00root root 0000000 0000000 .. _coordinate_system:
Coordinate Systems
==================
CoordinateSystem
------------------------
.. autoclass:: pyproj.crs.CoordinateSystem
:members:
:inherited-members:
Axis
------------------------
.. autoclass:: pyproj._crs.Axis
:members:
:inherited-members:
Ellipsoidal2DCS
------------------------
.. autoclass:: pyproj.crs.coordinate_system.Ellipsoidal2DCS
:members:
:show-inheritance:
:special-members: __new__
Ellipsoidal3DCS
------------------------
.. autoclass:: pyproj.crs.coordinate_system.Ellipsoidal3DCS
:members:
:show-inheritance:
:special-members: __new__
Cartesian2DCS
------------------------
.. autoclass:: pyproj.crs.coordinate_system.Cartesian2DCS
:members:
:show-inheritance:
:special-members: __new__
VerticalCS
------------------------
.. autoclass:: pyproj.crs.coordinate_system.VerticalCS
:members:
:show-inheritance:
:special-members: __new__
pyproj-3.6.1/docs/api/crs/crs.rst 0000664 0000000 0000000 00000002666 14502715416 0016674 0 ustar 00root root 0000000 0000000 .. _crs:
CRS
===
CRS
----
.. autoclass:: pyproj.crs.CRS
:members:
:inherited-members:
:special-members: __init__
GeographicCRS
------------------------
.. autoclass:: pyproj.crs.GeographicCRS
:members:
:show-inheritance:
:special-members: __init__
DerivedGeographicCRS
------------------------
.. autoclass:: pyproj.crs.DerivedGeographicCRS
:members:
:show-inheritance:
:special-members: __init__
GeocentricCRS
------------------------
.. autoclass:: pyproj.crs.GeocentricCRS
:members:
:show-inheritance:
:special-members: __init__
ProjectedCRS
-----------------------
.. autoclass:: pyproj.crs.ProjectedCRS
:members:
:show-inheritance:
:special-members: __init__
VerticalCRS
-----------------------
.. autoclass:: pyproj.crs.VerticalCRS
:members:
:show-inheritance:
:special-members: __init__
BoundCRS
-----------------------
.. autoclass:: pyproj.crs.BoundCRS
:members:
:show-inheritance:
:special-members: __init__
CompoundCRS
-----------------------
.. autoclass:: pyproj.crs.CompoundCRS
:members:
:show-inheritance:
:special-members: __init__
CustomConstructorCRS
------------------------
.. autoclass:: pyproj.crs.CustomConstructorCRS
:members:
:show-inheritance:
:special-members: __init__
is_wkt
-----------------
.. autofunction:: pyproj.crs.is_wkt
is_proj
------------------
.. autofunction:: pyproj.crs.is_proj
pyproj-3.6.1/docs/api/crs/datum.rst 0000664 0000000 0000000 00000001775 14502715416 0017217 0 ustar 00root root 0000000 0000000 .. _datum:
Datum
=====
.. note:: PROJ >= 7.0.0 will have better support for aliases for datum names.
Until then, you will need to use the full name of the datum. There is support
currently for the old PROJ names for datums such as WGS84 and NAD83.
Datum
---------
.. autoclass:: pyproj.crs.Datum
:members:
:inherited-members:
CustomDatum
------------
.. autoclass:: pyproj.crs.datum.CustomDatum
:members:
:show-inheritance:
:special-members: __new__
Ellipsoid
----------
.. autoclass:: pyproj.crs.Ellipsoid
:members:
:inherited-members:
CustomEllipsoid
----------------
.. autoclass:: pyproj.crs.datum.CustomEllipsoid
:members:
:show-inheritance:
:special-members: __new__
PrimeMeridian
--------------
.. autoclass:: pyproj.crs.PrimeMeridian
:members:
:inherited-members:
CustomPrimeMeridian
--------------------
.. autoclass:: pyproj.crs.datum.CustomPrimeMeridian
:members:
:show-inheritance:
:special-members: __new__
pyproj-3.6.1/docs/api/crs/enums.rst 0000664 0000000 0000000 00000001205 14502715416 0017220 0 ustar 00root root 0000000 0000000 Enumerations
============
DatumType
----------
.. autoclass:: pyproj.crs.enums.DatumType
:members:
CoordinateOperationType
------------------------
.. autoclass:: pyproj.crs.enums.CoordinateOperationType
:members:
Cartesian2DCSAxis
------------------
.. autoclass:: pyproj.crs.enums.Cartesian2DCSAxis
:members:
Ellipsoidal2DCSAxis
--------------------
.. autoclass:: pyproj.crs.enums.Ellipsoidal2DCSAxis
:members:
Ellipsoidal3DCSAxis
--------------------
.. autoclass:: pyproj.crs.enums.Ellipsoidal3DCSAxis
:members:
VerticalCSAxis
---------------
.. autoclass:: pyproj.crs.enums.VerticalCSAxis
:members:
pyproj-3.6.1/docs/api/crs/index.rst 0000664 0000000 0000000 00000000266 14502715416 0017206 0 ustar 00root root 0000000 0000000 CRS module API Documentation
============================
.. toctree::
:maxdepth: 2
:caption: Contents:
crs
coordinate_system
coordinate_operation
datum
enums
pyproj-3.6.1/docs/api/database.rst 0000664 0000000 0000000 00000002066 14502715416 0017054 0 ustar 00root root 0000000 0000000 .. _database:
Database
=========
Methods that query the PROJ database for information.
pyproj.database.get_units_map
-----------------------------
.. note:: The backwards compatible import is `pyproj.get_units_map`
.. autofunction:: pyproj.database.get_units_map
.. autoclass:: pyproj.database.Unit
pyproj.database.get_authorities
--------------------------------
.. note:: The backwards compatible import is `pyproj.get_authorities`
.. autofunction:: pyproj.database.get_authorities
pyproj.database.get_codes
--------------------------
.. note:: The backwards compatible import is `pyproj.get_codes`
.. autofunction:: pyproj.database.get_codes
pyproj.database.query_crs_info
-------------------------------
.. autofunction:: pyproj.database.query_crs_info
.. autoclass:: pyproj.database.CRSInfo
pyproj.database.query_utm_crs_info
-----------------------------------
.. autofunction:: pyproj.database.query_utm_crs_info
pyproj.database.get_database_metadata
---------------------------------------
.. autofunction:: pyproj.database.get_database_metadata
pyproj-3.6.1/docs/api/datadir.rst 0000664 0000000 0000000 00000000760 14502715416 0016717 0 ustar 00root root 0000000 0000000 .. _data_directory:
Data Directory
===============
pyproj.datadir.get_data_dir
---------------------------
.. autofunction:: pyproj.datadir.get_data_dir
pyproj.datadir.set_data_dir
---------------------------
.. autofunction:: pyproj.datadir.set_data_dir
pyproj.datadir.append_data_dir
------------------------------
.. autofunction:: pyproj.datadir.append_data_dir
pyproj.datadir.get_user_data_dir
---------------------------------
.. autofunction:: pyproj.datadir.get_user_data_dir
pyproj-3.6.1/docs/api/enums.rst 0000664 0000000 0000000 00000000472 14502715416 0016436 0 ustar 00root root 0000000 0000000 Enumerations
============
.. autoclass:: pyproj.enums.WktVersion
:members:
.. autoclass:: pyproj.enums.ProjVersion
:members:
.. autoclass:: pyproj.enums.TransformDirection
:members:
.. autoclass:: pyproj.enums.PJType
:members:
.. autoclass:: pyproj.enums.GeodIntermediateFlag
:members:
pyproj-3.6.1/docs/api/exceptions.rst 0000664 0000000 0000000 00000000107 14502715416 0017463 0 ustar 00root root 0000000 0000000 Exceptions
==========
.. automodule:: pyproj.exceptions
:members:
pyproj-3.6.1/docs/api/geod.rst 0000664 0000000 0000000 00000000334 14502715416 0016222 0 ustar 00root root 0000000 0000000 Geod
====
pyproj.Geod
-----------
.. autoclass:: pyproj.Geod
:members:
:show-inheritance:
:inherited-members:
:special-members: __init__
.. autoclass:: pyproj.geod.GeodIntermediateReturn
:members:
pyproj-3.6.1/docs/api/global_context.rst 0000664 0000000 0000000 00000001236 14502715416 0020312 0 ustar 00root root 0000000 0000000 .. _global_context:
Global Context
==============
If you have a single-threaded application that generates many objects,
enabling the use of the global context can provide performance enhancements.
.. warning:: The global context is not thread safe.
.. warning:: The global context maintains a connection to the database
through the duration of each python session and is closed
once the program terminates.
How to enable:
- Using :func:`pyproj.set_use_global_context`.
- Using the environment variable `PYPROJ_GLOBAL_CONTEXT`.
pyproj.set_use_global_context
-----------------------------
.. autofunction:: pyproj.set_use_global_context
pyproj-3.6.1/docs/api/index.rst 0000664 0000000 0000000 00000000371 14502715416 0016414 0 ustar 00root root 0000000 0000000 API Documentation
=================
.. toctree::
:maxdepth: 2
:caption: Contents:
crs/index
transformer
geod
proj
database
list
datadir
network
sync
global_context
enums
aoi
exceptions
show_versions
pyproj-3.6.1/docs/api/list.rst 0000664 0000000 0000000 00000001126 14502715416 0016257 0 ustar 00root root 0000000 0000000 Lists
=====
pyproj.list.get_proj_operations_map
-----------------------------------
.. note:: The backwards compatible import is `pyproj.get_proj_operations_map`
.. autofunction:: pyproj.list.get_proj_operations_map
pyproj.list.get_ellps_map
--------------------------
.. note:: The backwards compatible import is `pyproj.get_ellps_map`
.. autofunction:: pyproj.list.get_ellps_map
pyproj.list.get_prime_meridians_map
------------------------------------
.. note:: The backwards compatible import is `pyproj.get_prime_meridians_map`
.. autofunction:: pyproj.list.get_prime_meridians_map
pyproj-3.6.1/docs/api/network.rst 0000664 0000000 0000000 00000000666 14502715416 0017005 0 ustar 00root root 0000000 0000000 .. _network_api:
PROJ Network Settings
======================
pyproj.network.set_network_enabled
-----------------------------------
.. autofunction:: pyproj.network.set_network_enabled
pyproj.network.is_network_enabled
----------------------------------
.. autofunction:: pyproj.network.is_network_enabled
pyproj.network.set_ca_bundle_path
----------------------------------
.. autofunction:: pyproj.network.set_ca_bundle_path
pyproj-3.6.1/docs/api/proj.rst 0000664 0000000 0000000 00000000740 14502715416 0016257 0 ustar 00root root 0000000 0000000 Proj
====
`pyproj.Proj` is functionally equivalent to the `proj` command line tool in PROJ.
The PROJ docs say::
The `proj` program is limited to converting between geographic and
projection coordinates within one datum.
pyproj.Proj
-----------
.. autoclass:: pyproj.Proj
:members:
:inherited-members:
:special-members: __init__, __call__
:show-inheritance:
pyproj.proj.Factors
-------------------
.. autoclass:: pyproj.proj.Factors
:members:
pyproj-3.6.1/docs/api/show_versions.rst 0000664 0000000 0000000 00000000157 14502715416 0020217 0 ustar 00root root 0000000 0000000 Show Versions
=============
pyproj.show_versions
--------------------
.. autofunction:: pyproj.show_versions
pyproj-3.6.1/docs/api/sync.rst 0000664 0000000 0000000 00000000445 14502715416 0016263 0 ustar 00root root 0000000 0000000 Sync Transformation Grids
=========================
pyproj.sync.get_transform_grid_list
------------------------------------
.. autofunction:: pyproj.sync.get_transform_grid_list
pyproj.sync.get_proj_endpoint
------------------------------
.. autofunction:: pyproj.sync.get_proj_endpoint
pyproj-3.6.1/docs/api/transformer.rst 0000664 0000000 0000000 00000002471 14502715416 0017652 0 ustar 00root root 0000000 0000000 .. _transformer:
Transformer
===========
The `pyproj.Transformer` has the capabilities of performing 2D, 3D, and 4D (time)
transformations. It can do anything that the PROJ command line programs
:ref:`proj`, :ref:`cs2cs`, and :ref:`cct` can do.
This means that it allows translation between any pair of definable coordinate systems,
including support for datum transformation.
.. warning:: The axis order may be swapped if the source and destination
CRS's are defined as having the first coordinate component point in a
northerly direction (See PROJ FAQ on
`axis order `_).
You can check the axis order with the :class:`pyproj.crs.CRS` class. If you prefer to
keep your axis order as always x,y, you can use the `always_xy` option when
creating the :class:`pyproj.transformer.Transformer`.
pyproj.Transformer
------------------
.. autoclass:: pyproj.transformer.Transformer
:members:
pyproj.transformer.TransformerGroup
-----------------------------------
.. autoclass:: pyproj.transformer.TransformerGroup
:members:
:special-members: __init__
pyproj.transform
----------------
.. autofunction:: pyproj.transformer.transform
pyproj.itransform
-----------------
.. autofunction:: pyproj.transformer.itransform
pyproj-3.6.1/docs/build_crs.rst 0000664 0000000 0000000 00000012326 14502715416 0016505 0 ustar 00root root 0000000 0000000 Building a Coordinate Reference System
======================================
.. versionadded:: 2.5.0
PROJ strings have the potential to lose much of the information
about a coordinate reference system (CRS).
More information: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
However, PROJ strings make it really simple to construct a CRS.
This addition is meant to simplify the process of transitioning
from the PROJ form of the string to the WKT form WKT. The CRS
classes can be used in the :meth:`pyproj.transformer.Transformer.from_crs`
method just like the :class:`pyproj.crs.CRS` class.
The current set of classes does not cover every possible use case,
but hopefully it is enough to get you started.
If you notice something is missing that you need, feel free to open an issue on GitHub.
Here are links to the API docs for the pieces you need to get started:
- :ref:`crs`
- :ref:`coordinate_operation`
- :ref:`datum`
- :ref:`coordinate_system`
Geographic CRS
--------------
This is a simple example of creating a lonlat projection.
PROJ string::
+proj=longlat +datum=WGS84 +no_defs
.. code-block:: python
from pyproj.crs import GeographicCRS
geog_crs = GeographicCRS()
geog_wkt = geog_crs.to_wkt()
This example is meant to show off different initialization methods.
It can be simplified to not use the Ellipsoid or PrimeMeridian objects.
PROJ string::
+proj=longlat +ellps=airy +pm=lisbon +no_defs
.. code-block:: python
from pyproj.crs import Ellipsoid, GeographicCRS, PrimeMeridian
from pyproj.crs.datum import CustomDatum
cd = CustomDatum(
ellipsoid=Ellipsoid.from_epsg(7001),
prime_meridian=PrimeMeridian.from_name("Lisbon"),
)
geog_crs = GeographicCRS(datum=cd)
geog_wkt = geog_crs.to_wkt()
Projected CRS
-------------
Simple example using defaults.
PROJ string::
+proj=aea +lat_0=0 +lon_0=0 +lat_1=0 +lat_2=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs
.. code-block:: python
from pyproj.crs import ProjectedCRS
from pyproj.crs.coordinate_operation import AlbersEqualAreaConversion
aeaop = AlbersEqualAreaConversion(0, 0)
proj_crs = ProjectedCRS(conversion=aeaop)
crs_wkt = proj_crs.to_wkt()
More complex example with custom parameters.
PROJ string::
+proj=utm +zone=14 +a=6378137 +b=6356752 +pm=lisbon +units=m +no_defs
.. code-block:: python
from pyproj.crs import GeographicCRS, ProjectedCRS
from pyproj.crs.coordinate_operation import UTMConversion
from pyproj.crs.datum import CustomDatum, CustomEllipsoid
ell = CustomEllipsoid(semi_major_axis=6378137, semi_minor_axis=6356752)
cd = CustomDatum(ellipsoid=ell, prime_meridian="Lisbon")
proj_crs = ProjectedCRS(
conversion=UTMConversion(14), geodetic_crs=GeographicCRS(datum=cd)
)
crs_wkt = proj_crs.to_wkt()
Bound CRS
---------
This is an example building a CRS with `towgs84`.
PROJ string::
+proj=tmerc +lat_0=0 +lon_0=15 +k=0.9996 +x_0=2520000 +y_0=0 +ellps=intl +towgs84=-122.74,-34.27,-22.83,-1.884,-3.4,-3.03,-15.62 +units=m +no_defs
.. code-block:: python
from pyproj.crs import BoundCRS, Ellipsoid, GeographicCRS, ProjectedCRS
from pyproj.crs.coordinate_operation import (
TransverseMercatorConversion,
ToWGS84Transformation,
)
from pyproj.crs.datum import CustomDatum
import pyproj
proj_crs = ProjectedCRS(
conversion=TransverseMercatorConversion(
latitude_natural_origin=0,
longitude_natural_origin=15,
false_easting=2520000,
false_northing=0,
scale_factor_natural_origin=0.9996,
),
geodetic_crs=GeographicCRS(
datum=CustomDatum(ellipsoid="International 1924 (Hayford 1909, 1910)")
),
)
bound_crs = BoundCRS(
source_crs=proj_crs,
target_crs="WGS 84",
transformation=ToWGS84Transformation(
proj_crs.geodetic_crs, -122.74, -34.27, -22.83, -1.884, -3.4, -3.03, -15.62
),
)
crs_wkt = bound_crs.to_wkt()
Compound CRS
-------------
The PROJ string is quite lossy in this example, so it is not provided.
.. code-block:: python
from pyproj.crs import CompoundCRS, GeographicCRS, ProjectedCRS, VerticalCRS
from pyproj.crs.coordinate_system import Cartesian2DCS, VerticalCS
from pyproj.crs.coordinate_operation import LambertConformalConic2SPConversion
vertcrs = VerticalCRS(
name="NAVD88 height",
datum="North American Vertical Datum 1988",
vertical_cs=VerticalCS(),
geoid_model="GEOID12B",
)
projcrs = ProjectedCRS(
name="NAD83 / Pennsylvania South",
conversion=LambertConformalConic2SPConversion(
latitude_false_origin=39.3333333333333,
longitude_false_origin=-77.75,
latitude_first_parallel=40.9666666666667,
latitude_second_parallel=39.9333333333333,
easting_false_origin=600000,
northing_false_origin=0,
),
geodetic_crs=GeographicCRS(datum="North American Datum 1983"),
cartesian_cs=Cartesian2DCS(),
)
compcrs = CompoundCRS(
name="NAD83 / Pennsylvania South + NAVD88 height", components=[projcrs, vertcrs]
)
crs_wkt = compcrs.to_wkt()
pyproj-3.6.1/docs/build_crs_cf.rst 0000664 0000000 0000000 00000013155 14502715416 0017156 0 ustar 00root root 0000000 0000000 .. _build_crs_cf:
Managing CRS to and from CF
============================
http://cfconventions.org/cf-conventions/cf-conventions.html
Exporting CRS to CF
--------------------
When exporting a CRS to the Climate and Forecast (CF) conventions,
you need both the grid mapping as well as the coordinate system.
If you don't use the coordinate system, then you will lose the units
of your projection.
In this example, this is the CRS we will use:
.. code-block:: python
from pyproj import CRS
crs = CRS("EPSG:4326")
To get the grid mapping you use :meth:`pyproj.crs.CRS.to_cf`:
.. versionadded:: 2.2.0
.. code-block:: python
cf_grid_mapping = crs.to_cf()
Contents of `cf_grid_mapping`::
{'crs_wkt': 'GEOGCRS["WGS 84",DATUM["World Geodetic System '
....,ID["EPSG",4326]]',
'geographic_crs_name': 'WGS 84',
'grid_mapping_name': 'latitude_longitude',
'inverse_flattening': 298.257223563,
'longitude_of_prime_meridian': 0.0,
'prime_meridian_name': 'Greenwich',
'reference_ellipsoid_name': 'WGS 84',
'semi_major_axis': 6378137.0,
'semi_minor_axis': 6356752.314245179}
To get the coordinate system, you use :meth:`pyproj.crs.CRS.cs_to_cf`:
.. versionadded:: 3.0.0
.. code-block:: python
cf_coordinate_system = crs.cs_to_cf()
Contents of `cf_coordinate_system`::
[{'long_name': 'geodetic latitude coordinate',
'standard_name': 'latitude',
'units': 'degrees_north',
'axis': 'Y'},
{'long_name': 'geodetic longitude coordinate',
'standard_name': 'longitude',
'units': 'degrees_east',
'axis': 'X'}]
Importing CRS from CF
----------------------
When importing a CRS from the Climate and Forecast (CF) conventions,
you need both the grid mapping as well as the coordinate system.
If you don't use the coordinate system, then you will lose the units
of your projection.
.. note:: If the CF `crs_wkt` attribute is available, the coordinate system is
inside of the WKT and can be used to create the CRS in a single step.
.. warning:: If building from grid mapping, be mindful of the axis order. https://github.com/cf-convention/cf-conventions/pull/224
Build the CRS from CF grid mapping:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In this example, this is the grid mapping and coordinate system we will use::
variables:
double x(x) ;
x:standard_name = "projection_x_coordinate" ;
x:long_name = "Easting" ;
x:units = "m" ;
double y(y) ;
y:standard_name = "projection_y_coordinate" ;
y:long_name = "Northing" ;
y:units = "m" ;
int crsOSGB ;
crsOSGB:grid_mapping_name = "transverse_mercator";
crsOSGB:semi_major_axis = 6377563.396 ;
crsOSGB:inverse_flattening = 299.3249646 ;
crsOSGB:longitude_of_prime_meridian = 0.0 ;
crsOSGB:latitude_of_projection_origin = 49.0 ;
crsOSGB:longitude_of_central_meridian = -2.0 ;
crsOSGB:scale_factor_at_central_meridian = 0.9996012717 ;
crsOSGB:false_easting = 400000.0 ;
crsOSGB:false_northing = -100000.0 ;
.. note:: If the units are meters as in this example,
then no further changes are necessary.
.. code-block:: python
from pyproj import CRS
crs = CRS.from_cf(
{
"grid_mapping_name": "transverse_mercator",
"semi_major_axis": 6377563.396,
"inverse_flattening": 299.3249646,
"longitude_of_prime_meridian": 0.0,
"latitude_of_projection_origin": 49.0,
"longitude_of_central_meridian": -2.0,
"scale_factor_at_central_meridian": 0.9996012717,
"false_easting": 400000.0,
"false_northing": -100000.0,
}
)
Modify the CRS with coordinate system:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 3.0.0
.. note:: If the CF `crs_wkt` attribute is available, the coordinate system is
inside of the WKT and can be used to create the CRS in a single step.
.. warning:: Be mindful of the axis order. https://github.com/cf-convention/cf-conventions/pull/224
In this example, assume everything is the same as above.
However, the units are instead `US_Survey_Foot`::
variables:
double x(x) ;
x:standard_name = "projection_x_coordinate" ;
x:long_name = "Easting" ;
x:units = "US_Survey_Foot" ;
double y(y) ;
y:standard_name = "projection_y_coordinate" ;
y:long_name = "Northing" ;
y:units = "US_Survey_Foot" ;
...
In this case, you will need to get the unit conversion factor:
https://github.com/SciTools/cf-units
.. code-block:: python
from cf_units import Unit
from pyproj import CRS
cf_unit = Unit("US_Survey_Foot")
unit = {
"type": "LinearUnit",
"name": "US Survey Foot",
"conversion_factor": cf_unit.convert(1, "m"),
}
cartesian_cs = {
"$schema": "https://proj.org/schemas/v0.2/projjson.schema.json",
"type": "CoordinateSystem",
"subtype": "Cartesian",
"axis": [
{"name": "Easting", "abbreviation": "E", "direction": "east", "unit": unit},
{"name": "Northing", "abbreviation": "N", "direction": "north", "unit": unit},
],
}
crs = CRS.from_cf(
{
"grid_mapping_name": "transverse_mercator",
"semi_major_axis": 6377563.396,
"inverse_flattening": 299.3249646,
"longitude_of_prime_meridian": 0.0,
"latitude_of_projection_origin": 49.0,
"longitude_of_central_meridian": -2.0,
"scale_factor_at_central_meridian": 0.9996012717,
"false_easting": 400000.0,
"false_northing": -100000.0,
},
cartesian_cs=cartesian_cs,
)
pyproj-3.6.1/docs/cli.rst 0000664 0000000 0000000 00000000111 14502715416 0015273 0 ustar 00root root 0000000 0000000 CLI
====
.. argparse::
:ref: pyproj.__main__.parser
:prog: pyproj
pyproj-3.6.1/docs/conf.py 0000775 0000000 0000000 00000003757 14502715416 0015317 0 ustar 00root root 0000000 0000000 import importlib.metadata
import os
# Sphinx extensions
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinxarg.ext",
]
intersphinx_mapping = {
"numpy": ("https://numpy.org/doc/stable/", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
"proj": ("https://proj.org/", None),
"python": ("https://docs.python.org/3", None),
"shapely": ("https://shapely.readthedocs.io/en/stable/", None),
"xarray": ("https://docs.xarray.dev/en/stable/", None),
}
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"
# The master toctree document.
master_doc = "index"
# General information about the project.
project = "pyproj"
copyright = "2006-2018, Jeffrey Whitaker; 2019-2023, Open source contributors"
author = "Jeffrey Whitaker"
version = release = importlib.metadata.version("pyproj")
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "material"
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output -------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = os.getenv("PYPROJ_HTML_THEME", "furo")
html_logo = "media/logo.png"
html_favicon = "media/icon.png"
# Add any paths that contain custom static files (such as style sheets) here,
# html_static_path = ["_static"]
# -- Options for manual page output ------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("cli", "pyproj", "pyproj CLI", [author], 1)]
pyproj-3.6.1/docs/crs_compatibility.rst 0000664 0000000 0000000 00000016532 14502715416 0020262 0 ustar 00root root 0000000 0000000 CRS Compatibility Guide for Geospatial Python
==============================================
This is meant to be a guide to help you along the way of you use :class:`pyproj.crs.CRS`
with other Python Geospatial libraries.
.. note:: WKT2 is the best format for storing your CRS according to the
`PROJ FAQ `__.
osgeo/gdal
----------
https://github.com/osgeo/gdal
Converting from `osgeo.osr.SpatialReference` to `pyproj.crs.CRS`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
from osgeo.osr import SpatialReference
from pyproj.crs import CRS
osr_crs = SpatialReference()
osr_crs.ImportFromEPSG(4326)
if osgeo.version_info.major < 3:
proj_crs = CRS.from_wkt(osr_crs.ExportToWkt())
else:
proj_crs = CRS.from_wkt(osr_crs.ExportToWkt(["FORMAT=WKT2_2018"]))
Converting from `pyproj.crs.CRS` to `osgeo.osr.SpatialReference`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. warning:: WKT2 is only supported in GDAL 3+
.. code-block:: python
import osgeo
from osgeo.osr import SpatialReference
from pyproj.crs import CRS
from pyproj.enums import WktVersion
proj_crs = CRS.from_epsg(4326)
osr_crs = SpatialReference()
if osgeo.version_info.major < 3:
osr_crs.ImportFromWkt(proj_crs.to_wkt(WktVersion.WKT1_GDAL))
else:
osr_crs.ImportFromWkt(proj_crs.to_wkt())
rasterio
--------
https://github.com/mapbox/rasterio
Converting from `rasterio.crs.CRS` to `pyproj.crs.CRS`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you have `rasterio >= 1.0.14`, then you can pass in the `rasterio.crs.CRS`
directly::
import rasterio
import rasterio.crs
from pyproj.crs import CRS
with rasterio.Env(OSR_WKT_FORMAT="WKT2_2018"):
rio_crs = rasterio.crs.CRS.from_epsg(4326)
proj_crs = CRS.from_user_input(rio_crs)
Otherwise, you should use the `wkt` property::
import rasterio.crs
from pyproj.crs import CRS
with rasterio.Env(OSR_WKT_FORMAT="WKT2_2018"):
rio_crs = rasterio.crs.CRS.from_epsg(4326)
proj_crs = CRS.from_wkt(rio_crs.wkt)
Converting from `pyproj.crs.CRS` to `rasterio.crs.CRS`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. warning:: WKT2 is only supported in GDAL 3+
If you have rasterio >= 1.0.26 and GDAL 3+, then you can pass in the `pyproj.crs.CRS`
directly::
import rasterio.crs
from pyproj.crs import CRS
proj_crs = CRS.from_epsg(4326)
rio_crs = rasterio.crs.CRS.from_user_input(proj_crs)
If you want to be compatible across GDAL/rasterio versions, you can do::
from packaging import version
import rasterio
import rasterio.crs
from pyproj.crs import CRS
from pyproj.enums import WktVersion
proj_crs = CRS.from_epsg(4326)
if version.parse(rasterio.__gdal_version__) < version.parse("3.0.0")
rio_crs = rasterio.crs.CRS.from_wkt(proj_crs.to_wkt(WktVersion.WKT1_GDAL))
else:
rio_crs = rasterio.crs.CRS.from_wkt(proj_crs.to_wkt())
fiona
------
https://github.com/Toblerity/Fiona
Converting from `fiona` CRS to `pyproj.crs.CRS`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fiona currently stores the CRS as a PROJ string dictionary in the `crs`
attribute. As such, it is best to use the `crs_wkt` attribute.
It is also useful to know that plans exist to add CRS class.
Related GitHub issue `here `__.
Example::
import fiona
from pyproj.crs import CRS
with fiona.Env(OSR_WKT_FORMAT="WKT2_2018"), fiona.open(...) as fds:
proj_crs = CRS.from_wkt(fds.crs_wkt)
Converting from `pyproj.crs.CRS` for `fiona`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. warning:: WKT2 is only supported in GDAL 3+
If you want to be compatible across GDAL versions, you can do::
from packaging import version
import fiona
from pyproj.crs import CRS
proj_crs = CRS.from_epsg(4326)
if version.parse(fiona.__gdal_version__) < version.parse("3.0.0"):
fio_crs = proj_crs.to_wkt(WktVersion.WKT1_GDAL)
else:
# GDAL 3+ can use WKT2
fio_crs = dc_crs.to_wkt()
# with fiona.open(..., "w", crs_wkt=fio_crs) as fds:
# ...
geopandas
---------
https://github.com/geopandas/geopandas
Also see the `geopandas guide for upgrading to use pyproj CRS class `__
Preparing `pyproj.crs.CRS` for `geopandas`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
import fiona
import geopandas
from pyproj.crs import CRS
from pyproj.enums import WktVersion
proj_crs = CRS.from_epsg(4326)
if version.parse(geopandas.__version__) >= version.parse("0.7.0"):
# geopandas uses pyproj.crs.CRS
geo_crs = proj_crs
elif version.parse(geopandas.__version__) >= version.parse("0.6.0"):
# this version of geopandas uses always_xy=True so WKT version is safe
if version.parse(fiona.__gdal_version__) < version.parse("3.0.0"):
geo_crs = proj_crs.to_wkt(WktVersion.WKT1_GDAL)
else:
# GDAL 3+ can use WKT2
geo_crs = dc_crs.to_wkt()
else:
geo_crs = dc_crs.to_proj4()
`geopandas` to `pyproj.crs.CRS`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:meth:`pyproj.crs.CRS.from_user_input` can handle anything across the `geopandas`
versions. The only gotcha would be if it is `None`.
.. code-block:: python
import geopandas
from pyproj.crs import CRS
gdf = geopandas.read_file(...)
proj_crs = CRS.from_user_input(gdf.crs)
cartopy
-------
https://github.com/SciTools/cartopy
.. note:: These examples require cartopy 0.20+
Preparing `pyproj.crs.CRS` for `cartopy.crs.CRS`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. warning:: This only works for CRS created with WKT2,
PROJ JSON, or a spatial reference ID (i.e. EPSG)
with the area of use defined. Otherwise,
the x_limits and y_limits will not work.
.. code-block:: python
import cartopy.crs as ccrs
from pyproj.crs import CRS
# geographic
proj_crs = CRS.from_epsg(4326)
cart_crs = ccrs.CRS(proj_crs)
# projected
proj_crs = CRS.from_epsg(6933)
cart_crs = ccrs.Projection(proj_crs)
Preparing `cartopy.crs.CRS` for `pyproj.crs.CRS`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note:: `cartopy.crs.CRS` inherits from `pyproj.crs.CRS`,
so it should behave like a `pyproj.crs.CRS`.
.. code-block:: python
from cartopy.crs import PlateCarree
from pyproj.crs import CRS
cart_crs = PlateCarree()
proj_crs = CRS.from_user_input(cart_crs)
pycrs
-----
https://github.com/karimbahgat/PyCRS
.. warning:: Currently does not support WKT2
Preparing `pyproj.crs.CRS` for `pycrs`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
import pycrs
from pyproj.crs import CRS
proj_crs = CRS.from_epsg(4326)
py_crs = pycrs.parse.from_ogc_wkt(proj_crs.to_wkt("WKT1_GDAL"))
Preparing `cartopy.crs.CRS` for `pyproj.crs.CRS`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
import pycrs
from pyproj.crs import CRS
py_crs = pycrs.parse.from_epsg_code(4326)
proj_crs = CRS.from_wkt(py_crs.to_ogc_wkt())
pyproj-3.6.1/docs/examples.rst 0000664 0000000 0000000 00000036526 14502715416 0016365 0 ustar 00root root 0000000 0000000 .. _examples:
Getting Started
===============
There are examples of usage within the API documentation and tests. This
section is to demonstrate recommended usage.
Also see: :ref:`gotchas`
Using CRS
---------
For more usage examples and documentation see :class:`pyproj.crs.CRS`.
Initializing CRS
~~~~~~~~~~~~~~~~
The :class:`pyproj.crs.CRS` class can be initialized in many different ways.
Here are some examples of initialization.
.. code:: python
>>> from pyproj import CRS
>>> crs = CRS.from_epsg(4326)
>>> crs = CRS.from_string("EPSG:4326")
>>> crs = CRS.from_proj4("+proj=latlon")
>>> crs = CRS.from_user_input(4326)
Converting CRS to a different format
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. warning:: You will likely lose important projection
information when converting to a PROJ string from
another format. See: https://proj4.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
.. code:: python
>>> from pyproj import CRS
>>> crs = CRS.from_epsg(4326)
>>> crs.to_epsg()
4326
>>> crs.to_authority()
('EPSG', '4326')
>>> crs = CRS.from_proj4("+proj=omerc +lat_0=-36 +lonc=147 +alpha=-54 +k=1 +x_0=0 +y_0=0 +gamma=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0")
>>> crs
Name: unknown
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- undefined
Coordinate Operation:
- name: Transformation from unknown to WGS84
- method: Position Vector transformation (geog2D domain)
Datum: Unknown based on WGS84 ellipsoid
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
Source CRS: unknown
>>> print(crs.to_wkt(pretty=True))
BOUNDCRS[
SOURCECRS[
PROJCRS["unknown",
BASEGEOGCRS["unknown",
DATUM["Unknown based on WGS84 ellipsoid",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1],
ID["EPSG",7030]]],
...
PARAMETER["Z-axis rotation",0,
ID["EPSG",8610]],
PARAMETER["Scale difference",1,
ID["EPSG",8611]]]]
>>> from pyproj.enums import WktVersion
>>> print(crs.to_wkt(WktVersion.WKT1_GDAL, pretty=True))
PROJCS["unknown",
GEOGCS["unknown",
DATUM["Unknown_based_on_WGS84_ellipsoid",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
TOWGS84[0,0,0,0,0,0,0]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]]],
PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],
PARAMETER["latitude_of_center",-36],
PARAMETER["longitude_of_center",147],
PARAMETER["azimuth",-54],
PARAMETER["rectified_grid_angle",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH]]
>>> from pprint import pprint
>>> pprint(crs.to_cf())
{'azimuth_of_central_line': -54,
'crs_wkt': 'BOUNDCRS[SOURCECRS[PROJCRS["unknown",BASEGEOGCRS["unknown",DATUM["Unknown '
...
'difference",1,ID["EPSG",8611]]]]',
'false_easting': 0.0,
'false_northing': 0.0,
'grid_mapping_name': 'oblique_mercator',
'horizontal_datum_name': 'Unknown based on WGS84 ellipsoid',
'inverse_flattening': 298.257223563,
'latitude_of_projection_origin': -36.0,
'longitude_of_prime_meridian': 0.0,
'longitude_of_projection_origin': 147.0,
'prime_meridian_name': 'Greenwich',
'reference_ellipsoid_name': 'WGS 84',
'scale_factor_at_projection_origin': 1.0,
'semi_major_axis': 6378137.0,
'semi_minor_axis': 6356752.314245179,
'towgs84': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]}
Extracting attributes from CRS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are many attributes you can pull from the :class:`pyproj.crs.CRS`.
This is just a small subset of what is available.
.. code:: python
>>> crs = CRS("urn:ogc:def:crs,crs:EPSG::2393,crs:EPSG::5717")
>>> crs
Name: KKJ / Finland Uniform Coordinate System + N60 height
Axis Info [cartesian|vertical]:
- X[north]: Northing (metre)
- Y[east]: Easting (metre)
- H[up]: Gravity-related height (metre)
Area of Use:
- undefined
Datum: Kartastokoordinaattijarjestelma (1966)
- Ellipsoid: International 1924
- Prime Meridian: Greenwich
Sub CRS:
- KKJ / Finland Uniform Coordinate System
- N60 height
>>> crs.sub_crs_list
[
Name: KKJ / Finland Uniform Coordinate System
Axis Info [cartesian]:
- X[north]: Northing (metre)
- Y[east]: Easting (metre)
Area of Use:
- name: Finland - 25.5°E to 28.5°E onshore. Also all country.
- bounds: (19.24, 59.75, 31.59, 70.09)
Coordinate Operation:
- name: Finland Uniform Coordinate System
- method: Transverse Mercator
Datum: Kartastokoordinaattijarjestelma (1966)
- Ellipsoid: International 1924
- Prime Meridian: Greenwich
,
Name: N60 height
Axis Info [vertical]:
- H[up]: Gravity-related height (metre)
Area of Use:
- name: Finland - onshore.
- bounds: (19.24, 59.75, 31.59, 70.09)
Datum: Helsinki 1960
- Ellipsoid: undefined
- Prime Meridian: undefined
]
>>> cop = crs.sub_crs_list[0].coordinate_operation
>>> print(cop.to_wkt(pretty=True))
CONVERSION["Finland Uniform Coordinate System",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",27,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",1,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",3500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]]
>>> cop.method_code
'9807'
>>> cop.method_name
'Transverse Mercator'
>>> cop.params
[Param(name=Latitude of natural origin, auth_name=EPSG, code=8801, value=0.0, unit_name=degree, unit_auth_name=, unit_code=, unit_category=angular),
...
Param(name=False northing, auth_name=EPSG, code=8807, value=0.0, unit_name=metre, unit_auth_name=, unit_code=, unit_category=linear)]
Find UTM CRS by Latitude and Longitude
---------------------------------------
.. note:: For more database methods see: :ref:`database`.
.. code-block:: python
from pyproj import CRS
from pyproj.aoi import AreaOfInterest
from pyproj.database import query_utm_crs_info
utm_crs_list = query_utm_crs_info(
datum_name="WGS 84",
area_of_interest=AreaOfInterest(
west_lon_degree=-93.581543,
south_lat_degree=42.032974,
east_lon_degree=-93.581543,
north_lat_degree=42.032974,
),
)
utm_crs = CRS.from_epsg(utm_crs_list[0].code)
Transformations from CRS to CRS
-------------------------------
Step 1: Inspect CRS definition to ensure proper area of use and axis order
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For more options available for inspection, usage examples,
and documentation see :class:`pyproj.crs.CRS`.
.. code:: python
>>> from pyproj import CRS
>>> crs_4326 = CRS.from_epsg(4326)
>>> crs_4326
Name: WGS 84
Axis Info [ellipsoidal]:
- Lat[north]: Geodetic latitude (degree)
- Lon[east]: Geodetic longitude (degree)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
>>> crs_26917 = CRS.from_epsg(26917)
>>> crs_26917
Name: NAD83 / UTM zone 17N
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: North America - 84°W to 78°W and NAD83 by country
- bounds: (-84.0, 23.81, -78.0, 84.0)
Coordinate Operation:
- name: UTM zone 17N
- method: Transverse Mercator
Datum: North American Datum 1983
- Ellipsoid: GRS 1980
- Prime Meridian: Greenwich
Note that `crs_4326` has the latitude (north) axis first and the `crs_26917`
has the easting axis first. This means that in the transformation, we will need
to input the data with latitude first and longitude second. Also, note that the
second projection is a UTM projection with bounds (-84.0, 23.81, -78.0, 84.0) which
are in the form (min_x, min_y, max_x, max_y), so the transformation input/output should
be within those bounds for best results.
Step 2: Create Transformer to convert from CRS to CRS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The :class:`pyproj.transformer.Transformer` can be initialized with anything supported
by :meth:`pyproj.crs.CRS.from_user_input`. There are a couple of examples added
here for demonstration. For more usage examples and documentation,
see :class:`pyproj.transformer.Transformer`.
.. code:: python
>>> from pyproj import Transformer
>>> transformer = Transformer.from_crs(crs_4326, crs_26917)
>>> transformer = Transformer.from_crs(4326, 26917)
>>> transformer = Transformer.from_crs("EPSG:4326", "EPSG:26917")
>>> transformer
Inverse of NAD83 to WGS 84 (1) + UTM zone 17N
>>> transformer.transform(50, -80)
(571666.4475041276, 5539109.815175673)
If you prefer to always have the axis order in the x,y or lon,lat order,
you can use the `always_xy` option when creating the transformer.
.. code:: python
>>> from pyproj import Transformer
>>> transformer = Transformer.from_crs("EPSG:4326", "EPSG:26917", always_xy=True)
>>> transformer.transform(-80, 50)
(571666.4475041276, 5539109.815175673)
Converting between geographic and projection coordinates within one datum
-------------------------------------------------------------------------
Step 1: Retrieve the geodetic CRS based on original CRS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> from pyproj import CRS
>>> crs = CRS.from_epsg(3857)
>>> crs
Name: WGS 84 / Pseudo-Mercator
Axis Info [cartesian]:
- X[east]: Easting (metre)
- Y[north]: Northing (metre)
Area of Use:
- name: World - 85°S to 85°N
- bounds: (-180.0, -85.06, 180.0, 85.06)
Coordinate Operation:
- name: Popular Visualisation Pseudo-Mercator
- method: Popular Visualisation Pseudo Mercator
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
>>> crs.geodetic_crs
Name: WGS 84
Axis Info [ellipsoidal]:
- Lat[north]: Geodetic latitude (degree)
- Lon[east]: Geodetic longitude (degree)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
Step 2: Create Transformer to convert from geodetic CRS to CRS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> proj = Transformer.from_crs(crs.geodetic_crs, crs)
>>> proj
Popular Visualisation Pseudo-Mercator
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
>>> proj.transform(12, 15)
(1669792.3618991035, 1345708.4084091093)
4D Transformations with Time
----------------------------
.. note:: If you are doing a transformation with a CRS that is time based,
it is recommended to include the time in the transformation operation.
.. code:: python
>>> transformer = Transformer.from_crs(7789, 8401)
>>> transformer
ITRF2014 to ETRF2014 (1)
>>> transformer.transform(xx=3496737.2679, yy=743254.4507, zz=5264462.9620, tt=2019.0)
(3496737.757717311, 743253.9940103051, 5264462.701132784, 2019.0)
Geodesic calculations
---------------------
This is useful if you need to calculate the distance between two
points or the area of a geometry on Earth's surface.
For more examples of usage and documentation, see :class:`pyproj.Geod`.
Creating Geod class
~~~~~~~~~~~~~~~~~~~
This example demonstrates creating a :class:`pyproj.Geod` using an
ellipsoid name as well as deriving one using a :class:`pyproj.crs.CRS`.
.. code:: python
>>> from pyproj import CRS, Geod
>>> geod_clrk = Geod(ellps='clrk66') # Use Clarke 1866 ellipsoid.
>>> geod_clrk
Geod(ellps='clrk66')
>>> geod_wgs84 = CRS("EPSG:4326").get_geod()
>>> geod_wgs84
Geod('+a=6378137 +f=0.0033528106647475126')
Geodesic line length
~~~~~~~~~~~~~~~~~~~~
Calculate the geodesic length of a line (See: :meth:`pyproj.Geod.line_length`):
.. code:: python
>>> from pyproj import Geod
>>> lats = [-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7,
... -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7]
>>> lons = [-74, -102, -102, -131, -163, 163, 172, 140, 113,
... 88, 59, 25, -4, -14, -33, -46, -61]
>>> geod = Geod(ellps="WGS84")
>>> total_length = geod.line_length(lons, lats)
>>> f"{total_length:.3f}"
'14259605.611'
Calculate the geodesic length of a shapely geometry (See: :meth:`pyproj.Geod.geometry_length`):
.. code:: python
>>> from pyproj import Geod
>>> from shapely.geometry import Point, LineString
>>> line_string = LineString([Point(1, 2), Point(3, 4)]))
>>> geod = Geod(ellps="WGS84")
>>> total_length = geod.geometry_length(line_string)
>>> f"{total_length:.3f}"
'313588.397'
Geodesic area
~~~~~~~~~~~~~
Calculate the geodesic area and perimeter of a polygon (See: :meth:`pyproj.Geod.polygon_area_perimeter`):
.. code:: python
>>> from pyproj import Geod
>>> geod = Geod('+a=6378137 +f=0.0033528106647475126')
>>> lats = [-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7,
... -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7]
>>> lons = [-74, -102, -102, -131, -163, 163, 172, 140, 113,
... 88, 59, 25, -4, -14, -33, -46, -61]
>>> poly_area, poly_perimeter = geod.polygon_area_perimeter(lons, lats)
>>> f"{poly_area:.3f} {poly_perimeter:.3f}"
'13376856682207.406 14710425.407'
Calculate the geodesic area and perimeter of a shapely polygon (See: :meth:`pyproj.Geod.geometry_area_perimeter`):
.. code:: python
>>> from pyproj import Geod
>>> from shapely.geometry import LineString, Point, Polygon
>>> geod = Geod('+a=6378137 +f=0.0033528106647475126')
>>> poly_area, poly_perimeter = geod.geometry_area_perimeter(
Polygon(
LineString([Point(1, 1), Point(1, 10), Point(10, 10), Point(10, 1)]),
holes=[LineString([Point(1, 2), Point(3, 4), Point(5, 2)])],
)
)
>>> f"{poly_area:.3f} {poly_perimeter:.3f}"
'-944373881400.339 3979008.036'
pyproj-3.6.1/docs/gotchas.rst 0000664 0000000 0000000 00000022365 14502715416 0016173 0 ustar 00root root 0000000 0000000 .. _gotchas:
Gotchas/FAQ
===========
This is a page for some suggestions, gotchas, and FAQs.
Also see:
- :ref:`examples`
- :ref:`PROJ FAQ `
What are the best formats to store the CRS information?
--------------------------------------------------------
In general, `Well-Known Text (WKT) `__
or `Spatial Reference ID
(SRID) `__, such as EPSG
codes, are the preferred formats to describe a CRS.
.. note:: WKT2 is preferred over WKT1.
PROJ strings can be lossy for storing CRS information.
If you can avoid it, it is best to not use them.
Additionally, PROJ strings will likely not be supported
in future major version of PROJ for storing CRS information.
More info: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
Axis order changes in PROJ 6+
-----------------------------
- https://proj.org/faq.html#why-is-the-axis-ordering-in-proj-not-consistent
- See warning at the top of :ref:`transformer`
- Examples of how to handle it: :ref:`examples`
- :ref:`min_confidence`
`+init=:` should be replaced with `:`
-----------------------------------------------------------------------
The `+init=:` syntax is deprecated and will be removed
in future versions of PROJ. Also, if you use the `+init` syntax,
you may have problems initializing projections when the other syntax works.
.. code-block:: python
>>> from pyproj import CRS
>>> CRS("ESRI:54009")
Name: World_Mollweide
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Coordinate Operation:
- name: World_Mollweide
- method: Mollweide
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
>>> CRS("+init=ESRI:54009")
...
pyproj.exceptions.CRSError: Invalid projection: +init=ESRI:54009 +type=crs: (Internal Proj Error: proj_create: cannot expand +init=ESRI:54009 +type=crs)
Proj (Not a generic latitude/longitude to projection converter)
---------------------------------------------------------------
:class:`pyproj.Proj` is limited to converting between geographic and
projection coordinates within one datum. If you have coordinates in latitude
and longitude, and you want to convert it to your projection, it is recommended
to use the :class:`pyproj.transformer.Transformer` as it takes into account datum
shifts.
You likely want to start from `EPSG:4326` (WGS84) for coordinates as
latitude and longitude.
.. code-block:: python
>>> from pyproj import CRS
>>> crs_4326 = CRS("WGS84")
>>> crs_4326
Name: WGS 84
Axis Info [ellipsoidal]:
- Lat[north]: Geodetic latitude (degree)
- Lon[east]: Geodetic longitude (degree)
Area of Use:
- name: World
- bounds: (-180.0, -90.0, 180.0, 90.0)
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich
Then, use the :class:`pyproj.transformer.Transformer` to transform from latitude
and longitude to your projection as you might have a projection with a different
datum.
.. code-block:: python
>>> crs_proj = CRS("EPSG:28992")
>>> crs_proj
Name: Amersfoort / RD New
Axis Info [cartesian]:
- X[east]: Easting (metre)
- Y[north]: Northing (metre)
Area of Use:
- name: Netherlands - onshore.
- bounds: (3.2, 50.75, 7.22, 53.7)
Coordinate Operation:
- name: RD New
- method: Oblique Stereographic
Datum: Amersfoort
- Ellipsoid: Bessel 1841
- Prime Meridian: Greenwich
>>> crs_proj.datum == crs_4326.datum
False
>>> from pyproj import Transformer
>>> transformer = Transformer.from_crs(crs_4326, crs_proj)
>>> transformer.transform(52.067567, 5.068913)
(133175.3690698233, 453300.86739169655)
If you use :class:`pyproj.Proj`, it will use the geodetic CRS with
from the projected CRS with the same datum to do the transformation,
which may not be what you want.
.. code-block:: python
>>> from pyproj import Proj
>>> Proj('epsg:28992')(5.068913, 52.067567)
(133148.22970574044, 453192.24450392975)
>>> transg = Transformer.from_crs(crs_proj.geodetic_crs, crs_proj)
>>> transg.transform(52.067567, 5.068913)
(133148.22970574044, 453192.24450392975)
.. _min_confidence:
Why does the EPSG code return when using `EPSG:xxxx` and not with `+init=EPSG:xxxx`?
------------------------------------------------------------------------------------
From: https://gis.stackexchange.com/a/326919/144357
The reason that the EPSG code does not appear with the CRS initialized with
the `init=` syntax is that the CRS are different.
.. code-block:: python
>>> from pyproj import CRS
>>> crs_deprecated = CRS(init="epsg:4544")
>>> crs = CRS("EPSG:4544")
>>> crs == crs_deprecated
False
Upon further inspection of the `Axis Info` section, you can see that the difference
is in the **axis order**.
.. code-block:: python
>>> crs_deprecated
Name: CGCS2000 / 3-degree Gauss-Kruger CM 105E
Axis Info [cartesian]:
- E[east]: Easting (metre)
- N[north]: Northing (metre)
Area of Use:
- name: China - 103.5°E to 106.5°E
- bounds: (103.5, 22.5, 106.5, 42.21)
Coordinate Operation:
- name: Gauss-Kruger CM 105E
- method: Transverse Mercator
Datum: China 2000
- Ellipsoid: CGCS2000
- Prime Meridian: Greenwich
>>> crs
Name: CGCS2000 / 3-degree Gauss-Kruger CM 105E
Axis Info [cartesian]:
- X[north]: Northing (metre)
- Y[east]: Easting (metre)
Area of Use:
- name: China - 103.5°E to 106.5°E
- bounds: (103.5, 22.5, 106.5, 42.21)
Coordinate Operation:
- name: Gauss-Kruger CM 105E
- method: Transverse Mercator
Datum: China 2000
- Ellipsoid: CGCS2000
- Prime Meridian: Greenwich
The reason the `min_confidence` parameter in
:meth:`pyproj.crs.CRS.to_epsg` and :meth:`pyproj.crs.CRS.to_authority`
exists is because you can initialize a CRS in several different methods and
some of them do not always correspond to an EPSG or authortiy code, but it
can be close enough.
For example, if you have a WKT/PROJ string and you use it to create the CRS instance,
in most cases you want to be sure that the EPSG code given by to_epsg will give you a
CRS instance similar to the one created by the WKT/PROJ string.
However, if an EPSG code does not exist that matches you WKT/PROJ string with
a `min_confidence` you don't want to get that EPSG code back as it will make
you think that the WKT/PROJ string and the EPSG code are one and the same when
they are not.
However, if you are only wanting to get the EPSG code that is closest
to the PROJ/WKT string, then you can reduce your min_confidence to a
threshold you are comfortable with.
Here is an example of that:
.. code-block:: python
>>> crs_deprecated = CRS("+init=epsg:4326")
>>> crs_deprecated.to_epsg(100)
>>> crs_deprecated.to_epsg(70)
>>> crs_deprecated.to_epsg(20)
4326
>>> crs_latlon = CRS("+proj=latlon")
>>> crs_latlon.to_epsg(100)
>>> crs_latlon.to_epsg(70)
4326
>>> crs_epsg = CRS.from_epsg(4326)
>>> crs_epsg.to_epsg(100)
4326
>>> crs_wkt = CRS(crs_epsg.to_wkt())
>>> crs_wkt.to_epsg(100)
4326
>>> crs_wkt == crs_epsg
True
>>> crs_epsg == crs_latlon
False
>>> crs_epsg == crs_deprecated
False
Internal PROJ Error ... SQLite error on SELECT
----------------------------------------------
The PROJ database is based on the EPSG database. With each release,
there is a good chance that there are database updates. If you have multiple
versions of PROJ installed on your systems and the search path for
the data directory becomes mixed up, you may see an error message like:
`SQLite error on SELECT`. This is likely due to a version of PROJ
attempting to use an incompatible database.
Debugging tips:
- To get data directory being used: :func:`pyproj.datadir.get_data_dir`
- The order for searching for the data directory can be found in
the docstrings of :func:`pyproj.datadir.get_data_dir`
- To change the data directory: :func:`pyproj.datadir.set_data_dir`
.. _upgrade_transformer:
Upgrading to pyproj 2 from pyproj 1
-----------------------------------
We recommended using the :class:`pyproj.transformer.Transformer` and
:class:`pyproj.crs.CRS` in place of the :class:`pyproj.Proj` and
:meth:`pyproj.transformer.transform`.
Also see:
- :ref:`examples`
- :ref:`optimize_transformations`
.. warning:: :meth:`pyproj.transformer.transform` and :meth:`pyproj.transformer.itransform`
are deprecated.
pyproj 1 style:
>>> from functools import partial
>>> from pyproj import Proj, transform
>>> proj_4326 = Proj(init="epsg:4326")
>>> proj_3857 = Proj(init="epsg:3857")
>>> transformer = partial(transform, proj_4326, proj_3857)
>>> transformer(12, 12)
pyproj 2 style:
>>> from pyproj import Transformer
>>> transformer = Transformer.from_crs("EPSG:4326", "EPSG:3857")
>>> transformer.transform(12, 12)
pyproj-3.6.1/docs/history.rst 0000664 0000000 0000000 00000063757 14502715416 0016256 0 ustar 00root root 0000000 0000000 Change Log
==========
3.6.1
------
- WHL: Wheels contain PROJ 9.3.0 (issue #1327)
- BUG: Remove pkg_resources from setup.py (issue #1313)
- BUG: Cython 3 compatibility fixes (issue #1321)
3.6.0
------
- DEP: Minimum supported Python version 3.9 (issue #1111)
- WHL: Wheels contain PROJ 9.2.1 (pull #1291)
- ENH: Added allow_superseded kwargs to :class:`pyproj.transformer.TransformerGroup` (pull #1269)
- ENH: Added :meth:`CRS.to_2d` to demote 3D CRS to 2D (issue #1266)
- ENH: Added parameter `output_axis_rule` to :meth:`CRS.to_wkt` (pull #1287)
- BUG: fix Geod.npts NaN handling (issue #1282)
3.5.0
------
- DEP: Minimum PROJ version 9.0 (issue #1223)
- WHL: PROJ 9.2 in wheels (pull #1243)
- ENH: Add `return_back_azimuth: bool` to allow compatibility between the azimuth output of the following functions (issue #1163):
`fwd` and `fwd_intermediate`, `inv` and `inv_intermediate`,
Note: BREAKING CHANGE for the default value `return_back_azimuth=True` in the functions `fwd_intermediate` and `inv_intermediate`
to mach the default value in `fwd` and `inv`
- ENH: Added only_best kwarg to :meth:`.Transformer.from_crs` (issue #1228)
- PERF: Optimize point transformations (pull #1204)
- PERF: Optimize for single point in Geod fwd/inv functions (pull #1206)
- REF: Raise error when :meth:`.CRS.to_wkt`, :meth:`.CRS.to_json`, or :meth:`.CRS.to_proj4` returns None (issue #1036)
- CLN: Remove `AzumuthalEquidistantConversion` & :class:`LambertAzumuthalEqualAreaConversion`. :class:`AzimuthalEquidistantConversion` & :class:`LambertAzimuthalEqualAreaConversion` should be used instead (pull #1219)
- BUG: Fix Derived Projected CRS support (issue #1182)
- BUG: Add horizontal_datum_name for geographic CRS in :meth:`.CRS.to_cf` (issue #1251)
- BUG: Add datum ensemble support to :class:`.GeographicCRS` (pull #1255)
3.4.1
-----
- WHL: Add win32 to build_wheels matrix (pull #1169)
- BUG: Changed so that the setup.cfg depends on the version code in the __init__.py instead of the other way around (issuue #1155)
- BUG: Fix :meth:`.CRS.to_cf` for Pole rotation GRIB convention (pull #1167)
- BUG: Fix :meth:`.CRS.to_authority` memory leak (pull #1178)
- REF: Use upper case EPSG code when creating CRS (pull #1162)
3.4.0
-----
- WHL: Python 3.11 Wheels (issue #1110)
- WHL: Wheels contain PROJ 9.1.0 (pull #1132)
- DEP: Minimum PROJ version 8.2 (issue #1011)
- BUG: Fix transformer list for 3D transformations in :class:`.TransformerGroup` (discussion #1072)
- ENH: Added authority, accuracy, and allow_ballpark kwargs to :class:`.TransformerGroup` (pull #1076)
- ENH: Added ``force_over`` kwarg to :meth:`.Transformer.from_crs` (issue #997)
- ENH: Added :meth:`.Transformer.get_last_used_operation` (issue #1071)
- CLN: Remove deprecated ``skip_equivalent`` kwarg from transformers and ``errcheck`` kwarg from :meth:`.CRS.from_cf` (pull #1077)
- REF: use regex to process PROJ strings in :meth:`.CRS.to_dict` (pull #1086)
- BUG: :class:`.MercatorAConversion` defined only for lat_0 = 0 (issue #1089)
- BUG: Add support for `PROJ_DATA` environment variable (issue #1097)
- BUG: Ensure numpy masked arrays stay masked after projection (issue #1102)
- BLD: Don't specify runtime_library_dirs on Cygwin (pull #1120)
- BUG: Fix finding PROJ version with PROJ_LIB and PROJ 9.1+ (issue #1127)
3.3.1
-------
- WHL: Wheels for Linux are manylinux2014 (pip 19.3+)
- BUG: Complete database stub file with query_utm_crs_info() signature (issue #1044)
- BUG: Reorder deps in show_versions for setuptools issue (issue #1017)
- BUG: remove CustomConstructorCRS @abstractmethod decorator (pull #1018)
- BUG: Correct type annotation for AreaofUse.bounds (issue #1012)
- BUG: :func:`pyproj.datadir.get_data_dir` support for conda Windows (issue #1029)
- ENH: warn when :meth:`pyproj.crs.CRS.to_wkt`, :meth:`pyproj.crs.CRS.to_proj4`, or :meth:`pyproj.crs.CRS.to_json()` returns None (issue #1036)
- ENH: Added support for int-like strings and numpy dtypes (issues #1026 and #1835)
- ENH: Added support to pickle :class:`pyproj.transformer.Transformer` (issues #1058)
3.3.0
-------
- WHL: Wheels contain PROJ 8.2.0
- DEP: Minimum supported Python version 3.8 (issue #930)
- DEP: Minimum PROJ version 8.0 (issue #940)
- BUG: Prepend "Derived" to CRS type name if CRS is derived (issue #932)
- BUG: Improved handling of inf values in :meth:`pyproj.transformer.Transformer.transform_bounds` (pull #961)
- BUG: CRS CF conversions mismatch of PROJ parameters in rotated pole (issue #948)
- ENH: Add support for transforming bounds at the poles in :meth:`pyproj.transformer.Transformer.transform_bounds` (pull #962)
- ENH: Added :attr:`pyproj.transformer.Transformer.source_crs` & :attr:`pyproj.transformer.Transformer.target_crs` (pull #976)
- ENH: Added :class:`pyproj.crs.coordinate_operation.PoleRotationNetCDFCFConversion` (issue #948)
- ENH: Added :func:`pyproj.database.get_database_metadata` (issue #990)
- ENH: Added PROJ database metadata to :func:`pyproj.show_versions` (issue #990)
3.2.1
------
- REF: declare specific python types in cython (pull #928)
- REF: Use cython string decoding (pull #929)
- BUG: Return multiple authorities with :attr:`pyproj.crs.CRS.list_authority` (pull #943)
- BUG: CRS CF conversions ensure lon_0 = north_pole_grid_longitude + 180 (issue #927)
- BUG: CRS CF conversions ensure Pole rotation (netCDF CF convention) conversion works (issue #927)
3.2.0
------
- WHL: Wheels contain PROJ 8.1.1
- DOC: Add new pyproj logo (issue #700)
- REF: Handle deprecation of proj_context_set_autoclose_database (issue #866)
- REF: Make CRS methods inheritable (issue #847)
- ENH: Added :attr:`pyproj.crs.CRS.is_derived` (pull #902)
- ENH: Added :attr:`pyproj.crs.GeocentricCRS` (pull #903)
- ENH: Added :attr:`pyproj.crs.CRS.list_authority` (issue #918)
- ENH: Added `inplace` kwarg to :meth:`pyproj.transformer.Transformer.transform` (issue #906)
- PERF: Disable unnecessary copy in dtype conversion for buffer (pull #904)
- DOC: Improve FAQ text about CRS formats (issue #789)
- BUG: Add PyPy cython array implementation (issue #854)
- BUG: Fix spelling for
:class:`pyproj.crs.coordinate_operation.AzimuthalEquidistantConversion`
and :class:`pyproj.crs.coordinate_operation.LambertAzimuthalEqualAreaConversion` (issue #882)
- BUG: Make datum name match exact in :func:`pyproj.database.query_utm_crs_info` (pull #887)
- BUG: Update :class:`pyproj.enums.GeodIntermediateFlag` for future Python compatibility (issue #855)
- BUG: Hide unnecessary PROJ ERROR from proj_crs_get_coordoperation (issue #873)
- BUG: Fix pickling for CRS builder classes (issue #897)
- CLN: Remove `ignore_axis_order` kwarg from :meth:`pyproj.crs.CRS.is_exact_same` as it was added by accident (pull #904)
- CLN: remove numeric/numarrays support (pull #908)
- LNT: Add pylint & address issues (pull #909)
- DEP: Remove distutils dependency (pull #917)
3.1.0
-----
* WHL: Wheels contain PROJ 8.0.1
* DEP: Minimum supported Python version 3.7 (issue #790)
* REF: Multithread safe CRS, Proj, & Transformer (issue #782)
* BUG: Disallow NaN values with AreaOfInterest & BBox (issue #788)
* ENH: Pretty format PROJ string support (issue #764)
* ENH: Added :meth:`pyproj.transformer.Transformer.to_proj4` (pull #798)
* ENH: Added authority, accuracy, and allow_ballpark kwargs to :meth:`pyproj.transformer.Transformer.from_crs` (issue #754)
* ENH: Added support for "AUTH:CODE" input to :meth:`pyproj.transformer.Transformer.from_pipeline` (issue #755)
* ENH: Added :meth:`pyproj.crs.CRS.to_3d` (pull #808)
* ENH: Added :meth:`pyproj.transformer.Transformer.transform_bounds` (issue #809)
* ENH: Added :attr:`pyproj.crs.CRS.is_compound` (pull #823)
* ENH: Added `initial_idx` and `terminal_index` kwargs to :meth:`pyproj.Geod.npts` (pull #841)
* ENH: Added :meth:`pyproj.Geod.inv_intermediate` & :meth:`pyproj.Geod.fwd_intermediate` (pull #841)
* REF: Skip transformations if `noop` & deprecate `skip_equivalent` (pull #824)
3.0.1
-----
* WHL: Wheels contain PROJ 7.2.1
* Use `proj_context_errno_string` in PROJ 8+ due to deprecation (issue #760)
* BUG: Allow transformations with empty arrays (issue #766)
* BUG: support numpy objects in CRS.from_cf (issue #773)
3.0.0
-----
* Minimum supported Python version 3.6 (issue #499)
* Minimum PROJ version 7.2 (issues #599 & #689)
* WHL: Removed datumgrids from wheels because not needed with RFC 4 (pull #628)
* WHL: Wheels contain PROJ 7.2
* ENH: Added :ref:`network_api` (#675, #691, #695)
* ENH: Added ability to use global context (issue #661)
* ENH: Added transformation grid sync API/CLI (issue #572)
* ENH: Support obects with '__array__' method (pandas.Series, xarray.DataArray, dask.array.Array) (issue #573)
* ENH: Added :func:`pyproj.datadir.get_user_data_dir` (pull #636)
* ENH: Added :attr:`pyproj.transformer.Transformer.is_network_enabled` (issue #629)
* ENH: Added :meth:`pyproj.transformer.TransformerGroup.download_grids` (pull #643)
* ENH: Use 'proj_get_units_from_database' in :func:`pyproj.database.get_units_map` & cleanup :func:`pyproj.database.get_codes` (issue #619)
* ENH: Added support for radians for Proj & Transformer.from_pipeline & use less gil (issue #612)
* ENH: Datum.from_name default to check all datum types (issue #606)
* ENH: Use from_user_input in __eq__ when comparing CRS sub-classes (i.e. PrimeMeridian, Datum, Ellipsoid, etc.) (issue #606)
* ENH: Add support for coordinate systems with CRS using CF conventions (issue #536)
* ENH: Use `proj_is_equivalent_to_with_ctx` in the place of `proj_is_equivalent_to` internally (issue #666)
* BUG: Add support for identifying engineering/parametric/temporal datums (issue #670)
* ENH: Add support for temporal CRS CF coordinate system (issue #672)
* ENH: Added support for debugging internal PROJ (pull #696)
* ENH: Added pathlib support for data directory methods (pull #702)
* ENH: Added :func:`pyproj.database.query_crs_info` (pull #703)
* ENH: Added :func:`pyproj.database.query_utm_crs_info` (pull #712)
* REF: Refactor Proj to inherit from Transformer (issue #624)
* REF: Added `pyproj.database`, `pyproj.aoi`, and `pyproj.list` modules (pull #703)
* BUG: Fix handling of polygon holes when calculating area in Geod (pull #686)
2.6.1
~~~~~
* WHL: Wheels contain PROJ version is 7.0.1
* BUG: Allow `*_name` to be added in CRS.to_cf (issue #585)
* BUG: Fix building prime meridian in :meth:`pyproj.crs.CRS.from_cf` (pull #588)
* BUG: Fix check for numpy bool True kwarg (pull #590)
* DOC: Update pyproj.Proj docstrings for clarity (issue #584)
* Added `pyproj.__proj_version__`
* BUG: Fix :meth:`pyproj.Proj.get_factors` (issue #600)
* BUG: fix unequal (!=) with non-CRS type (pull #596)
2.6.0
~~~~~
* ENH: Added :meth:`pyproj.Proj.get_factors` (issue #503)
* ENH: Added type hints (issue #369)
* BUG: Don't use CRS classes for defaults in CRS child class init signatures (issue #554)
* ENH: Updated :attr:`pyproj.crs.CRS.axis_info` to pull all relevant axis information from CRS (issue #557)
* ENH: Added :meth:`pyproj.transformer.Transform.__eq__` (issue #559)
* ENH: Added :attr:`pyproj.crs.CRS.utm_zone` (issue #561)
* BUG: Modify CRS dict test to accommodate numpy bool types. (issue #564)
* BUG: Fix pipeline transformations to match cct (issue #565)
* BUG: Don't silently ignore kwargs when projparams are specified (Proj & CRS) (issue #565)
2.5.0
~~~~~
* WHL: Wheels contain PROJ version is 6.3.1
* Remove deprecated PyObject_AsWriteBuffer (issue #495)
* ENH: Added :meth:`pyproj.crs.CRS.equals` with `ignore_axis_order` kwarg (issue #493)
* ENH: Added :meth:`pyproj.crs.CoordinateSystem.from_json`, :meth:`pyproj.crs.CoordinateSystem.from_json_dict`, and :meth:`pyproj.crs.CoordinateSystem.from_string` (pull #501)
* ENH: Added :class:`pyproj.crs.CoordinateSystem` to `pyproj.crs` namespace (pull #501)
* ENH: Added :meth:`pyproj.crs.CoordinateSystem.from_user_input`, :meth:`pyproj.crs.CoordinateOperation.from_user_input`, :meth:`pyproj.crs.Datum.from_user_input`, :meth:`pyproj.crs.PrimeMeridian.from_user_input`, :meth:`pyproj.crs.Ellipsoid.from_user_input` (pull #502)
* ENH: Added :meth:`pyproj.crs.CoordinateSystem.from_name`, :meth:`pyproj.crs.CoordinateOperation.from_name`, :meth:`pyproj.crs.Datum.from_name`, :meth:`pyproj.crs.PrimeMeridian.from_name`, :meth:`pyproj.crs.Ellipsoid.from_name` (pull #505)
* BUG: Fix getting :attr:`pyproj.crs.Ellipsoid.semi_minor_metre` when not computed (issue #457)
* ENH: Added support for custom CRS (issue #389)
* ENH: Added enumeration for WKT2_2019 (issue #526)
* ENH: Update from_cf/to_cf to use WKT instead of PROJ strings for internal management (issue #515)
2.4.2
~~~~~
* Elevate +init= warning to FutureWarning (pull #486)
* Add UserWarning to :meth:`pyproj.crs.CRS.to_proj4` (pull #486)
* BUG: Fix for 32-bit i686 platforms (issue #481)
* Return 'inf' in Proj instead of 1.e30 (pull #491)
2.4.1
~~~~~
* WHL: Wheels contain PROJ version is 6.2.1 (issue #456)
* WHL: Wheels for Linux x86_64 use manylinux2010 (pyproj4/pyproj-wheels/pull/18)
* BUG: Fix setting lat_ts for mercator projection in :meth:`pyproj.crs.CRS.from_cf` and :meth:`pyproj.crs.CRS.to_cf` (issue #461)
* BUG: latlon -> longlat in `CRS.from_cf()` for o_proj so behavior consistent in PROJ 6.2.0 and 6.2.1 (pull #472)
* ENH: Add repr for `pyproj.crs.CoordinateOperation` and for `pyproj.transformer.TransformerGroup` (pull #464)
2.4.0
~~~~~
* Minimum PROJ version is 6.2.0 (issue #411)
* Removed global pyproj context (issue #418)
* Added support for PROJ JSON in `pyproj.crs` objects and `pyproj.Transformer` (pull #432)
* Moved doctests code out of `pyproj.__init__` (issue #417)
* Added version information to `python -m pyproj` (pull #429)
* Added `scope` & `remarks` to `pyproj.crs` objects and `pyproj.Transformer` (issue #441)
* Added `operations` to `pyproj.crs.CoordinateOperation` objects and `pyproj.Transformer` (issue #441)
* Added :func:`pyproj.get_authorities` and :func:`pyproj.get_codes` (issue #440)
* Release gil in core cython/PROJ code (issue #386)
* BUG: Added checks for uninitialized `pyproj.crs` objects to prevent core dumping (issue #433)
* BUG: Added fix for get_transform_crs when checking type (pull #439)
* DOC: Build docs with python3 (pull #428)
2.3.1
~~~~~
* Added cleanup for internal PROJ errors (issue #413)
* Delay checking for pyproj data directory until importing pyproj (issue #415)
* Address issue where PROJ core dumps on proj_create with +init= when global context does not have data directory set (issue #415 & issue #368)
2.3.0
~~~~~
* Minimum supported Python version 3.5 (issue #331)
* New `pyproj.geod.Geod` additions:
* Added support for calculating geodesic area (:meth:`pyproj.Geod.polygon_area_perimeter`)
and added interface to calculate total length of a line
(:meth:`pyproj.Geod.line_length` & :meth:`pyproj.Geod.line_lengths`) (issue #210).
* Added support for calculating geodesic area and line lengths with shapely geometries
(:meth:`pyproj.Geod.geometry_area_perimeter` & :meth:`pyproj.Geod.geometry_length`)
(pull #366)
* New `pyproj.transformer` additions:
* Added :class:`pyproj.transformer.TransformerGroup` to make all transformations available (issue #381)
* Added option for `area_of_interest` for :meth:`pyproj.transformer.Transformer.from_crs`,
:meth:`pyproj.transformer.Transformer.from_proj` and :class:`pyproj.transformer.TransformerGroup`
* Added :attr:`pyproj.transformer.Transformer.area_of_use` (issue #385)
* Added :attr:`pyproj.crs.CoordinateOperation.area_of_use` (issue #385)
* Updated to only have one PJ_CONTEXT per pyproj session (issue #374)
* Always return latlon with Proj (issue #356)
* Remove aenum dependency (issue #339)
* Removed deprecated functions `Proj.proj_version`, `CRS.is_valid`, and `CRS.to_geodetic()` (pull #371)
* Search on `sys.prefix` for the PROJ data directory (issue #387)
2.2.2
~~~~~
* Update wheels to PROJ 6.1.1
* Add deprecation warning when using +init= syntax (pull #358)
* Added :meth:`pyproj.crs.is_proj` (pull #359)
* Fixed case in :meth:`pyproj.crs.CRS.to_dict` with :meth:`pyproj.crs.CRS.to_proj4` returning None (pull #359)
* Keep `no_defs` in input PROJ string as it does not hurt/help anything in current code (pull #359)
* Made public properties on C classes readonly (pull #359)
* Update data dir exception handling to prevent ignoring errors (pull #361)
* :meth:`pyproj.crs.CRS.to_cf` export transverse mercator parameters for UTM zones (pull #362)
2.2.1
~~~~~
* Added :meth:`pyproj.show_versions` (issue #334)
* Added fix for whitepace around '=' in PROJ strings (issue #345)
* Update version check in `setup.py` (issue #323)
* Add "stable" doc site pointing to latest release (issue #347, pull #348)
* Deprecate `Proj.proj_version` (pull #337)
* Test fixes (pull #333, pull #335)
2.2.0
~~~~~
* Minimum PROJ version is now 6.1.0
* `pyproj.crs` updates:
* Updated CRS repr (issue #264)
* Add Datum, CoordinateSystem, CoordinateOperation classes, (issue #262)
* Added :meth:`pyproj.crs.CRS.to_cf` and :meth:`pyproj.crs.CRS.from_cf` for
converting to/from Climate and Forecast (CF) 1.8 grid mappings (pull #244)
* Added :meth:`pyproj.crs.CRS.to_dict` (issue #226)
* Added :meth:`pyproj.crs.CRS.to_authority` (pull #294)
* Added :attr:`pyproj.crs.CRS.is_vertical` and :attr:`pyproj.crs.CRS.is_engineering` (issue #316)
* Added :attr:`pyproj.crs.CRS.target_crs` (pull #328)
* Provide option to "pretty print" WKT in :attr:`pyproj.crs.CRS.to_wkt` (issue #258)
* Add support for Bound and Compound CRS for :attr:`pyproj.crs.CRS.is_geographic`, :attr:`pyproj.crs.CRS.is_projected` (issue #274)
* Add support for Bound CRS for :attr:`pyproj.crs.CRS.is_geocentric` (issue #374)
* Add support for comparison with CRS a non-crs type supported by :meth:`pyproj.crs.CRS.from_user_input` (issue #312)
* Added support for ITRF, compound EPSG, and urn projection strings in CRS (pull #289)
* Better handle Compound CRS (issue #265)
* Disallow creation of non-CRS object (eg pipeline) in CRS class (issue #267)
* Added check in :meth:`pyproj.crs.CRS.to_epsg` for when `proj_list` is null (issue #257)
* Fix comparing classes of non-instance types (issue #310)
* `pyroj.transformer` updates:
* Added `always_xy` option to Transformer so the transform method will
always accept as input and return as output coordinates using the
traditional GIS order, that is longitude, latitudecfor geographic
CRS and easting, northing for most projected CRS (issue #225)
* Provide `direction` option in :meth:`pyproj.transformer.Transformer.transform` (issue #266)
* Add check for valid initialization of Transformer and ensure it is a transformer (issue #321)
* Added :meth:`pyproj.transformer.Transformer.to_wkt` as well as attributes related to `PJ_PROJ_INFO` (pull #322)
* Undo deprecation of :meth:`pyproj.transformer.Transformer.from_crs` (issue #275)
* Fix false positive errors raised in transformer (issue #249)
* Fix :class:`pyproj.Proj` initialization from DerivedGeographicCRS (issue #270)
* Add interface to get the projection/ellps/prime_meridian/units lists (issue #251)
* Docs/Build/Test fixes (pull #278, pull #245, pull #248, pull #247, issue #253, pull #252)
2.1.3
~~~~~
* Added support for time transformations (issue #208)
* Fixed projection equivalence testing for transformations (pull #231).
* Switch to pytest for testing (pull #230)
* Various testing fixes (pull #223, #222, #221, #220)
* Convert PROJ error messages from bytes to strings (pull #219)
* Fix data dir path separator to be (;) for windows and (:) for linux (pull #234)
2.1.2
~~~~~
* Updated to use the CRS definition for Proj instances in transforms (issue #207)
* Add option to skip transformation operation if input and output projections are equivalent
and always skip if the input and output projections are exact (issue #128)
* Update setup.py method for checking PROJ version (pull #211)
* Add internal proj error log messages to exceptions (pull #215)
2.1.1
~~~~~
* Restore behavior of 1.9.6 when illegal projection transformation requested
(return ``inf`` instead of raising an exception, issue #202). kwarg ``errcheck``
added to :func:`pyproj.transformer.transform` and :func:`pyproj.transformer.itransform`
(default ``False``). When ``errcheck=True`` an exception is raised.
2.1.0
~~~~~
* Added :class:`pyproj.transformer.Transformer` to make repetitive transformations more efficient (issue #187)
* Added fix for using local datumgrids with transform (issue #191)
* Added :meth:`pyproj.transformer.Transformer.from_pipeline` to support pipeline transformations.
* Added fix for conversion between radians/degrees for transformations (issues #192 & #195)
2.0.2
~~~~~
* add filter for boolean values in dict2string so "no_rot=True" works (issue #183).
* make sure .pxd files included in source tarball.
* add radians flag back in for transform/itransform (issue #185).
2.0.1
~~~~~
* Ensure data path set properly for TransProj (pull request #179, addressed
issue #176).
2.0.0
~~~~~
* Update to PROJ version 6.0.0 & removed support for older PROJ versions.
* Added pyproj.CRS class.
* Updated pyproj.Proj & pyproj.transform to accept any input from CRS.from_user_input.
* Removed internal PROJ source code.
* Changed default for preserve_units to be True in pyproj.Proj class initialization.
* Modified logic for searching for the PROJ data directory to not conflict with older versions of PROJ.
* Added pyproject.toml.
1.9.6
~~~~~
* fix segfault when inverse projection not defined (issue #43, pull request
#44).
* supports python 3.7
1.9.5.1
~~~~~~~
* fix for issue #42 (compilation error with microsoft visual studio).
1.9.5
~~~~~
* update proj4 source to latest github master (commit 953cc00fd87425395cabe37641cda905c4b587c1).
* port of basemap fix for input arrays in fortran order
* restore inverse Hammer patch that was lost when proj4 source code was updated.
1.9.4 (git tag v1.9.4rel)
~~~~~~~~~~~~~~~~~~~~~~~~~
* migrate to github from googlecode.
* update proj4 source code from svn r2595 (version 4.9.0RC2).
* include runtime_library_dirs in setup-proj.py.
* added to_latlong method (issue 51).
* fix back azimuth when lon1 and lon2 are identical.
1.9.3 (svn revision 327)
~~~~~~~~~~~~~~~~~~~~~~~~
* Geod now uses C code adapted from geographiclib now included in proj4 source,
instead of pure python code directly from geographiclib.
* make radians=True work with Geod.npts (issue 47).
* allow PROJ_DIR env var to control location of proj data (issue 40).
1.9.2 (svn revision 301)
~~~~~~~~~~~~~~~~~~~~~~~~
* updated proj4 src to 4.8.0 - includes two new map projections (natearth and
isea).
1.9.1 (svn revision 285)
~~~~~~~~~~~~~~~~~~~~~~~~
* restore compatibility with python 2.4/2.5, which was broken by the addition
of the geographiclib geodesic module (issue 36).
1.9.0 (svn revision 282)
~~~~~~~~~~~~~~~~~~~~~~~~
* use pure python geographiclib for geodesic computation codes instead of proj4.
* don't use global variable pj_errno for return codes, use pj_ctx_get_errno instead.
* use new projCtx structure for thread safety in proj lib.
* update C source and data from proj4 svn (r2140).
* add pj_list and pj_ellps module level variables (a dict mapping short names to longer descriptions, e.g. pyproj.pj_list['aea'] = 'Albers Equal Area').
1.8.9 (svn revision 222)
~~~~~~~~~~~~~~~~~~~~~~~~
* Python 3 now supported.
* allow 'EPSG' init (as well as 'epsg'). This only worked on case-insensitive
filesystems previously. Fixes issue 6.
* added inverse to Hammer projection.
* updated proj.4/src/pj_mutex.c from proj4 svn to fix a threading issue on windows
(issue 25). Windows binary installers updated (version 1.8.8-1), courtesy
Christoph Gohlke.
* if inputs are NaNs, return huge number (1.e30).
1.8.8 (svn revision 196)
~~~~~~~~~~~~~~~~~~~~~~~~
* add extra datum shift files, added test/test_datum.py (fixes issue 22).
datum shifts now work correctly in transform function.
1.8.7 (svn revision 175)
~~~~~~~~~~~~~~~~~~~~~~~~
* reverted pj_init.c to old version (from proj4 4.6.1) because version in
4.7.0 includes caching code that can cause segfaults in pyproj (issue 19).
* added 'preserve_units' keyword to Proj.__init__ to suppress conversion
to meters.
1.8.6 (svn revision 169)
~~~~~~~~~~~~~~~~~~~~~~~~
* now works with ms vs2008, vs2003 (fixed missing isnan).
* updated to proj 4.7.0 (fixes a problem coexisting with pyqt).
* allow Geod instance to be initialized using a proj4 string
1.8.5 (svn revision 155)
~~~~~~~~~~~~~~~~~~~~~~~~
* allow Proj instance to be initialized using a proj4 string
(instead of just a dict or kwargs).
1.8.4 (svn revision 151)
~~~~~~~~~~~~~~~~~~~~~~~~
* updated proj4 sources to version 4.6.0
1.8.3 (svn revision 146)
~~~~~~~~~~~~~~~~~~~~~~~~
* fixed bug in Geod class that caused erroneous error message
"undefined inverse geodesic (may be an antipodal point)".
* fix __reduce__ method of Geod class so instances can be pickled.
* make sure points outside projection limb are set to 1.e30 on inverse
transform (if errcheck=False).
* fixed small setup.py bug.
* generate C source with Cython 0.9.6.6 (pycompat.h no longer needed).
1.8.2
~~~~~
* added 'srs' (spatial reference system) instance variable to Proj.
* instead of returning HUGE_VAL (usually 'inf') when projection not defined
and errcheck=False, return 1.e30.
* added Geod class for geodesic (i.e. Great Circle) computations.
Includes doctests (which can be run with pyproj.test()).
* proj.4 source code now included, thus removing proj.4 lib
dependency. Version 4.5.0 is included, with a patch to
create an API for geodesic computations.
* python 2.4 compatibility patch (suggested by Andrew Straw)
from M. v. Loewis:
http://mail.python.org/pipermail/python-dev/2006-March/062561.html
1.8.1
~~~~~
* if given tuples, returns tuples (instead of lists).
* test for numpy arrays first.
* Fixed error in docstring example.
* README.html contains html docstrings generated by pydoc.
* Renamed pyproj.so to _pyproj.so, created a new python module
called pyproj.py. Moved as code as possible from _pyproj.so to
pyproj.py.
* docstring examples now executed by doctest when 'pyproj.test()' is run.
* added test to _pyproj.c which defines Py_ssize_t for python < 2.5.
This is necessary when pyrex 0.9.5 is used.
1.8.0
~~~~~
* Better error handling Proj.__init__.
* Added optional keyword 'errcheck' to __call__ method.
* If True, an exception is raised if the transformation is invalid.
1.7.3
~~~~~
* python 2.5 support.
pyproj-3.6.1/docs/index.rst 0000664 0000000 0000000 00000001533 14502715416 0015644 0 ustar 00root root 0000000 0000000 pyproj Documentation
====================
Python interface to `PROJ `_ (cartographic projections and coordinate transformations library).
GitHub Repository: https://github.com/pyproj4/pyproj
.. note:: Minimum supported PROJ version is 9.0
.. note:: Minimum supported Python version is 3.9
.. note:: Linux (manylinux2014) wheels require pip 19.3+
.. note:: pyproj 3 wheels do not include transformation grids.
For migration assistance see: :ref:`transformation_grids`
.. toctree::
:maxdepth: 1
:caption: Contents:
installation
examples
transformation_grids
gotchas
api/index
cli
advanced_examples
build_crs
build_crs_cf
crs_compatibility
optimize_transformations
history
past_versions
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
pyproj-3.6.1/docs/installation.rst 0000664 0000000 0000000 00000012377 14502715416 0017246 0 ustar 00root root 0000000 0000000 .. highlight:: shell
============
Installation
============
The easiest methods for installing pyproj are:
1. Use pip to install the binary wheels on `PyPI `__:
.. code-block:: bash
pip install pyproj
.. note:: Linux (manylinux2014) wheels require pip 19.3+
.. note:: pyproj 3+ wheels do not include transformation grids.
For migration assistance see: :ref:`transformation_grids`
- The MacOS and Linux wheels are powered by
`cibuildwheel `__
& `multibuild `__
- The Windows wheels versions <= 3.3.x were built by `Christoph Gohlke `__
2. Use `conda `__ with the `conda-forge `__ channel:
.. code-block:: bash
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n pyproj_env pyproj
conda activate pyproj_env
.. note::
"... we recommend always installing your packages inside a
new environment instead of the base environment from
anaconda/miniconda. Using envs make it easier to
debug problems with packages and ensure the stability
of your root env."
-- https://conda-forge.org/docs/user/tipsandtricks.html
.. warning::
Avoid using `pip install` with a conda environment. If you encounter
a python package that isn't in conda-forge, consider submitting a
recipe: https://github.com/conda-forge/staged-recipes/
- `pyproj` is maintained by the `pyproj-feedstock maintainers `__
- `PROJ` is maintained by the `proj.4-feedstock maintainers `__
If these installation methods do not meet your needs, the section below provides further instructions
for getting setup.
Transformation Grids
=====================
See: :ref:`transformation_grids`
Installing from source
======================
Version compatibility matrix:
============ ============
pyproj PROJ
============ ============
<= 1.9.6 <= 5.2
2.0-2.1 6.0-7
2.2-2.3 6.1-7
2.4-2.6 6.2-7
3.0.0 7.2
3.0.1-3.2 7.2-9.1
3.3 8.0-9.1
3.4+ 8.2+
3.5+ 9+
============ ============
Setup PROJ
------------
PROJ is required when building from source.
:ref:`PROJ Installation Instructions `
You can also download PROJ from:
- https://download.osgeo.org/proj
- https://github.com/OSGeo/PROJ
pyproj Build Environment Variables
-----------------------------------
.. envvar:: PROJ_VERSION
.. versionadded:: 3.0
This sets the version of PROJ when building pyproj. This
enables installing pyproj when the PROJ executables are not
present but the header files exist.
.. envvar:: PROJ_DIR
This is the path to the base directory for PROJ.
Examples of how to set the PROJ_DIR environment variable:
Windows::
set PROJ_DIR=C:\OSGeo4W\
Linux::
export PROJ_DIR=/usr/local
.. envvar:: PROJ_LIBDIR
This is the path to the directory containing the PROJ libraries.
If not set, it searches the `lib` and `lib64` directories inside
the PROJ directory.
.. envvar:: PROJ_INCDIR
This is the path to the PROJ include directory. If not set, it assumes
it is the `includes` directory inside the PROJ directory.
.. envvar:: PROJ_WHEEL
This is a boolean value used when building a wheel. When true
it includes the contents of the `pyproj/proj_dir/proj/share`
directory if present.
.. envvar:: PYPROJ_FULL_COVERAGE
Boolean that sets the compiler directive for cython to include
the test coverage.
Setup pyproj
------------
In the setup.py, the order for searching for PROJ is:
1. The :envvar:`PROJ_DIR` environment variable
2. The internal PROJ directory (pyproj/proj_dir)
3. The `proj` executable in sys.prefix
4. The `proj` executable on the PATH
For best results, set the :envvar:`PROJ_DIR` environment variable to
point to location of PROJ installation before running setup.py.
If you have a previous version of PROJ installed alongside the current
version of PROJ, the best way to avoid conflicts is to:
1. Remove the previous PROJ from `PATH` & unset the `PROJ_DATA`` (PROJ 9.1+) | `PROJ_LIB` (PROJ<9.1) environment variables (temporarily)
2. Install PROJ to the internal PROJ directory (pyproj/proj_dir)
3. Set the environment variable :envvar:`PROJ_DIR` to point to the internal PROJ directory
4. Set the environment variable :envvar:`PROJ_WHEEL` to true
5. Build pyproj
Install pyproj
~~~~~~~~~~~~~~
.. note:: `Cython `_ or pip>=10.0.1 is required for the installation.
.. note:: You may need to run pip with administrative privileges (e.g. `sudo pip`) or
perform a user only installation (e.g. `pip install --user`).
From pypi:
^^^^^^^^^^
.. code-block:: bash
pip install pyproj --no-binary pyproj
From GitHub with `pip`:
^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
pip install git+https://github.com/pyproj4/pyproj.git
From cloned GitHub repo for development:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
pip install -e .
pyproj-3.6.1/docs/make.bat 0000664 0000000 0000000 00000001400 14502715416 0015401 0 ustar 00root root 0000000 0000000 @ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=pyproj
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd
pyproj-3.6.1/docs/media/ 0000775 0000000 0000000 00000000000 14502715416 0015060 5 ustar 00root root 0000000 0000000 pyproj-3.6.1/docs/media/icon.png 0000664 0000000 0000000 00000001551 14502715416 0016520 0 ustar 00root root 0000000 0000000 PNG
IHDR a sBIT|d pHYs I tEXtSoftware www.inkscape.org< tEXtAuthor Sylvain Beorchia>g tEXtCreation Time 2019/10/01V XtEXtCopyright CC0 Public Domain Dedication http://creativecommons.org/publicdomain/zero/1.0/ ;IDAT8Kq?Q&!,^St_ڨ?N*I
"
B4hsJH/mEfXBvyi~;;4ّg=ykf#\[.rE?\cu+ޜֺfL:FeUJK:)W[Xf
l?,Nz_ CVjg53i
+$@?||
WM
Џ"]C[FHF KK}fj *6f(
,yl}2uUr e=F`,3U1rqOG"˘(7Yus&Fy
#kS\?ے6vyVnZf#R+$Py*n<< ZɄwGpNy
ihDu[hzj^G /kUPj0Y8=kK34١gw
ޠU IENDB` pyproj-3.6.1/docs/media/icon.svg 0000664 0000000 0000000 00000007324 14502715416 0016537 0 ustar 00root root 0000000 0000000
pyproj-3.6.1/docs/media/logo.png 0000664 0000000 0000000 00000036643 14502715416 0016542 0 ustar 00root root 0000000 0000000 PNG
IHDR -t sBIT|d pHYs + tEXtSoftware www.inkscape.org< tEXtAuthor Sylvain Beorchia>g tEXtCreation Time 2019/10/01V XtEXtCopyright CC0 Public Domain Dedication http://creativecommons.org/publicdomain/zero/1.0/ IDATxyxT{f&a]6wVK"Q*PW)Ak[Z[j$eVp-E6w6s# If{9Is^Åι/ B!B!B!B!B!B!B!B!B!B!B!B!B! @!5x٘Z:~
)I?!0^
r T:Myt|qO!0EtS]xj?02B1=$~ @`*u+.ʟBa n4eHt;
J4 'BW
aK@ThR$B!"z%c]^'PD#ɟBiwiO!3/$4)O!a]:F4E !abuoh$B!Ugq&J !!5 t
uzz1GVBRO # BonO:OԬ#ҹ S.-5`l*mlU5u!
OF?!@;(&uԜe0 Qk# L5 5P^9nCBO?!MΐͩX"\\@h_VwV? {jшL?!MBgfWpؾ.ӏf<Kwmb Kh䴯BF+?>Trx(3dOu76no [1
sRɹ%վ)IB4*ny.ʫiY,g#'Cۦ=-p3W30=Q]/A&C^
!h:ZTU#hq]'~ GuvkKcf-'`BBB!QP4'C\j:7QxkA,xRFe`+4e^ʝ'M$B!KC+@Em!ֻ]]҄SbOл@ݛnw{h$BѠ4zV|vnۘ@,K#D"݄B4$C$~ pɟzOvÉ0.{hJQ!ɟB㪠hV1apܺDo^8oc٥}kPpɷ !]4LE,`9hMnkE3\3?ź$[9tʟBTo&~ -? xH FT7/hvH? +QA> AxZ
\"h`:Gr\~7Y\R2 zBay+|n8OF>)&h\xULo x$lъ74(R'RW:<Ȗm{:&$E34@KӱAϣ][w%&N9EuD%50K?3놝B!
u~:@x݇`dVtm` V1YJT"tc r*`PQ
I TJd3sW5ׂ$*R_2R[9:?pW$2dzdYѻ+4g-*0}\t$~DT.|=E]4[`:횘k%]z ;5SKDhVU Pj @- H
5?#G >Rީ(OC+y4Hup}1u^@H]Hl5úCY@S 0mqzD(;UP"x2qݨL SK뾿mAf!J@k R
_3 @v;>TLf٘SFRT'&"ZN){l=,Ħg:?]u:2=7
#r+f