{"action":"closed","issue":{"url":"https://api.github.com/repos/mapbox/rasterio/issues/1539","repository_url":"https://api.github.com/repos/mapbox/rasterio","labels_url":"https://api.github.com/repos/mapbox/rasterio/issues/1539/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/rasterio/issues/1539/comments","events_url":"https://api.github.com/repos/mapbox/rasterio/issues/1539/events","html_url":"https://github.com/mapbox/rasterio/issues/1539","id":377392323,"node_id":"MDU6SXNzdWUzNzczOTIzMjM=","number":1539,"title":"Unable to open EPSG support file gcs.csv","user":{"login":"drnextgis","id":866124,"node_id":"MDQ6VXNlcjg2NjEyNA==","avatar_url":"https://avatars1.githubusercontent.com/u/866124?v=4","gravatar_id":"","url":"https://api.github.com/users/drnextgis","html_url":"https://github.com/drnextgis","followers_url":"https://api.github.com/users/drnextgis/followers","following_url":"https://api.github.com/users/drnextgis/following{/other_user}","gists_url":"https://api.github.com/users/drnextgis/gists{/gist_id}","starred_url":"https://api.github.com/users/drnextgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drnextgis/subscriptions","organizations_url":"https://api.github.com/users/drnextgis/orgs","repos_url":"https://api.github.com/users/drnextgis/repos","events_url":"https://api.github.com/users/drnextgis/events{/privacy}","received_events_url":"https://api.github.com/users/drnextgis/received_events","type":"User","site_admin":false},"labels":[{"id":64167168,"node_id":"MDU6TGFiZWw2NDE2NzE2OA==","url":"https://api.github.com/repos/mapbox/rasterio/labels/bug","name":"bug","color":"e7040f","default":true}],"state":"closed","locked":false,"assignee":{"login":"sgillies","id":33697,"node_id":"MDQ6VXNlcjMzNjk3","avatar_url":"https://avatars2.githubusercontent.com/u/33697?v=4","gravatar_id":"","url":"https://api.github.com/users/sgillies","html_url":"https://github.com/sgillies","followers_url":"https://api.github.com/users/sgillies/followers","following_url":"https://api.github.com/users/sgillies/following{/other_user}","gists_url":"https://api.github.com/users/sgillies/gists{/gist_id}","starred_url":"https://api.github.com/users/sgillies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgillies/subscriptions","organizations_url":"https://api.github.com/users/sgillies/orgs","repos_url":"https://api.github.com/users/sgillies/repos","events_url":"https://api.github.com/users/sgillies/events{/privacy}","received_events_url":"https://api.github.com/users/sgillies/received_events","type":"User","site_admin":false},"assignees":[{"login":"sgillies","id":33697,"node_id":"MDQ6VXNlcjMzNjk3","avatar_url":"https://avatars2.githubusercontent.com/u/33697?v=4","gravatar_id":"","url":"https://api.github.com/users/sgillies","html_url":"https://github.com/sgillies","followers_url":"https://api.github.com/users/sgillies/followers","following_url":"https://api.github.com/users/sgillies/following{/other_user}","gists_url":"https://api.github.com/users/sgillies/gists{/gist_id}","starred_url":"https://api.github.com/users/sgillies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgillies/subscriptions","organizations_url":"https://api.github.com/users/sgillies/orgs","repos_url":"https://api.github.com/users/sgillies/repos","events_url":"https://api.github.com/users/sgillies/events{/privacy}","received_events_url":"https://api.github.com/users/sgillies/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mapbox/rasterio/milestones/71","html_url":"https://github.com/mapbox/rasterio/milestone/71","labels_url":"https://api.github.com/repos/mapbox/rasterio/milestones/71/labels","id":3763420,"node_id":"MDk6TWlsZXN0b25lMzc2MzQyMA==","number":71,"title":"1.0.10","description":null,"creator":{"login":"sgillies","id":33697,"node_id":"MDQ6VXNlcjMzNjk3","avatar_url":"https://avatars2.githubusercontent.com/u/33697?v=4","gravatar_id":"","url":"https://api.github.com/users/sgillies","html_url":"https://github.com/sgillies","followers_url":"https://api.github.com/users/sgillies/followers","following_url":"https://api.github.com/users/sgillies/following{/other_user}","gists_url":"https://api.github.com/users/sgillies/gists{/gist_id}","starred_url":"https://api.github.com/users/sgillies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgillies/subscriptions","organizations_url":"https://api.github.com/users/sgillies/orgs","repos_url":"https://api.github.com/users/sgillies/repos","events_url":"https://api.github.com/users/sgillies/events{/privacy}","received_events_url":"https://api.github.com/users/sgillies/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":8,"state":"open","created_at":"2018-10-23T22:45:43Z","updated_at":"2018-11-17T00:55:36Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2018-11-05T13:07:29Z","updated_at":"2018-11-17T00:55:36Z","closed_at":"2018-11-17T00:55:36Z","author_association":"CONTRIBUTOR","body":"In case I install rasterio from github:\r\n\r\n```\r\n$ pip install git+https://github.com/mapbox/rasterio.git\r\n```\r\n\r\nthe following code works flawlessly:\r\n\r\n```\r\n>>> from rasterio.crs import CRS\r\n>>> CRS({'init': 'epsg:4326'}).is_geographic\r\nTrue\r\n```\r\n\r\nBut if  I install rasterio from PyPI I get such error:\r\n\r\n```\r\n>>> from rasterio.crs import CRS\r\n>>> CRS({'init': 'epsg:4326'}).is_geographic\r\nERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.\r\nTraceback (most recent call last):\r\n  File \"rasterio/_base.pyx\", line 1310, in rasterio._base._osr_from_crs\r\n  File \"rasterio/_err.pyx\", line 182, in rasterio._err.exc_wrap_int\r\nrasterio._err.CPLE_OpenFailedError: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"rasterio/_crs.pyx\", line 37, in rasterio._crs._CRS.is_geographic\r\n  File \"rasterio/_base.pyx\", line 1316, in rasterio._base._osr_from_crs\r\nrasterio.errors.CRSError: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.\r\n```\r\n\r\nTo overcome this issue we've wrapped the code that need access to `GDAL_DATA` with `rasterio.Env()`:\r\n\r\n```\r\n>>> import rasterio\r\n>>> from rasterio.crs import CRS\r\n>>> with rasterio.Env():\r\n...     CRS({'init': 'epsg:4326'}).is_geographic\r\n... \r\nTrue\r\n>>> CRS({'init': 'epsg:3857'}).is_geographic\r\nFalse\r\n```\r\n\r\nIs it expected behavior? It looks strange that subsequent calls of the same code works fine without wrapping. Another interesting case is when we call `is_geographic` without wrapping then the next call with wrapping doesn't work:\r\n\r\n```\r\n>>> import rasterio\r\n>>> from rasterio.crs import CRS\r\n>>> CRS({'init': 'epsg:4326'}).is_geographic\r\nERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.\r\nTraceback (most recent call last):\r\n  File \"rasterio/_base.pyx\", line 1310, in rasterio._base._osr_from_crs\r\n  File \"rasterio/_err.pyx\", line 182, in rasterio._err.exc_wrap_int\r\nrasterio._err.CPLE_OpenFailedError: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"rasterio/_crs.pyx\", line 37, in rasterio._crs._CRS.is_geographic\r\n  File \"rasterio/_base.pyx\", line 1316, in rasterio._base._osr_from_crs\r\nrasterio.errors.CRSError: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.\r\n>>> with rasterio.Env():\r\n...     CRS({'init': 'epsg:4326'}).is_geographic\r\n... \r\nTraceback (most recent call last):\r\n  File \"rasterio/_base.pyx\", line 1310, in rasterio._base._osr_from_crs\r\n  File \"rasterio/_err.pyx\", line 182, in rasterio._err.exc_wrap_int\r\nrasterio._err.CPLE_OpenFailedError: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 2, in <module>\r\n  File \"rasterio/_crs.pyx\", line 37, in rasterio._crs._CRS.is_geographic\r\n  File \"rasterio/_base.pyx\", line 1316, in rasterio._base._osr_from_crs\r\nrasterio.errors.CRSError: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.\r\n```\r\n\r\n@sgillies please take a look."}}
{"actor":{"display_login":"sgillies"}}