Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    David Hoese
    @djhoese
    issue right now is I'm not really getting a good indication of why/what is causing the seg fault
    or which package to blame
    Alan D. Snow
    @snowman2
    Just this one: pyproj4/pyproj#368
    I would recommend checking the version of PROJ and making sure it is 6.1+ and ensuring that a wheel wasn't installed by accident.
    David Hoese
    @djhoese
    @snowman2
        proj4-6.1.0                |       he751ad9_2         9.4 MB  conda-forge
        pyproj-2.2.1               |   py37hc44880f_0         252 KB  conda-forge
    David Hoese
    @djhoese
    I'm also seeing that on Windows I can't get proj4 6.0+ for some reason. Not sure what's holding that back. Maybe a failed rasterio build. Not sure.
    David Hoese
    @djhoese
    David Hoese
    @djhoese
    @snowman2 Have you ever had different experiences with proj from Linux to Windows on what it accepts? Pyresample had some old documentation that was doing the equivalent of Proj({'proj': 'eqc', 'lon_0': 0.0, 'lat_0': 0.0}) and it seems to error on Windows with RuntimeError: b'major axis or radius = 0 or not given' with pyproj 1.9.6 but with pyproj 2.3 it is fine. I would have assumed pyproj/proj to get more strict, not less strict. And I've never seen this error before. FYI this is PROJ 5.2.0 on Windows that fails.
    Alan D. Snow
    @snowman2
    Works fine for me on Linux:
    $ conda list proj
    # packages in environment at /home/snowal/miniconda3/envs/geocube:
    #
    # Name                    Version                   Build  Channel
    proj4                     5.2.0             he1b5a44_1003    conda-forge
    pyproj                    1.9.6           py36h516909a_1002    conda-forge
    (geocube) snowal@snowal-lx2:~$ python
    Python 3.6.7 | packaged by conda-forge | (default, Jul  2 2019, 02:18:42) 
    [GCC 7.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from pyproj import Proj
    >>> pj = Proj({'proj': 'eqc', 'lon_0': 0.0, 'lat_0': 0.0})
    >>> pj
    pyproj.Proj('+units=m +proj=eqc +lon_0=0.0 +lat_0=0.0 ', preserve_units=True)
    >>> import pyproj
    >>> pyproj.__version__
    '1.9.6'
    David Hoese
    @djhoese
    hhmmm, I'll have to try on a Windows VM later
    @snowman2 Just because I'm a pain, ETA on pyproj 2.3.1?
    Alan D. Snow
    @snowman2
    Not sure. Hopefully by this weekend if no more issue pop up. Plan on a release candidate this evening.
    Alan D. Snow
    @snowman2
    @djhoese Mind testing out: pip install https://github.com/pyproj4/pyproj/archive/v2.3.1rc2.tar.gz?
    David Hoese
    @djhoese
    @snowman2 That seems to work!
    FYI, did you know you can do pip install git+https://github.com/pyproj4/pyproj.git?
    (no need to make a release)
    can even add @branch-or-tag
    Alan D. Snow
    @snowman2
    Yes, I have done that before. Using the commit ref is usually the most efficient. There are many who package and deploy pyproj. The pre-release should allow them to build pyproj and report on any errors before the main release.
    David Hoese
    @djhoese
    :+1:
    David Hoese
    @djhoese
    @snowman2 I finally got a Windows VM up for the issue mentioned above. I definitely get the same error on Windows.
    will have to search through PROJ source for where it is coming from
    David Hoese
    @djhoese
    @snowman2 what's the current library holding up PROJ6 support on conda-forge for Windows? GDAL (2.4?) is built for Windows with PROJ6 isn't it?
    Alan D. Snow
    @snowman2
    I thought it was. Are you seeing something different?
    David Hoese
    @djhoese
    Cartopy seems to make it incompatible
    Alan D. Snow
    @snowman2
    Ah, I guess cartopy was built with PROJ 6.1.0 and the pin for most is 6.1.1 maybe? The windows build for 6.1.1 failed for cartopy I think.
    David Hoese
    @djhoese
    @snowman2 That looks right. I filed a cartopy-feedstock bug report. Thanks.
    Alan D. Snow
    @snowman2
    Thanks for filing the report. Hopefully we'll get the stack noci
    *working
    Wim De Clercq
    @Wim-De-Clercq

    Hey all, I'm working on upgrading pyproj from 1.9.4 to a more recent version. But I can't get past a change in output from pyproj.transform if I go to 2.2.1 and higher.

    import pyproj
    result = pyproj.transform(pyproj.Proj(init='EPSG:4326'),
                              pyproj.Proj(init='EPSG:31370'),
                              -50, -50)
    print(result)
    # 2.2.1: (-16648000.756625965, -13287157.707139067)
    # 1.9.4: (-16647936.738681808, -13287195.77167615)

    The outputs are in the comments, and the difference is really too big to ignore.
    What exactly is going wrong here?

    Joris Van den Bossche
    @jorisvandenbossche
    Can you try to remove the 'init' (on 2.2.1) ?
    so use pyproj.Proj('EPSG:4326') instead
    I also have been struggling with this (also with EPSG:31370 ;)), but thought for me the difference was smaller (not in the meters order)
    Wim De Clercq
    @Wim-De-Clercq
    That gives me the same output.
    I do have smaller differences with more realistic data rather than -50, -50
    149372.267141, 175495.954088 vs 149372.214872, 175495.952055.
    But still..
    Joris Van den Bossche
    @jorisvandenbossche
    Yes, I just wanted to say: if I try with values that are within the area of use, I get only the small difference I noticed before.
    In [27]: import pyproj 
        ...: result = pyproj.transform(pyproj.Proj(init='EPSG:4326'), 
        ...:                           pyproj.Proj(init='EPSG:31370'), 
        ...:                           4, 50) 
        ...: print(result)                                                                                                                                                                                             
    (123563.57130448119, 76585.07875370234)
    vs
    In [14]: import pyproj 
        ...: result = pyproj.transform(pyproj.Proj(init='EPSG:4326'), 
        ...:                           pyproj.Proj(init='EPSG:31370'), 
        ...:                           4, 50) 
        ...: print(result)                                                                                                                                                                                             
    (123563.56657479196, 76585.07854289468)
    Joris Van den Bossche
    @jorisvandenbossche
    So the small difference you see here (around 1 mm) is due to a different way to interpret the CRS. If you change (in pyproj 2) the EPSG code with the full proj4 string as found on eg epsg.io:
    In [17]: import pyproj 
        ...: result = pyproj.transform(pyproj.Proj('EPSG:4326'), 
        ...:                           pyproj.Proj('+proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-106.869,52.2978,-103
        ...: .724,0.3366,-0.457,1.8422,-1.2747 +units=m +no_defs'), 
        ...:                           4, 50, always_xy=True) 
        ...: print(result)                                                                                                                                                                                             
    (123563.5712753858, 76585.07851246372)
    this gives yet another result, but is closer to the result of pyproj 1.9.6. The difference here has to do with the +towgs84 which is not considered part of the EPSG:31370 definition
    But on your original example, why the difference is so big for unrealistic (outside of the area of use) coordinates, I am not sure
    Wim De Clercq
    @Wim-De-Clercq
    Ah yes, so it's not the transform, but the parsing of the Proj that makes the big difference.
            # 1.9.4:
            #  EPSG : (-16647936.738681808, -13287195.77167615)
            #  proj4: (-16647936.738681808, -13287195.77167615)
            # 2.2.1:
            #  EPSG : (-16648000.756625965, -13287157.707139067)
            #  proj4: (-16647936.738681737, -13287195.771676153)
    Joe McGlinchy
    @joemcglinchy
    hello! I have an installation question, as I can't seem to get Proj to update by updating pyproj. I've tried updating pyproj and proj4 via conda but Proj is still locked at 4.9.3, does anyone know how to get Proj updated to use some of the coordinate systems that depend on Proj version 5.2 in pyproj?
    David Hoese
    @djhoese
    @joemcglinchy Are you using the conda-forge channel at all or only the defaults?
    and do you have strict channel priority set?
    The newest versions of pyproj will be on conda-forge, but it also depends on what versions of other libraries you are using. Some libraries may not be built for the newest versions of PROJ. There are also some limitations about the versions of libraries available on Windows (like GDAL 3.x)
    Joe McGlinchy
    @joemcglinchy
    @djhoese i specified conda-forge on the install command. I don't think I have channel priority set
    David Hoese
    @djhoese

    do you have other PROJ related libraries installed @joemcglinchy? Like rasterio? cartopy? gdal?

    I think it is recommended that you set conda-forge as the channel for the entire environment (I always set it globally) and it is usually best to look in setting a channel_priority to "strict". Otherwise you end up with some packages from the defaults channel and some from conda-forge and they may conflict. What do you get when you do conda install -c conda-forge "pyproj>=2"? Note that pyproj 2.0+ depends on PROJ 6 so this is higher than the PROJ 5.2 that you want, but it's also the newest version so it'd be a good idea to upgrade now if you can.

    Joe McGlinchy
    @joemcglinchy
    @djhoese i do have other libraries installed. There was a conflict wiht my rasterio version (0.36). I tried installing a fresh environment w/ python 3.7, then installing geopandas (which successfully installed gdal and proj 5.2), but now have issues with installing rasterio. That is a whole other can of worms, though.
    David Hoese
    @djhoese
    @joemcglinchy There are much newer versions of rasterio (a 1.0+ release). Is there a reason you have to use that old of a version?