[QGIS-Developer] Factorizing a dbf

Luiz Motta motta.luiz at gmail.com
Mon Jan 22 04:18:37 PST 2018


Hi Paolo,

A possible insight can be this:
- Create a table with two columns:  'string from SHP' and 'respective
number code'.
- In SHP create the Union with the table above.
- Use Calculator for populate the new field in SHP with value of code.

Good lucky.


2018-01-22 9:18 GMT-02:00 Paolo Cavallini <cavallini at faunalia.it>:

> Hi all,
> I have a large shp with a number of repeated strings, and I'd like to
> refactor it replacing strings with a numeric code. I have found a
> Processing alg that does it, creating a new file each time, which is
> cumbersome; moreover, the alg apparently changes field type, adding
> decimals to reals. Of course I could create a CASE statement, but this
> is also cumbersome.
> Is there a more straightforward way?
> Thanks.
> --
> Paolo Cavallini - www.faunalia.eu
> QGIS & PostGIS courses: http://www.faunalia.eu/training.html
> https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180122/0f5f2c06/attachment.html>


More information about the QGIS-Developer mailing list