Summary: If appending to a PostGIS table with GDAL/OGR is taking a long time, try setting the PG_USE_COPY config option to YES (eg. adding –config PG_USE_COPY YES to your command line). This should speed it up, but beware that if there are concurrent writes to your table at the same time as OGR is accessing […]
I use GeoPandas for a lot of my vector GIS data manipulation in Python. I had a situation the other day where I ended up with duplicates of some geometries in my GeoDataFrame, and I wanted to remove them. The simple way to do this is to use the underlying pandas method drop_duplicates on the […]
Note: This blog post has been updated with a new command for creating an osx-64 environment, after I was contacted by someone from Anaconda telling me a newer, easier way to do this I came across some conda packages that didn’t work properly on my M1 Mac (Apple Silicon – ARM processor) the other day. […]
Just a quick one today to document the solution to a problem I ran into earlier today. I was using Microsoft Planetary Computer to access some Landsat satellite data, and I wanted to run it through the Segment Anything model from Meta, to segment out agricultural fields from the image. I tried to do this […]
I’m giving two talks in the next two weeks, and wanted to publicise them here in case anyone local-ish wants to come. Oxford Cafe Scientifique I’ve spoken at various Cafe Scientifique meet-ups before, and now it’s the turn of the Oxford one. I’ll be giving my talk about the whole range of satellite imaging – […]
In the spirit of my Previously Unpublicised Code series, today I’m going to share Pandas-FSDR. This is a simple library with one function which finds significant differences between two columns in a pandas DataFrame. For example, imagine you had the following data frame: Subject UK World Biology 50 40 Geography 75 80 Computing 100 50 […]
Just a quick one this time… GeoParquet is a cool new-ish format for geospatial data. I’ve tried to use it a couple of times, but always run into issues with my GDAL/OGR install not supporting it. Each time this has led to me giving up, as I couldn’t be bothered to install GDAL from somewhere […]
A fun analysis I did a while back was using the Google Maps API to look at travel times between certain locations over time. I originally got interested in this because I found that travelling from my house to the university (yes, that’s how long ago this started…) seemed to either take a very short […]
Last week I released version 1.9.0 of Py6S – my Python interface to the 6S radiative transfer model. It’s been the first non-bugfix release for quite a while (mainly because I’ve been busy with paid work), and so I just wanted to highlight a few aspects of the release. The full release notes are available […]
Last week I presented a poster at PyData Global 2020, about linking the pint and SQLAlchemy libraries together to provide robust handling of units with databases in Python. The poster is shown below: click to enlarge so you can read the text: The example code is available on Github and is well-commented to make it […]