Tag Archives: python

Geo Django Raster Metadata

I’ve been using GeoDjango for some time now, and found myself in a situation where I wanted to retrieve raster metadata using the ST_MetaData function on some datasets stored in PostGIS.

To do so, you can of course use the raw function from the db Manager, but for this I went the extra mile (although, it’s more like the extra half-mile, since it’s very easy)

the ST_Metadata in GeoDjango

Advertisements

Leave a comment

Filed under curious, tips, code

Color2Attribute for Qgis3.x

Well, it didn’t take that much. I ported the small Qgis plugin to Qgis version 3.x. Luckily the renderer classes did not change, so the biggest thing to do was reorganize the code for PyQt5 and all the Qgis2 to Qgis3 API breaking changes. Just one coffee and a morning was enough :-).

It should be available from the qgis repository itself.

Related

Original Post
2.X update
Plugin at the Qgis plugin website
Plugin source

Leave a comment

Filed under code, gis

Memcached and Django

Here a quickie, since I’ve been silent for so long.

I find myself with a REST service taking way too long to process one of its queries, it’s not bad per se, but it will get bad when this query gets hit more often.

Memcached to the rescue.

more

Leave a comment

Filed under code, tools

Tenma72-2540 Linux serial control

I daily work with a DC power supply to run different boards and prototypes. One day, plugging in the power supply I realized there was a USB and a COM port!
It is not correct from a tinkerer’s to avoid this option. So this day ended up with a small Python program (also golang, but that’s a different story) to use this feature.

more

4 Comments

Filed under code, tools

XLS to CSV

A common situation for us (people in the programming/computing/processing world) is that we don’t always work with the same tools as some of our non-tech peers.

Case in point, I received a big bunch of files in XLS/XLSX format, very big files, LibreOffice has trouble working with them. Since I want to perform quick processing on that data, and I already have scripts that process similar data in CSV, the simplest path is to transform those files to plain, ugly, useful CSV files.

Then again, there are 100 files, and I don’t feel like dancing around each one: opening, clicking save as, selecting CSV, telling LibreOffice that this is a semicolon separated CSV file … etc etc.

Entering pandas.

continue please

1 Comment

Filed under code, tips, tools, Uncategorized

Europe DbPedia 2017

europeflagdbpedia
I was kind of bored while doing some work, and just past week we were discussing with a colleague about my vague-places project.

This project was forgotten in time, but today I’ve blown the dust away, recovered it, and updated the Europe DbPedia map.

Image overview

Most of you won’t be interested in the full story. So here, see a set of results. If something picks your interest (like, why Portugal has almost no points) just keep reading 😀

Keep Reading

1 Comment

Filed under curious, gis, Maps