Skip to content

Commit

Permalink
PROJ 6.2+ required; remove global context; autoclose database
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Aug 27, 2019
1 parent 4d7c8b5 commit 1fb9e89
Show file tree
Hide file tree
Showing 19 changed files with 224 additions and 151 deletions.
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
global:
- PROJ_BASE_DIR=$HOME/proj_install
- CYTHON_COVERAGE=True
- PROJSOURCE=6.1.1
- PROJSOURCE=6.2.0RC1
# Following generated with
- WHEELHOUSE_UPLOADER_USERNAME=travis-worker
# Following generated by
Expand All @@ -26,20 +26,17 @@ matrix:
os: osx
env:
- PYTHON=3.6.8
- PROJSOURCE=6.1.1
- PROJSOURCE=6.2.0RC1
- python: 3.5
env:
- PROJSOURCE=6.1.1
- PROJSOURCE=6.2.0RC1
- python: 3.6
env:
- PROJSOURCE=6.1.0
- python: 3.6
env:
- PROJSOURCE=6.1.1
- PROJSOURCE=6.2.0RC1
- python: 3.7
dist: xenial
env:
- PROJSOURCE=6.1.1
- PROJSOURCE=6.2.0RC1
- DOC=true
- python: "nightly"
env:
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ environment:
# PYTHON_ARCH: "64"
# VS_VERSION: Visual Studio 14
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# PROJSOURCE: 6.1.0
# PROJSOURCE: 6.2.0
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
VS_VERSION: Visual Studio 14
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PROJSOURCE: 6.1.1
PROJSOURCE: 6.2.0RC1
# - PYTHON: "C:\\Python37-x64"
# PYTHON_VERSION: "3.7"
# PYTHON_ARCH: "64"
# VS_VERSION: Visual Studio 14
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# PROJSOURCE: 6.1.1
# PROJSOURCE: 6.2.0RC1
# - PYTHON: "C:\\Python36-x64"
# PYTHON_VERSION: "3.6"
# PYTHON_ARCH: "64"
Expand Down
2 changes: 1 addition & 1 deletion ci/travis/proj-dl-and-compile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
echo "Building PROJ.4 $1 version from source..."
if [[ $1 == "git" ]]; then
git clone https://github.com/OSGeo/proj.4.git proj-git
git clone https://github.com/OSGeo/proj.git proj-git
else
curl https://download.osgeo.org/proj/proj-$1.tar.gz > "proj-${1:0:5}.tar.gz"
tar zxf "proj-${1:0:5}.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Change Log

2.2.0
~~~~~
* Minimum PROJ version is now 6.1.0
* Minimum PROJ version is now 6.2.0
* `pyproj.crs` updates:
* Updated CRS repr (issue #264)
* Add Datum, CoordinateSystem, CoordinateOperation clases (issue #262)
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pyproj Documentation

Python interface to `PROJ <https://proj.org/>`_ (cartographic projections and coordinate transformations library).

.. note:: Minimum supported PROJ version is 6.1.0
.. note:: Minimum supported PROJ version is 6.2.0

.. note:: Minimum supported Python version is 3.5

Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Installing from source
Setup PROJ
------------

PROJ 6.1.0 is required when building from source.
PROJ 6.2.0 is required when building from source.
You can download PROJ from https://download.osgeo.org/proj
or from https://github.com/OSGeo/PROJ.
Installation instructions can be fount at https://proj.org/.
Expand All @@ -78,7 +78,7 @@ Linux::
export PROJ_DIR=/usr/local

If you have a previous version of PROJ installed alongside the current
version of PROJ (6.1.0), the best way to avoid conflicts is to:
version of PROJ (6.2.0), the best way to avoid conflicts is to:

1. Remove the previous PROJ from PATH & unset old PROJ_LIB environment variable (temporarily)
2. Install PROJ to the internal PROJ directory (pyproj/proj_dir)
Expand Down
21 changes: 12 additions & 9 deletions pyproj/_crs.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include "proj.pxi"

from pyproj._datadir cimport ContextManager

cdef class Axis:
cdef readonly object name
cdef readonly object abbrev
Expand All @@ -10,7 +12,7 @@ cdef class Axis:
cdef readonly object unit_code

@staticmethod
cdef create(PJ* projobj, int index)
cdef create(ContextManager context_manager, PJ* projobj, int index)

cdef class AreaOfUse:
cdef readonly double west
Expand All @@ -20,11 +22,12 @@ cdef class AreaOfUse:
cdef readonly object name

@staticmethod
cdef create(PJ* projobj)
cdef create(ContextManager context_manager, PJ* projobj)


cdef class Base:
cdef PJ *projobj
cdef ContextManager context_manager
cdef readonly object name


Expand All @@ -36,30 +39,30 @@ cdef class Ellipsoid(Base):
cdef readonly object ellipsoid_loaded

@staticmethod
cdef create(PJ* ellipsoid_pj)
cdef create(ContextManager context_manager, PJ* ellipsoid_pj)

cdef class PrimeMeridian(Base):
cdef readonly double longitude
cdef readonly double unit_conversion_factor
cdef readonly object unit_name

@staticmethod
cdef create(PJ* prime_meridian_pj)
cdef create(ContextManager context_manager, PJ* prime_meridian_pj)


cdef class Datum(Base):
cdef readonly object _ellipsoid
cdef readonly object _prime_meridian

@staticmethod
cdef create(PJ* datum_pj)
cdef create(ContextManager context_manager, PJ* datum_pj)


cdef class CoordinateSystem(Base):
cdef readonly object _axis_list

@staticmethod
cdef create(PJ* coordinate_system_pj)
cdef create(ContextManager context_manager, PJ* coordinate_system_pj)


cdef class Param:
Expand All @@ -74,7 +77,7 @@ cdef class Param:
cdef readonly object unit_category

@staticmethod
cdef create(PJ* projobj, int param_idx)
cdef create(ContextManager context_manager, PJ* projobj, int param_idx)


cdef class Grid:
Expand All @@ -87,7 +90,7 @@ cdef class Grid:
cdef readonly object available

@staticmethod
cdef create(PJ* projobj, int grid_idx)
cdef create(ContextManager context_manager, PJ* projobj, int grid_idx)


cdef class CoordinateOperation(Base):
Expand All @@ -103,7 +106,7 @@ cdef class CoordinateOperation(Base):
cdef readonly object _towgs84

@staticmethod
cdef create(PJ* coordinate_operation_pj)
cdef create(ContextManager context_manager, PJ* coordinate_operation_pj)


cdef class _CRS(Base):
Expand Down
Loading

0 comments on commit 1fb9e89

Please sign in to comment.