Skip to content

Commit

Permalink
Rename PROJ.4 to PROJ (closes #174) (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored Jun 1, 2019
1 parent 47301be commit 4ce78dd
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 65 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pyproj

Python interface to [PROJ](http://proj4.org).
Python interface to [PROJ](http://proj.org) (cartographic projections and coordinate transformations library).

[![Join the chat at https://gitter.im/pyproj4-pyproj/community](https://badges.gitter.im/pyproj4-pyproj/community.svg)](https://gitter.im/pyproj4-pyproj/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/pyproj4/pyproj.svg)](https://travis-ci.org/pyproj4/pyproj)
Expand Down
6 changes: 3 additions & 3 deletions docs/api/transformer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ 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
`proj <https://proj4.org/apps/proj.html>`, `cs2cs <https://proj4.org/apps/cs2cs.html>`,
and `cct <https://proj4.org/apps/cct.html>` can do.
`proj <https://proj.org/apps/proj.html>`, `cs2cs <https://proj.org/apps/cs2cs.html>`,
and `cct <https://proj.org/apps/cct.html>` 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 <https://proj4.org/faq.html#why-is-the-axis-ordering-in-proj-not-consistent>`_).
`axis order <https://proj.org/faq.html#why-is-the-axis-ordering-in-proj-not-consistent>`_).
You can check the axis order with the `pyproj.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`.
Expand Down
6 changes: 3 additions & 3 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ Change Log

2.0.0
~~~~~
* Update to PROJ.4 version 6.0.0 & removed support for older PROJ.4 versions.
* 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.4 source code.
* 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.4 data directory to not conflict with older versions of PROJ.4.
* Modified logic for searching for the PROJ data directory to not conflict with older versions of PROJ.
* Added pyproject.toml.

1.9.6
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pyproj Documentation
====================

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

.. note:: Minimum supported PROJ version is 6.1.0

Expand Down
26 changes: 13 additions & 13 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ for getting setup.
Installing from source
======================

Setup PROJ.4
Setup PROJ
------------

PROJ.4 6.1.0 is required when building from source.
You can download PROJ.4 from https://download.osgeo.org/proj
or from https://github.com/OSGeo/proj.4.
Installation instructions can be fount at https://proj4.org/.
PROJ 6.1.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/.

In the setup.py, the order for searching for PROJ.4 is:
In the setup.py, the order for searching for PROJ is:

1. The PROJ_DIR environment variable
2. The internal PROJ.4 directory (pyproj/proj_dir)
2. The internal PROJ directory (pyproj/proj_dir)
3. The `proj` executable on the PATH.

For best results, set the PROJ_DIR environment variable to
point to location of PROJ.4 installation before running setup.py.
point to location of PROJ installation before running setup.py.

Examples of how to set the PROJ_DIR environment variable:

Expand All @@ -53,12 +53,12 @@ Linux::

export PROJ_DIR=/usr/local

If you have a previous version of PROJ.4 installed alongside the current
version of PROJ.4 (6.1.0), the best way to avoid conflicts is to:
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:

1. Remove the previous PROJ.4 from PATH & unset old PROJ_LIB environment variable (temporarily)
2. Install PROJ.4 to the internal PROJ.4 directory (pyproj/proj_dir)
3. Set the environment variable PROJ_DIR to point to the internal PROJ.4 directory
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)
3. Set the environment variable PROJ_DIR to point to the internal PROJ directory
4. Set the environment variable PROJ_WHEEL=true
5. Build pyproj

Expand Down
2 changes: 1 addition & 1 deletion pyproj/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
Cython wrapper to provide python interfaces to
PROJ.4 (https://github.com/OSGeo/proj.4/wiki) functions.
PROJ (https://proj.org) functions.
Performs cartographic transformations and geodetic computations.
Expand Down
22 changes: 11 additions & 11 deletions pyproj/_crs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ cdef _to_wkt(PJ_CONTEXT* projctx, PJ* projobj, version=WktVersion.WKT2_2018, pre

cdef _to_proj4(PJ_CONTEXT* projctx, PJ* projobj, version):
"""
Convert the projection to a PROJ.4 string.
Convert the projection to a PROJ string.
Parameters
----------
version: ~pyproj.enums.ProjVersion
The version of the PROJ.4 output.
The version of the PROJ string output.
Returns
-------
str: The PROJ.4 string.
str: The PROJ string.
"""
# get the output PROJ.4 format
# get the output PROJ string format
supported_prj_types = {
ProjVersion.PROJ_4: PJ_PROJ_4,
ProjVersion.PROJ_5: PJ_PROJ_5,
Expand Down Expand Up @@ -1206,17 +1206,17 @@ cdef class CoordinateOperation(Base):

def to_proj4(self, version=ProjVersion.PROJ_5):
"""
Convert the projection to a PROJ.4 string.
Convert the projection to a PROJ string.
Parameters
----------
version: ~pyproj.enums.ProjVersion
The version of the PROJ.4 output.
The version of the PROJ string output.
Default is :attr:`~pyproj.enums.ProjVersion.PROJ_5`.
Returns
-------
str: The PROJ.4 string.
str: The PROJ string.
"""
return _to_proj4(self.projctx, self.projobj, version)

Expand Down Expand Up @@ -1500,21 +1500,21 @@ cdef class _CRS(Base):

def to_proj4(self, version=ProjVersion.PROJ_4):
"""
Convert the projection to a PROJ.4 string.
Convert the projection to a PROJ string.
.. 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
another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
Parameters
----------
version: ~pyproj.enums.ProjVersion
The version of the PROJ.4 output.
The version of the PROJ string output.
Default is :attr:`~pyproj.enums.ProjVersion.PROJ_4`.
Returns
-------
str: The PROJ.4 string.
str: The PROJ string.
"""
return _to_proj4(self.projctx, self.projobj, version)

Expand Down
2 changes: 1 addition & 1 deletion pyproj/_datadir.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from pyproj.exceptions import ProjError

cdef void pyproj_log_function(void *user_data, int level, const char *error_msg):
"""
Log function for proj.4 errors with CRS class.
Log function for catching PROJ errors.
"""
if level == PJ_LOG_ERROR:
ProjError.internal_proj_error = pystrdecode(error_msg)
Expand Down
2 changes: 1 addition & 1 deletion pyproj/_proj.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from pyproj._datadir cimport get_pyproj_context
from pyproj.exceptions import ProjError


# # version number strings for proj.4 and Geod
# # version number string for PROJ
proj_version_str = "{0}.{1}.{2}".format(
PROJ_VERSION_MAJOR,
PROJ_VERSION_MINOR,
Expand Down
8 changes: 4 additions & 4 deletions pyproj/crs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
This module interfaces with proj.4 to produce a pythonic interface
This module interfaces with PROJ to produce a pythonic interface
to the coordinate reference system (CRS) information through the CRS
class.
Expand Down Expand Up @@ -51,7 +51,7 @@


def _from_dict(projparams):
# convert a dict to a proj4 string.
# convert a dict to a proj string.
pjargs = []
for key, value in projparams.items():
# the towgs84 as list
Expand Down Expand Up @@ -132,7 +132,7 @@ class CRS(_CRS):
srs: str
The string form of the user input used to create the CRS.
name: str
The name of the CRS (from `proj_get_name <https://proj4.org/development/reference/functions.html#_CPPv313proj_get_namePK2PJ>`_).
The name of the CRS (from `proj_get_name <https://proj.org/development/reference/functions.html#_CPPv313proj_get_namePK2PJ>`_).
type_name: str
The name of the type of the CRS object.
Expand Down Expand Up @@ -427,7 +427,7 @@ def to_dict(self):
.. 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
another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
Returns
-------
Expand Down
10 changes: 5 additions & 5 deletions pyproj/datadir.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

def set_data_dir(proj_data_dir):
"""
Set the data directory for PROJ.4 to use.
Set the data directory for PROJ to use.
Parameters
----------
proj_data_dir: str
The path to rhe PROJ.4 data directory.
The path to rhe PROJ data directory.
"""
global _USER_PROJ_DATA
global _VALIDATED_PROJ_DATA
Expand All @@ -28,12 +28,12 @@ def set_data_dir(proj_data_dir):

def append_data_dir(proj_data_dir):
"""
Add an additional data directory for PROJ.4 to use.
Add an additional data directory for PROJ to use.
Parameters
----------
proj_data_dir: str
The path to rhe PROJ.4 data directory.
The path to rhe PROJ data directory.
"""
set_data_dir(os.pathsep.join([get_data_dir(), proj_data_dir]))

Expand Down Expand Up @@ -96,7 +96,7 @@ def valid_data_dirs(potential_data_dirs):

if _VALIDATED_PROJ_DATA is None:
raise DataDirError(
"Valid PROJ.4 data directory not found."
"Valid PROJ data directory not found."
"Either set the path using the environmental variable PROJ_LIB or "
"with `pyproj.datadir.set_data_dir`."
)
Expand Down
8 changes: 4 additions & 4 deletions pyproj/geod.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Cython wrapper to provide python interfaces to
PROJ.4 (https://github.com/OSGeo/proj.4/wiki) functions.
PROJ (https://proj.org) functions.
Performs geodetic computations.
Expand Down Expand Up @@ -77,7 +77,7 @@ def __init__(self, initstring=None, **kwargs):
Geodetic parameters for specifying the ellipsoid
can be given in a dictionary 'initparams', as keyword arguments,
or as as proj4 geod initialization string.
or as as proj geod initialization string.
You can get a dictionary of ellipsoids using :func:`~pyproj.get_ellps_map`
or with the variable `pyproj.pj_ellps`.
Expand All @@ -88,7 +88,7 @@ def __init__(self, initstring=None, **kwargs):
or polar axis radius), 'e' (eccentricity), 'es' (eccentricity
squared), 'f' (flattening), or 'rf' (reciprocal flattening).
See the proj documentation (https://proj4.org) for more
See the proj documentation (https://proj.org) for more
information about specifying ellipsoid parameters.
Example usage:
Expand Down Expand Up @@ -325,7 +325,7 @@ def __eq__(self, other):
>>> gclrk2 = Geod(a=6378206.4, b=6356583.8) # Define Clarke 1866 using parameters
>>> gclrk1 == gclrk2
True
>>> gwgs66 = Geod('+ellps=WGS66') # WGS 66 ellipsoid, Proj.4 style
>>> gwgs66 = Geod('+ellps=WGS66') # WGS 66 ellipsoid, PROJ style
>>> gnwl9d = Geod('+ellps=NWL9D') # Naval Weapons Lab., 1965 ellipsoid
>>> # these ellipsoids are the same
>>> gnwl9d == gwgs66
Expand Down
24 changes: 8 additions & 16 deletions pyproj/proj.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
Cython wrapper to provide python interfaces to
PROJ.4 (https://github.com/OSGeo/proj.4/wiki) functions.
PROJ (https://proj.org) functions.
Performs cartographic transformations and geodetic computations.
Expand Down Expand Up @@ -52,13 +52,13 @@ class Proj(_proj.Proj):
"""
Performs cartographic transformations (converts from
longitude,latitude to native map projection x,y coordinates and
vice versa) using proj (https://proj4.org).
vice versa) using proj (https://proj.org).
A Proj class instance is initialized with proj map projection
control parameter key/value pairs. The key/value pairs can
either be passed in a dictionary, or as keyword arguments,
or as a proj4 string (compatible with the proj command). See
https://proj4.org/operations/projections/index.html for examples of
or as a PROJ string (compatible with the proj command). See
https://proj.org/operations/projections/index.html for examples of
key/value pairs defining different map projections.
Calling a Proj class instance with the arguments lon, lat will
Expand Down Expand Up @@ -90,17 +90,17 @@ def __init__(self, projparams=None, preserve_units=True, **kwargs):
"""
initialize a Proj class instance.
See the proj documentation (https://github.com/OSGeo/proj.4/wiki)
See the PROJ documentation (https://proj.org)
for more information about projection parameters.
Parameters
----------
projparams: int, str, dict, pyproj.CRS
A proj.4 or WKT string, proj.4 dict, EPSG integer, or a pyproj.CRS instnace.
A PROJ or WKT string, PROJ dict, EPSG integer, or a pyproj.CRS instnace.
preserve_units: bool
If false, will ensure +units=m.
**kwargs:
proj.4 projection parameters.
PROJ projection parameters.
Example usage:
Expand Down Expand Up @@ -176,19 +176,11 @@ def __call__(self, *args, **kw):
"""
inverse = kw.get("inverse", False)
errcheck = kw.get("errcheck", False)
# if len(args) == 1:
# latlon = np.array(args[0], copy=True,
# order='C', dtype=float, ndmin=2)
# if inverse:
# _proj.Proj._invn(self, latlon, radians=radians, errcheck=errcheck)
# else:
# _proj.Proj._fwdn(self, latlon, radians=radians, errcheck=errcheck)
# return latlon
lon, lat = args
# process inputs, making copies that support buffer API.
inx, xisfloat, xislist, xistuple = _copytobuffer(lon)
iny, yisfloat, yislist, yistuple = _copytobuffer(lat)
# call proj4 functions. inx and iny modified in place.
# call PROJ functions. inx and iny modified in place.
if inverse:
self._inv(inx, iny, errcheck=errcheck)
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproj/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def from_crs(crs_from, crs_to, skip_equivalent=False, always_xy=False):
def from_pipeline(proj_pipeline):
"""Make a Transformer from a PROJ pipeline string.
https://proj4.org/operations/pipeline.html
https://proj.org/operations/pipeline.html
Parameters
----------
Expand Down

0 comments on commit 4ce78dd

Please sign in to comment.