<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kipling Crossing on Medium]]></title>
        <description><![CDATA[Stories by Kipling Crossing on Medium]]></description>
        <link>https://medium.com/@kipling?source=rss-e144e2e143fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nXhH0iOYBerBRJIL8GWcog.png</url>
            <title>Stories by Kipling Crossing on Medium</title>
            <link>https://medium.com/@kipling?source=rss-e144e2e143fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 22:31:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kipling/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Python types are AWESOME!]]></title>
            <link>https://kipling.medium.com/python-types-are-awesome-4c426b3b34ab?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c426b3b34ab</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Mon, 25 Sep 2023 07:47:58 GMT</pubDate>
            <atom:updated>2023-09-25T07:47:58.093Z</atom:updated>
            <content:encoded><![CDATA[<h3>In this video I introduce Python and teach types as a fundamental core concept. Enjoy!</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FxmHgyZV3fD8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxmHgyZV3fD8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FxmHgyZV3fD8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e3c73226e25d258748d3ee230e93c10/href">https://medium.com/media/1e3c73226e25d258748d3ee230e93c10/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c426b3b34ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discover the Secret to Effortlessly Writing Articles for Medium with AI!]]></title>
            <link>https://kipling.medium.com/discover-the-secret-to-effortlessly-writing-articles-for-medium-with-ai-984779be1b80?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/984779be1b80</guid>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[chatgtp]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Mon, 19 Dec 2022 07:11:09 GMT</pubDate>
            <atom:updated>2022-12-19T07:12:44.575Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*P_sRe_E2vMQ6bmfni6w6IA.jpeg" /><figcaption>Made via <a href="https://creator.nightcafe.studio/">https://creator.nightcafe.studio</a></figcaption></figure><p>Using artificial intelligence (AI) to write articles for Medium or any other platform can be a convenient and efficient way to produce content without having to put in much effort. However, it’s important to keep in mind that AI is not a replacement for human writers and may not always produce content of the same quality as a human.</p><p>Here are some steps you can follow to use AI to write your articles for Medium:</p><ol><li>Choose an AI writing tool: There are several AI writing tools available that can help you produce content for your articles. Some popular options include Wordsmith, Articoolo, Quill, and now, ChatGTP. Each of these tools has its own set of features and capabilities, so it’s important to do your research and choose the one that best meets your needs.</li><li>Provide input to the AI: Most AI writing tools work by taking input in the form of a prompt or a set of keywords, and then generating content based on that input. To get started, simply provide the AI with a topic or theme that you want to write about, and it will generate a rough draft of your article.</li><li>Edit and revise the AI’s output: While the AI’s output may be a good starting point, it’s unlikely to be perfect. You’ll need to edit and revise the content to ensure that it’s accurate, well-written, and meets your standards. This may involve adding or deleting information, rephrasing sentences, and correcting errors.</li><li>Publish and promote your article: Once you’re satisfied with the final version of your article, you can publish it on Medium or any other platform of your choice. Don’t forget to promote your article through social media, email, or any other channels you have access to, in order to reach a wider audience.</li></ol><p>It’s important to keep in mind that using AI to write your articles does not completely eliminate the need for human input and oversight. Even if you use an AI writing tool, you’ll still need to provide input, edit and revise the content, and promote your article. However, using AI can be a useful tool to help you produce high-quality content more efficiently.</p><p>(This was written by ChatGTP)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*_7XbQWsqAjl3JeI2x_DHPg.png" /><figcaption>Screenshot From ChatGTP</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=984779be1b80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Must-Have Tools for Working with Big Raster Data in Python: Zarr, Dask, and More!]]></title>
            <link>https://kipling.medium.com/3-must-have-tools-for-working-with-big-raster-data-in-python-zarr-dask-and-more-ebf08eaa3ce9?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebf08eaa3ce9</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[xarray]]></category>
            <category><![CDATA[zarr]]></category>
            <category><![CDATA[dask]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Mon, 19 Dec 2022 06:58:15 GMT</pubDate>
            <atom:updated>2022-12-19T06:58:15.854Z</atom:updated>
            <content:encoded><![CDATA[<p>Python is a powerful and popular language for data analysis and manipulation, and it is particularly well-suited for working with large, complex datasets. This is especially true when it comes to working with raster data, which is data that is organized into grids or arrays of cells, each of which can store a single value or set of values. In this article, we will explore some of the key tools and libraries that can be used to work with big raster data in Python, including zarr, dask, and xarray.</p><p>One of the main reasons that Python is so well-suited for working with big data is its rich ecosystem of libraries and tools that can be used to perform a wide range of data analysis and manipulation tasks. Some of the key libraries that are useful for working with big raster data include zarr, dask, and xarray.</p><p>Zarr is a Python library for efficiently storing and manipulating large, multi-dimensional arrays of data. It is particularly well-suited for working with raster data, as it allows users to store and manipulate large arrays of data in a way that is both efficient and easy to use. One of the key advantages of zarr is its use of chunking, which allows users to store and manipulate large arrays of data in smaller chunks, rather than as a single, monolithic array. This can be particularly useful for working with large raster datasets, as it allows users to work with smaller chunks of data at a time, rather than having to load the entire dataset into memory.</p><p>Dask is a powerful Python library for working with distributed systems. It allows users to perform complex data manipulation and analysis tasks on large datasets by dividing the work up into smaller chunks and distributing it across a cluster of machines. This can be particularly useful for working with large raster datasets, as it allows users to take advantage of the processing power of multiple machines to perform complex tasks more quickly.</p><p>Xarray is a Python library that provides a powerful set of tools for working with multi-dimensional arrays of data. It is particularly well-suited for working with raster data, as it allows users to store and manipulate large arrays of data in a way that is both efficient and easy to use. One of the key advantages of xarray is its ability to provide context to raster data, such as metadata about the data and the coordinates of each cell in the array. This can be particularly useful for working with large raster datasets, as it allows users to better understand and analyze the data.</p><p>There are many resources available for those who are interested in learning more about working with big raster data in Python. Some good places to start include the documentation for the zarr, dask, and xarray libraries, as well as online tutorials and courses on data analysis and manipulation with Python.</p><p>In conclusion, Python is a powerful and popular language for working with big raster data, and there are many libraries and tools available that can help users store, manipulate, and analyze large arrays of data efficiently and effectively. Whether you are a data scientist, researcher, or simply someone who is interested in working with large datasets, Python is a great choice for working with big raster data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebf08eaa3ce9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big Data Arrays with Python]]></title>
            <link>https://kipling.medium.com/big-data-arrays-with-python-2d3de2babdf9?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d3de2babdf9</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[zarr]]></category>
            <category><![CDATA[dask]]></category>
            <category><![CDATA[numpy]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Mon, 26 Jul 2021 04:11:33 GMT</pubDate>
            <atom:updated>2021-07-26T04:11:33.947Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EDmSHyxIqgyvy5RCjpQhA.png" /><figcaption>source: <a href="https://speakerdeck.com/rabernat/zarr-ogc-2020">https://speakerdeck.com/rabernat/zarr-ogc-2020</a></figcaption></figure><h3>Big Data</h3><p>Numpy arrays are great! They provide an intuitive high-level interface analysing and manipulating multi-dimensional data. They are also very efficient at performing arithmetic and linear-algebraic tasks, making them the perfect tool for working with structured, grid-like data.</p><p>To provide this performance, numpy arrays are held in memory and therefore there is a limit to the amount of data that can be considered in one array. Often this isn’t a problem and we can enjoy the plethora of methods that are provided by the numpy library for efficient computation. For some tasks, the data is too large to fit into memory, causing a Big Data problem. We could throw more memory at the problem, but in most cases, it is impossible to foresee the extent of the data that we might be working with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XyaQOSG-TH9HQ5MFogXAUA.png" /><figcaption>numpy MemoryError example</figcaption></figure><h3>Chunked Arrays</h3><p>In this article, I will introduce the concept of chunked arrays that deal with this Big Data problem. I’ll also include some examples so you can following along.</p><p>Chunked arrays are arrays that break large arrays into smaller, manageable sided numpy arrays; called chunks. These chunks are stored on disk and reference via an index. Their indexes are the relative coordinates of the chunks in relation to the overall array. This chunking allows our memory to hold and process the data in smaller, bite-sized arrays.</p><h3>Zarr</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*m2wJwZoLvVUjA6dlcTNt5w.png" /><figcaption>Zarr logo</figcaption></figure><p>Zarr is a lightweight library for managing chunked arrays. It allows the creation of arrays with a defined chunked size. These arrays written to disk and their data are able to be accessed and updated on the fly. The following example demonstrates the numpy-like interface for reading and writing data to persisted arrays:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b87533e1ded7a7f90b1cdcf35128708f/href">https://medium.com/media/b87533e1ded7a7f90b1cdcf35128708f/href</a></iframe><p>The only limit to the size of Zarr arrays is the storage hardware, and with support for cloud storage, the size is practically limitless.</p><h3>Rechunker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lIlvTjHyJMBaqffftoTUAg.png" /><figcaption>rechunking visualization. source: <a href="https://speakerdeck.com/rabernat/rechunker-esip-summer-2020">https://speakerdeck.com/rabernat/rechunker-esip-summer-2020</a></figcaption></figure><p>Reading data from a chunked array can be very efficient if done right. If you read (or slice) a section of the array that is within one chunk, loading the data into memory will be pretty quick. However, when reading data across multiple chunks, performance can become considerably worse. You also don’t want to make your chunks too big, otherwise, this may not only impact performance, but your data may not fit into memory at all! Therefore, your chunks must be just the right size based on your usage of the array. There may be cases where you can’t choose the initial chunk size of the array. This is where the rechunker package comes in handy. The following is an example of changing the chunks of a 2d array form (1000, 1000) to (500, 2000):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ff75a8f2f2ecdb7c70740a2347a0388/href">https://medium.com/media/4ff75a8f2f2ecdb7c70740a2347a0388/href</a></iframe><p>Rechunker is a powerful and efficient way of rechunking chunked arrays.</p><h3>Dask</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*OkSkoowiEtky6MiiT2rSrQ.png" /><figcaption>Dask logo</figcaption></figure><p>Dask is a powerful library for parallel computing. It provides an intuitive and flexible interface for processing data on distributed systems. Dask also provides a range of high-level interfaces for reading, writing and manipulating data. In particular, Dask arrays have a, very close to, numpy-like experience and include many of the same built-in methods. Further to this, like Zarr arrays, Dask arrays are also chunked allowing processing to be done on each chunk. This means you will never run into memory problems and the worst-case scenario is that processing will take forever on your local machine, requiring you to throw some parallel processors at the problem.</p><p>The following example will demonstrate the numpy-like interface that dask-arrays provide</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/207fc989965b2ca278556cface15767a/href">https://medium.com/media/207fc989965b2ca278556cface15767a/href</a></iframe><h3>Conclusion</h3><p>Without having to learn a new python interface for dealing with arrays, these handfuls of tools can help us solve our big data problems when analyzing and manipulating arrays in python.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d3de2babdf9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using a GeoTiff and a touch of Python to make Topographic Images]]></title>
            <link>https://kipling.medium.com/using-a-geotiff-and-a-touch-of-python-to-make-topographic-images-1c1b0349551b?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c1b0349551b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[geotiff]]></category>
            <category><![CDATA[geospatial]]></category>
            <category><![CDATA[nogdal]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Sat, 20 Mar 2021 04:39:04 GMT</pubDate>
            <atom:updated>2021-03-20T05:30:45.707Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*dDr2sIel_AFpPTlcBkngQQ.png" /></figure><p>The purpose of this article is not to produce the best Topographic images (I’m not an artist); rather, it is to demonstrate how easy it can be to read and manipulate GeoTiff data.</p><h3>Setup</h3><p>All we need to kick us off is a GeoTiff file and a few packages that can be installed via pip. I am using elevation data that I downloaded from <a href="https://data.gov.au/dataset/ds-ga-22be4b55-2465-4320-e053-10a3070a5236/details?q=">data.gov.au</a> but you can BYO if you like.</p><p>The main package is the <a href="https://pypi.org/project/geotiff/"><strong>geotiff</strong></a> package:</p><blockquote><strong>pip install geotiff</strong></blockquote><p>This is a <a href="https://kipling.medium.com/nogdal-e5b60b114a1c">noGDAL</a> python package that I’m developing to read geoTiff files as numpy arrays; hence we will also need <a href="https://pypi.org/project/numpy/"><strong>numpy</strong></a>:</p><blockquote><strong>pip install numpy</strong></blockquote><p>And finally, to produce images, let’s use <a href="https://pypi.org/project/Pillow/"><strong>Pillow</strong></a></p><blockquote><strong>pip install Pillow</strong></blockquote><h3>Reading a GeoTiff</h3><p>Often, we want to read only a section of our GeoTiff file; either because we are interested in a certain area or our files are very large (sometimes multiple gigabytes). Thankfully there is a <strong>read_box</strong> method that takes a bounding box and returns a 2D array of all the points inside that box.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26f9f8407d050c34d750de3e384a347a/href">https://medium.com/media/26f9f8407d050c34d750de3e384a347a/href</a></iframe><h3>Manipulating the Data and making Images</h3><p>The first thing to do is to view the data using <strong>Pillow</strong>. We will need to scale the values to a range from 0 to 255 (the range of values for the RGB system). Let’s save this as <em>“greyscale_dem.png”</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef07bd5e1b4396c24fbf26c1118b9b88/href">https://medium.com/media/ef07bd5e1b4396c24fbf26c1118b9b88/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*hQtdeFS1sdmD2YttFwrn5A.png" /><figcaption>greyscale_dem.png</figcaption></figure><p>That’s cool, but I’d like to see some colour. To do this, I made a function called <strong>colorize</strong> that changes the RGB values based on a set of rules; but you can make your own rules depending on how you’d like it to look. I then looped over each value in the array to produce the RGB values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89dd951718f54cbabe07d5b64843e214/href">https://medium.com/media/89dd951718f54cbabe07d5b64843e214/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*XMmYNZC8V2CPVaBvbJ-7cQ.png" /><figcaption>color_dem.png</figcaption></figure><p>I’d also like to add some shading to the hills. This should be a function of the hill slope in the north-south direction. Lucky for us, <strong>numpy</strong> has a <strong>gradient</strong> method to do just that. The gradient method returns a tuple of size two with the gradient arrays in the y-direction and the x-direction.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47d9694b0fd215514f51c22809888ac9/href">https://medium.com/media/47d9694b0fd215514f51c22809888ac9/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*3hX2ZGSa5r-VqhcY6ZzLcw.png" /><figcaption>slope_dem.png</figcaption></figure><p>And finally, we can combine the two by decreasing the RGB values based on the magnitude of the slope values (scales from 0 to 1):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b21fd57e78dadf3e9ccd3fb745fb4d50/href">https://medium.com/media/b21fd57e78dadf3e9ccd3fb745fb4d50/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*dDr2sIel_AFpPTlcBkngQQ.png" /><figcaption>color_slope_dem.png</figcaption></figure><p>Here’s the full script:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d99cb167af34a9e116807bd22356e5ad/href">https://medium.com/media/d99cb167af34a9e116807bd22356e5ad/href</a></iframe><p>Typically, to achieve this with python, you would have to install GDAL onto your system. GDAL comes with a steep learning curve, for both installation and usage which I discuss in my article; <a href="https://kipling.medium.com/nogdal-e5b60b114a1c"><strong>Geospatial Python without GDAL</strong></a><strong>. </strong>With <a href="https://kipling.medium.com/the-geotiff-python-package-bfa6765d7bd6"><strong>the geotiff python package</strong></a>, I aim to reduce the hassle when reading and writing GeoTiff files. If you like this aim, please support me by heading over to the <a href="https://github.com/Open-Source-Agriculture/geotiff"><strong>geotiff GitHub repo</strong></a> and giving it a star. The project still has a way to go before it’s stable and has all the features I’d like to implement, so the support would be very appreciated. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c1b0349551b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The geotiff Python Package]]></title>
            <link>https://kipling.medium.com/the-geotiff-python-package-bfa6765d7bd6?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfa6765d7bd6</guid>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[geotiff]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[geospatial]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Sun, 03 Jan 2021 23:16:49 GMT</pubDate>
            <atom:updated>2021-01-03T23:16:49.537Z</atom:updated>
            <content:encoded><![CDATA[<h3>Reading and writing GeoTIFF files with pure Python</h3><p><em>[You can read the full article for free </em><a href="https://kipcrossing.github.io/2021-01-03-noGDAL/"><em>on my blog]</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K7eVejlQwEacvw94S-hstg.png" /></figure><p><a href="https://kipcrossing.github.io/2020-12-22-TT-DR/"><strong>TT;DR</strong></a>?</p><p>I’m writing a <a href="https://kipcrossing.github.io/2021-01-03-noGDAL/">noGDAL</a> python package for reading and writing geotiff files. You can view/follow the project in the <a href="https://github.com/Open-Source-Agriculture/geotiff">geotiff Github repo</a>.</p><h3>Reading and writing GeoTIFF files with pure Python</h3><p>During my adventures into geospatial python, I’ve noticed that there aren’t any pure python packages for reading, manipulating and writing GeoTIFF files with python. There are GDAL and GDAL based packages, but GDAL can be a massive headache to install; it would be much better to have a noGDAL python package for this. You can read about the noGDAL philosophy in my article; <a href="https://kipcrossing.github.io/2021-01-03-noGDAL/">noGDAL: Geospatial Python without GDAL</a>.</p><h3>The Start of a Project</h3><p>I’ve made a little bit of progress with the <a href="https://pypi.org/project/geotiff/">geotiff package</a> that provides a simple proof of concept. However, there is still a big learning curve and a lot to do. I think this would be a cool project and a great opportunity to learn, in detail, about the structure of GeoTIFF files. So before continuing the development of this package, I’d like to invite you, and anyone who would be interested in this project to become a contributor and give their input. Please come and introduce yourself on the <a href="https://github.com/Open-Source-Agriculture/geotiff/discussions/4">projects discussion board</a>.</p><h3>Flavour</h3><p>The following are the features that I would like to see included in this package (open for discussion).</p><h4>Core Features</h4><ul><li>read tiff files (including BigTiff)</li><li>write tiff files (including BigTiff)</li><li>convert between coordinate systems</li><li>cut a section (bounding box) of the tiff file</li><li>convert the data to numpy arrays</li></ul><h4>Additional features</h4><ul><li>Full test coverage</li><li>Typing with lint checking using mypy</li><li>Documentation: doc blocs and readthedocs</li></ul><h3>Ingredients</h3><p>Based on my research, these are the dependencies that would be used to achieve the above feature goals.</p><h4>tifffile</h4><p>The <a href="https://pypi.org/project/tifffile/">tifffile</a> package will be the core dependency that this project will be based around. It will give us the ability to; read and write to and from numpy arrays, read and write the geotags and even handle bigTiff files. Because of this project, most of the work is already done for us.</p><h4>numpy</h4><p><a href="https://pypi.org/project/numpy/">Numpy</a> arrays will be the main outputs when reading the GeoTIFF files. Arrays will give the user the flexibility to manipulate the data however they want. They can also</p><h4>pyproj</h4><p>The <a href="https://pypi.org/project/pyproj/">pyproj</a> dependency will be used for converting between different coordinate systems. It would be preferable to abstract coordinate conversion away from the user as much as possible while still giving the flexibility to change the defaults; if needed.</p><h4>zarr</h4><p>With <a href="https://pypi.org/project/zarr/">zarr</a>, we will be able to read and write BigTIFF files. This would be a game-changing feature.</p><h4>shapely</h4><p>This one is a maybe. <a href="https://pypi.org/project/Shapely/">Shapely</a> would be useful for cutting and masking based on polygons. There is also some other ‘quality of life’ features that may come in handy when working with 2d data.</p><h3>Recipe</h3><p>The core challenge of this project will be translating the <a href="https://github.com/Open-Source-Agriculture/geotiff/blob/main/docs/geotif_spec.md">GeoTIFF spec</a> for reading the various geotags and obtaining the coordinate system that should be used to transform the coordinates.</p><p>Again, if you see value in this project, please introduce yourself on the <a href="https://github.com/Open-Source-Agriculture/geotiff/discussions/4">projects discussion board</a>. It would be great to see you there are get your input.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfa6765d7bd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[noGDAL]]></title>
            <link>https://kipling.medium.com/nogdal-e5b60b114a1c?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5b60b114a1c</guid>
            <category><![CDATA[geospatial]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[gdal]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Sun, 03 Jan 2021 04:15:44 GMT</pubDate>
            <atom:updated>2021-01-03T04:15:44.184Z</atom:updated>
            <content:encoded><![CDATA[<h3>Geospatial Python without GDAL</h3><p><em>[You can read the full article for free </em><a href="https://kipcrossing.github.io/2021-01-03-noGDAL/"><em>on my blog]</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*4aLaatt6S99f7SWeshsHWQ.png" /></figure><p>NoGDAL is a simple philosophy. To write a noGDAL program means that the program does ‘not rely upon GDAL as a dependency’.</p><p>When programming a geospatial application with python, we often need to read and write raster files, convert coordinate systems or do some processing of geospatial data. When faced with these problems the solution, more often than not, involves GDAL or a GDAL based python library. GDAL seems to be a staple in the world of geospatial Python and I refuse to use it!</p><h3>Installation and Usage Nightmare</h3><p>You may get lucky, but generally, when installing GDAL onto your system it’s not as simple as spinning up your favourite package manager and having it work.</p><p>There are usually many gotchas along the way. In fact, the GDAL documentation has an entire page dedicated to <a href="https://gdal.org/api/python_gotchas.html"><em>Python Gotchas in the GDAL and OGR Python Bindings</em></a>. Some of the main gotchas include:</p><ul><li>Python bindings do not raise exceptions unless you explicitly call UseExceptions()</li><li>Python crashes if you use an object after deleting an object it has a relationship with</li><li>Python crashes in GDAL functions when you upgrade or downgrade numpy</li></ul><p>This is a bad sign for users who want to get a quick solution without having to wade through documentation and learn a new programming style.</p><p>The core of these problems is that GDAL was not written for or in python. The GDAL Python package is just a wrapper around the C++ GDAL library. Therefore, along with the installation nightmare, there are usage nightmares. As stated by the <strong>rasterio</strong> documentation:</p><p><em>” Python programs using them tend to read and run like C programs. For example, GDAL’s Python bindings require users to watch out for dangling C pointers, potential crashers of programs. This is bad”</em></p><h3>Common solution to GDALs problems</h3><h3>Fences</h3><p>Often when working on a product, we find ourselves having to use virtual environments, Docker containers or virtual environments inside docker containers to make sure that the various solutions to different problems don’t conflict</p><h3>Other GDAL based packages</h3><p>There have been attempts to abstract the GDAL problems away from the user so coding may be a bit more pythonic; the most commonly used is the <a href="https://pypi.org/project/rasterio/">rasterio</a> package. This is a big step in the right direction, but still has issues due to its underlying use of GDAL. Let’s take in this lovely statement from the rasterio docs:</p><p><em>” Rasterio 1.0.x works with Python versions 2.7.x and 3.5.0 through 3.7.x, and GDAL versions 1.11.x through 2.4.x. Official binary packages for Linux and Mac OS X are available on PyPI. Unofficial binary packages for Windows are available through other channels. Rasterio 1.0.x is not compatible with GDAL versions 3.0.0 or greater.”</em></p><p>That’s a bummer for users of the latest python versions and a <em>‘too bad so sad’</em> for windows users.</p><h3>My solution to GDALs problems</h3><p>Simple, don’t use GDAL. By not using GDAL and using pure python, I am able to write code without having to worry about differences in various system installations, numpy versions, syntax gotchas and compatibility issues.</p><h3>Writing a noGDAL geospatial python program</h3><p>In my experience, the following are some honourable mentions when choosing the ingredients for cooking a geospatial pie:</p><ul><li><a href="https://pypi.org/project/pyshp/"><strong>pyshp</strong></a><strong>:</strong> The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles in pure Python.</li><li><a href="https://pypi.org/project/tifffile/"><strong>tifffile</strong></a><strong>:</strong> To read and write tiff files to are from numpy arrays</li><li><a href="https://pypi.org/project/PyKrige/"><strong>PyKrige</strong></a><strong>:</strong> For 2D and 3D ordinary and universal kriging.</li><li><a href="https://pypi.org/project/csaps/"><strong>csaps</strong></a><strong>:</strong> For univariate, multivariate and n-dimensional grid data approximation using cubic smoothing splines.</li><li><a href="https://pillow.readthedocs.io/en/stable/"><strong>pillow</strong></a><strong>:</strong> The Python Imaging Library adds image processing capabilities to your Python interpreter.</li><li><a href="https://pypi.org/project/geojson/"><strong>geojson</strong></a><strong>:</strong> With Functions for encoding and decoding GeoJSON formatted data and Classes for all GeoJSON Objects</li><li><a href="https://pypi.org/project/Shapely/"><strong>shapely</strong></a><strong>:</strong> Manipulation and analysis of geometric objects in the Cartesian plane.</li><li><a href="https://pypi.org/project/pyproj/"><strong>pyproj</strong></a><strong>:</strong> Cartographic projections and coordinate transformations library</li></ul><h3>Why I have this opinion</h3><p>Obviously, I’m being very opinionated here and my ideas won’t be for everyone; especially for those who have mastered the GDAL learning curve. These are some of the reasons I like the noGDAL philosophy:</p><ul><li>I like to write libraries and code for others to use (including future me)</li><li>I’d like the user to have an easy installation process</li><li>I like pure python and pythonicness</li><li>I like being able to install with only pip.</li></ul><p>Often, I can get started with using a package in minutes. It’s as simple as:</p><pre>pip install package</pre><p>And in code:</p><pre>import package<br>package.Object().do_somthing()</pre><p>Then move onto writing creative code. I don’t want to spend hours in the documentation for something that should be quick and simple; and I don’t wish this upon others either.</p><h3>A noGDAL Project</h3><p>I’m working on a python noGDAL open-source project called <strong>geotiff</strong>. The aims of this project are to be able to:</p><ul><li>read tiff files (including BigTiff)</li><li>write tiff files (including BigTiff)</li><li>convert between coordinate systems</li><li>cut a section (bounding box) of the tiff file</li><li>convert the data to numpy arrays</li></ul><p>I’m hoping that this could be a collaborative effort (as I, like many, don’t have all the best answers). If you would like to get involved in this project, please go to the <a href="https://github.com/Open-Source-Agriculture/geotiff">geotiff repo</a> give it a star and introduce yourself in the Discussions tab.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5b60b114a1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TT;DR]]></title>
            <link>https://kipling.medium.com/tt-dr-b9d23fda061e?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9d23fda061e</guid>
            <category><![CDATA[technical]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[writing-tips]]></category>
            <category><![CDATA[tldr]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Sun, 15 Nov 2020 03:18:33 GMT</pubDate>
            <atom:updated>2020-11-15T03:18:33.675Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Too Technical; Didn’t Read</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGK1SQzgvgVh1i-DzomSkw.jpeg" /><figcaption><a href="https://www.flickr.com/photos/83633410@N07/7658298768">“Confused”</a> by <a href="https://www.flickr.com/photos/83633410@N07">CollegeDegrees360</a> is licensed under <a href="https://creativecommons.org/licenses/by-sa/2.0/?ref=ccsearch&amp;atype=rich">CC BY-SA 2.0</a></figcaption></figure><p>Sometimes when reading up on a new technology, we are confronted with a section that is overly technical and detailed. Yes, it is important that these sections exist so that we can deep dive and make sure the logic and processed behind the tech is sound BUT often we want to just jump in and use it. We need a quick section on why and how to implement the tech that doesn’t include details on how it’s made.</p><h3>Introducing TT;DR (<em>Too Technical; Didn’t Read</em>)</h3><p>A section that you can include in your articles to give the reader a quick overview of the tech, without forcing them to wade through technical/industry specific jargon or irreverent content to a user.</p><p>This idea is based on the commonly used <a href="https://en.wikipedia.org/wiki/Wikipedia:Too_long;_didn%27t_read">TL;DR</a> (Too Long; Didn’t Read). A section in many online texts and articles to ensure a time poor or lazy reader gets value out of your content or can bookmark it for in-depth later reading.</p><h3>Why did I coin this term?</h3><p>When I think about the type of content that I like to write, often I want to go deep on some of the more technical aspects of the topic. I foresee that this could go over the heads of many readers, forcing them to take out the time to brush up on the topic specific terminology to understand that section. I’d like to give the readers a brief summary of the technical content so they can choose whether to skip over that section.</p><p><em>If you also think the</em><strong><em> TT;DR</em></strong><em> acronym would be helpful. Hyperlink this article when you use it so that your readers may understand what the purpose of the section</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9d23fda061e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interacting with an Ethereum Voting Smart-Contract using Pythons web3]]></title>
            <link>https://kipling.medium.com/interacting-with-an-ethereum-voting-smart-contract-using-pythons-web3-e83b8ec86e6?source=rss-e144e2e143fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e83b8ec86e6</guid>
            <category><![CDATA[voting]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[etherium]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Kipling Crossing]]></dc:creator>
            <pubDate>Sat, 14 Nov 2020 11:25:25 GMT</pubDate>
            <atom:updated>2020-11-14T11:34:57.159Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*2QWmTgHouYb7uqarDiO9Fg.png" /><figcaption><a href="https://www.flickr.com/photos/149639283@N08/26835127249">“ETC Wallpaper — Smart Contract”</a> by <a href="https://www.flickr.com/photos/149639283@N08">EthereumClassic</a> is marked with <a href="https://creativecommons.org/licenses/cc0/1.0/?ref=ccsearch&amp;atype=rich">CC0 1.0</a></figcaption></figure><p>In this article, we will use the <a href="https://pypi.org/project/web3/">web3.py</a> python library to demonstrate that anyone can interact with the <a href="https://digipol.app/">DigiPol</a> smart-contract in their own way by demonstrating how to get the vote count of a particular ballot.</p><p>The <a href="https://digipol.app/">DigiPol</a> app uses smart contracts on the Ethereum network to publish ballots, make votes and get voting results. Ethereum is a decentralized cryptocurrency with smart contract capability. This means that the information on the Ethereum blockchain and the smart contract methods may be accessible by the anyone!</p><h3>Set-up</h3><p>Before starting, you will need to install web3.py onto your system. You can do this via pip:</p><pre>pip install web3</pre><p>You will also need to have an private key and save as an environmental variable. Here we will save it as <strong>PRIVATE_KEY</strong>. If you don’t have one, you can generate one using a service like <a href="https://metamask.io/">MetaMask</a>. Now let’s start coding!</p><h3>Using web3</h3><p>From web3.py we will need to import the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/20b1e16ad797bb9bb8c1296c138a8a96/href">https://medium.com/media/20b1e16ad797bb9bb8c1296c138a8a96/href</a></iframe><p>In order to interact with the DigiPol smart contract, we will need:</p><ul><li>A private key</li><li>The testnet endpoint (an ethereum testnet)</li><li>The smart contract address</li><li>The smart contract abi (a json file to help define the smart contract methods with web3)</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/42ebe04fcbf57f8d3ab35912ef345803/href">https://medium.com/media/42ebe04fcbf57f8d3ab35912ef345803/href</a></iframe><p><em>Note, the json file for the abi can be produced from the </em><a href="https://github.com/voteflux/voting-alpha-mini-sc"><em>smart contract repo</em></a><em> or you can use </em><a href="https://github.com/voteflux/voting-alpha-mini-sc/blob/master/VotingAlpha.abi.json"><em>one we prepared earlier</em></a><em>.</em></p><p>Next, we get the smart contract as a python object:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52b71fc6d9316a87a27cb2c807145075/href">https://medium.com/media/52b71fc6d9316a87a27cb2c807145075/href</a></iframe><p>We then add our <strong>private key</strong> to web3 via the middleware:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ddec2b44f57c88934d0577cdffe6e706/href">https://medium.com/media/ddec2b44f57c88934d0577cdffe6e706/href</a></iframe><p>Now we are all set up and can start to interact with smart contract.</p><h3>Getting the vote count</h3><p>Each ballot has an associated ‘<strong>ballotspec hash’</strong>, a unique identifier string for that bill. All of the spec hashes are publicly available. Here we will use an existing one to get the ballot id via the <strong>getProposalId</strong> smart contract method. Then we can get the ballot (proposal) information using the <strong>getProposal</strong> method which returns a list of related information.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/64ec8e1861cd50ee0ba5bcaa514ed430/href">https://medium.com/media/64ec8e1861cd50ee0ba5bcaa514ed430/href</a></iframe><p>Finally we can get the vote counts for the ballot. The <em>no</em> votes are in position <strong>3</strong> of the <strong>proposalInfo</strong> list and the <em>yes</em> votes are in position <strong>4</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9e38d9619b6d9c051e55710a838461e/href">https://medium.com/media/f9e38d9619b6d9c051e55710a838461e/href</a></iframe><p><em>Voilà!</em></p><p>Now you can check the votes on the blockchain directly and don’t have to trust the results that are shown in DigiPol app. You should use the DigiPol app though as it’s pretty cool and looks a lot nicer!</p><h3>Full example</h3><p>Here is the full script wrapped in a <strong>get_votes_from_blochchain</strong> function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/411e47bfa84aa1b2b477a9fa101eb884/href">https://medium.com/media/411e47bfa84aa1b2b477a9fa101eb884/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e83b8ec86e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>