[PROJ] Am I supposed to get same results with libproj if passing proj4 +proj from/to crs ?

Mike Taves mwtoews at gmail.com
Wed Nov 10 12:40:20 PST 2021


On Thu, 11 Nov 2021 at 04:04, Sandro Santilli <strk at kbt.io> wrote:
> Is this a known removal from PROJ 7.2.1 to PROJ 8.1.1
> or is that a pyproj packaging bug to miss that ?

One potential behaviour is that when PROJ_NETWORK is not defined, it
is assumed to be OFF.

Example with pyproj-3.0.1-cp36-cp36m-manylinux2010_x86_64.whl via pip:

import os
from pyproj.transformer import TransformerGroup
tg = TransformerGroup("EPSG:32040", "EPSG:3857")
# shows UserWarning: Best transformation is not available ...
print(tg)
# <TransformerGroup: best_available=False>
# - transformers: 7
# - unavailable_operations: 4

assert "PROJ_NETWORK" not in os.environ
os.environ["PROJ_NETWORK"] = "ON"
tg = TransformerGroup("EPSG:32040", "EPSG:3857")
print(tg)
# <TransformerGroup: best_available=True>
# - transformers: 11
# - unavailable_operations: 0
print(tg.transformers[0].transform(0, 0))
# (-11708734.486616932, 3209717.223316072)

The question is should PROJ default to PROJ_NETWORK=ON if the
PROJ_NETWORK configuration or environment variable is not defined? The
current behaviour is that it defaults to OFF behavior.


More information about the PROJ mailing list