Robin's Blog

Archive for the ‘Programming’ Category

How to speed up appending to PostGIS tables with ogr2ogr

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 […]

How to get segment-geospatial working on Microsoft Planetary Computer

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 […]

Upcoming talks: Cafe Sci Oxford & PyData Southampton

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 – […]

Travel times, over time

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 […]

Pint + SQLAlchemy = Unit consistency and enforcement in your database

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 […]