[QGIS-Developer] newbie questions re: exe or dll to batch-process shapefiles

Jorge Gustavo Rocha jgr at di.uminho.pt
Thu Dec 28 09:53:53 PST 2017


Hi Willson,

1. Following the "Keep it Simple" principle, I would recommend just a
script based on OGR. QGIS will not add any value to this simple
transformation.

2. Check every geometry to make sure it is valid.

3. If you have large amounts of data, you might consider Postgresql with
PostGIS. Databases are better than the file system to store and process
data.

Just one opinion.

Regards,

Jorge Gustavo

On 28-12-2017 17:34, Willson de Veas wrote:
> Hi, I'm a newbie to QGIS, with several years of experience with other
> GIS software, particularly ESRI MapObjects and Atlas GIS.
> 
> I've also been a software developer (mainly Windows desktop
> applications) for many years. I'm concurrently learning Python in order
> to interact with the QGIS API.
> 
> My latest direction from my employer is to create software that
> batch-processes spatial data (for now, ESRI shapefiles)
> non-interactively, with "Python and QGIS".
> 
> (I don't actually know yet whether I should be looking at QGIS's API for
> purely non-interactive processing, or at GDAL/OGR, as suggested by
> someone on Twitter.)
> 
> I'd like to ask some questions in order to guide my learning. I ask for
> your pardon in advance as some of my terminology may still be ESRI-centric.
> 
> I have been tasked with creating a routine that does the following:
> 
>     1) reads in as parameters (i) the filename of one shapefile,
> representing an overlay layer; (ii) one or more filenames of shapefiles,
> representing target layers; and (iii) an output folder name;
>     2) loads the overlay and target layers, reprojecting each as
> necessary into a common projection (we're expecting to convert Albers
> projection-NAD1983 to Transverse_Mercator-NAD_1927_UTM_Zone_10N);
>     3) for each target layer, find all features that touch any feature
> in the overlay layer, and export all of these to a new shapefile in the
> output folder.
>     4) This would be called by another Windows desktop application.
> 
> The ideal solution that my employer and I are seeking would be a Windows
> executable or DLL, with minimal additional installation overhead. I am
> aware of py2exe and cx_Freeze, and I've seen the "Python on Windows FAQ".
> 
> Is this a feasible project? Is it a wise project?
> 
> Does accessing the QGIS API launch a separate window / do I have to
> launch a new and visible process in order to access QGIS via API calls?
> 
> Should I be looking at GDAL/OGR for non-interactive background work instead?
> 
> What other considerations should I be aware of?
> 
> Thanks for your time and attention.
> 
> Regards,
> Willson de Veas
> 
> 
> _______________________________________________
> 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
> 

J. Gustavo
-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor


More information about the QGIS-Developer mailing list