Sean Gillies (Posts about proj)https://sgillies.net/tags/proj.atom2023-12-31T01:26:20ZSean GilliesNikolaRasterio 1.0.18https://sgillies.net/2019/02/08/rasterio-1-0-18.html2019-02-08T18:01:47-07:002019-02-08T18:01:47-07:00Sean Gillies<p>Rasterio 1.0.14 made the package more correct in how it treats the spatial
reference systems we use to share and analyze gridded spatial data, but it also
introduced several bugs. I made three releases this week, two of them to fix
regressions caused by 1.0.14. "EPSG:3857" and "+init=epsg:3857" are interpreted
differently by GDAL and in 1.0.14 we accidentally flipped from the former to
the latter, obsolete representation of EPSG spatial reference system number
3857.</p>
<p>1.0.14 also broke the Python pickle protocol for CRS objects, something we
didn't know until users who have been sending dataset profiles, which contain
a CRS object, between processes using the multiprocessing module ran into
exceptions. There is a workaround for this and it will be fixed next week in
Rasterio 1.0.19. In case you're wondering what CRS pickle data looks like, it's
just a thin wrapper around a WKT string.</p>
<div class="code"><pre class="code pycon"><a id="rest_code_4e31cbe1138b4d8a985cf701e3d3df98-1" name="rest_code_4e31cbe1138b4d8a985cf701e3d3df98-1" href="https://sgillies.net/2019/02/08/rasterio-1-0-18.html#rest_code_4e31cbe1138b4d8a985cf701e3d3df98-1"></a><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">rasterio.crs</span> <span class="kn">import</span> <span class="n">CRS</span>
<a id="rest_code_4e31cbe1138b4d8a985cf701e3d3df98-2" name="rest_code_4e31cbe1138b4d8a985cf701e3d3df98-2" href="https://sgillies.net/2019/02/08/rasterio-1-0-18.html#rest_code_4e31cbe1138b4d8a985cf701e3d3df98-2"></a><span class="gp">>>> </span><span class="kn">import</span> <span class="nn">pickle</span>
<a id="rest_code_4e31cbe1138b4d8a985cf701e3d3df98-3" name="rest_code_4e31cbe1138b4d8a985cf701e3d3df98-3" href="https://sgillies.net/2019/02/08/rasterio-1-0-18.html#rest_code_4e31cbe1138b4d8a985cf701e3d3df98-3"></a><span class="gp">>>> </span><span class="n">pickle</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">CRS</span><span class="o">.</span><span class="n">from_epsg</span><span class="p">(</span><span class="mi">3857</span><span class="p">))</span>
<a id="rest_code_4e31cbe1138b4d8a985cf701e3d3df98-4" name="rest_code_4e31cbe1138b4d8a985cf701e3d3df98-4" href="https://sgillies.net/2019/02/08/rasterio-1-0-18.html#rest_code_4e31cbe1138b4d8a985cf701e3d3df98-4"></a><span class="go">b'\x80\x03crasterio.crs\nCRS\nq\x00)\x81q\x01X\xa4\x02\x00\x00PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]q\x02b.'</span>
</pre></div>
<p>Update to 1.0.18 as soon as you can and get the benefits of 1.0.14 without the
bugs.</p>