Logo Alexandre Neto
  • Home
  • About
  • Services
  • Recent Posts
  • Posts
  • Plugins
  • English
    Português English
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Posts
  • Opinion articles
    • Giovanni had an itch...
    • Welcome note
    • Open Source, why?
  • Plugins
    • Multipart Split
    • Walking time
  • News
  • Tutorials
Hero Image
Create a PyQGIS Development Environment Using Conda and VScode

As a self-taught PyQGIS developer, one of my main hurdles has always been to prepare the development environment for PyQGIS. An environment that allow me to run PyQGIS scripts, helps me code faster by providing PyQGIS highlighting and autocompletion, enables me to debug my plugins and scripts as they run, etc… I have been a user (and even a… “cof cof”… maintainer) of the QGIS packages for conda provided by the conda-forge community. In Linux, it has allowed me to easily install the LTR version of QGIS (or any other version) alongside the most recent QGIS version provided by qgis.org apt repositories. I ended up finding that this was quite convenient for development too.

  • pyqgis
  • QGIS
  • conda
  • vscode
Saturday, May 11, 2024 | 6 minutes Read
Hero Image
Configure editing form widgets using PyQGIS

As I was preparing a QGIS Project to read a database structured according to the new rules and technical specifications for the Portuguese Cartography, I started to configure the editing forms for several layers, so that: Make some fields read-only, like for example an identifier field. Configure widgets better suited for each field, to help the user and avoid errors. For example, date-time files with a pop-up calendar, and value lists with dropdown selectors. Basically, I wanted something like this:

  • pyqgis
  • QGIS
  • Recart
Monday, September 30, 2019 | 4 minutes Read
Hero Image
Using QGIS from conda-forge

QGIS recipes have been available on Conda-forge for a while, but now, that they work for the three main operating systems, installing QGIS from Conda is s starting to become a very reliable alternative to other QGIS distributions. Anyway, let’s rewind a bit… What is Conda? Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and all their dependencies. Conda easily creates, saves, loads and switches between environments on your local computer. It was created for Python packages, but it can package and distribute software for any language. What is Conda-forge?

  • conda
  • QGIS
  • conda-forge
  • mamba
Wednesday, May 29, 2019 | 6 minutes Read
Hero Image
Getting multipolygon vertexes using PostGIS

Today I needed to create a view in PostGIS that returned the vertexes of a multi-polygon layer. Besides, I needed that they were numerically ordered starting in 1, and with the respective XY coordinates. It seemed to be a trivial task – all I would need was to use the ST_DumpPoints() function to get all vertexes – if it wasn’t for the fact that PostGIS polygons have a duplicate vertex (the last vertex must be equal to the first one) that I have no interess in showing.

  • Postgis
Friday, November 6, 2015 | 2 minutes Read
Hero Image
Hack to adjust map symbols location in QGIS

Now and then I get too many map symbols (points) in the same place, and I thought how nice it would be if we could drag n’ drop them around without messing with their geometries position, just like we do with labels. That thought gave me an idea for a cool hack. Choose your point layer and start by creating two new fields called symbX and symbY (Type: Decimal number; Size: 20; Precision: 5). Now go the layer properties and in the Style tab edit your symbol. For each level of your symbol select “map units” as the offset units, and set the following expression in the offset data define properties option:

  • Cartography
  • Hint
  • QGIS
Monday, February 23, 2015 | 2 minutes Read
Hero Image
Calculate polygon centroid's coordinates

I had the need to add columns with the coordinates of polygons centroids. I came up with the following expressions to calculate X e Y, respectively: [code] xmin(centroid($geometry)) ymin(centroid($geometry)) [/code] The expression seems quite simple, but it toke me some time before I realize that, not having a x(geometry) and y(geometry) functions, I could use the xmin() and ymin() to get the coordinates of the polygons centroids. Since this wasn’t the first time I had to use this expressions, this post will work as a reminder for the future.

  • Hint
  • QGIS
Tuesday, February 10, 2015 | 1 minute Read
Hero Image
Labels leading lines with QGIS and Postgis

Recently I had the need to add labels to features with very close geometries, resulting in their collision. Using data-defined override for label’s position (I have used layer to labeled layer plugin to set this really fast) and the QGIS tool to move labels, it was quite easy to relocate them to better places. However, in same cases, it was difficult to understand to which geometry they belonged.

  • Cartography
  • Hint
  • Postgis
  • QGIS
Monday, January 12, 2015 | 2 minutes Read
Hero Image
Multiple format map series using QGIS 2.6 – Part 2

In my last post, I have tried to show how I used QGIS 2.6 to create a map series where the page’s orientation adapted to the shape of the atlas features. This method is useful when the final scale of the maps is irrelevant, or when the size of the atlas elements is similar, allowing one to use a fixed scale. On the other hand, when using a fixed scale is mandatory and the features size are too different, it is needed to change the size of the paper. In this second part ot the post, I will try to show how I came to a solution for that.

  • atlas
  • Map composer
  • QGIS
Tuesday, November 18, 2014 | 4 minutes Read
Hero Image
Multiple format map series using QGIS 2.6 - Part 1

As always, the new QGIS version (QGIS 2.6 Brigthon) brings a vast new set of features that will allow the user to do more, better and faster than with the earlier version. One of this features is the ability to control some of the composer’s items properties with data (for instance, size and position). Something that will allow lots of new interesting usages. In the next posts, I propose to show how to create map series with multiple formats.

  • atlas
  • Cartography
  • Composer
  • QGIS
Sunday, November 9, 2014 | 3 minutes Read
Hero Image
Map corner coordinates in QGIS

Some time ago in the qgis-pt mailing list, someone asked how to show the coordinates of a map corners using QGIS. Since this features wasn’t available (yet), I have tried to reach a automatic solution, but without success, After some thought about it and after reading a blog post by Nathan Woodrow, it came to me that the solution could be creating a user defined function for the expression builder to be used in labels in the map.

  • Cartography
  • python
  • QGIS
  • tutorial
Tuesday, September 9, 2014 | 5 minutes Read
Hero Image
Please use the "IN" operador

It’s not the first time I see people that, to select feature by their fields values, use expressions like this: [code language=“SQL”]“field” = ‘value1’ OR “field” = ‘value2’ OR “field” = ‘value3’ [OR …][/code] A more practical and pretty way of doing this is by using the IN operator instead. [code language=“SQL”]“field” IN (‘value1’,‘value2’,‘value3’[,…])[/code] This operator is available in almost every GIS software I know. In QGIS, it can be used even if there isn’t a small little button to click.

  • QGIS
  • SQL
Tuesday, June 24, 2014 | 1 minute Read
Hero Image
Old map in QGIS

Inspired in a post by Anita Graser, I’ve tried to use QGIS to create a Cascais’s old looking map, as if it have been drawn by hand in a methodical way. Defining the styles I have started by defining the styles for each elements to represent. Buildings To fill the buildings, I have tried to use a color that reminds me the portuguese roofs, similar to the color commonly used in old maps of cities, with a slightly darker outline of the same color.

  • QGIS
Monday, April 14, 2014 | 2 minutes Read
  • ««
  • «
  • 1
  • 2
  • »
  • »»
Navigation
  • About
  • Services
  • Recent Posts
  • Plugins
Contact me:
  • srnetochan
  • Alexandre Neto
  • @alexnetogeo
  • @alexnetogeo

Toha Theme Logo Toha
© 2022 Copyright. Globe icon created by Freepik - Flaticon
Powered by Hugo Logo