I am trying to create a text report listed by area (taken from a polygon layer) that details any features from other layers (points, lines and polygons) that fall within the listed area. I have QGIS and FME but I cannot find anything that creates what I need. Do any of you have any experience of creating this type of output please?


What you describe is imho called a "query" (SQL Query) : you're able to query any of your currently opened tables using (for example) the DB Manager.

You choose Database/Database Manager/Database Manager then Virtual Layers/Qgis Layers you can then try queries like the following :

select info_a,info_b, info_c from point_layer, area_layer
where st_intersects(area.geometry, point.geometry)

In a query you'll be able to use any spatial operator (the one used here is "intersection" ...)

This query is just an example (not based on any of your data structure) using two layers of a qgis project


In FME there are two different aspects to this: assessing the data and creating the report.

To assess the data, you'd use a transformer like SpatialRelator or SpatialFilter. Here I am testing park features against a set of other data, to see which intersect, overlap, fall inside, etc:

enter image description here

The key is to create a list of which features are spatially related (with whatever predicates you chose to test) because they will form the basis of your report.

So, the report can take many forms. The simplest is to explode the List you created (ListExploder transformer), format the content (AttributeManager probably) and just pipe the data into a Textfile writer. The CSV format writer is another good choice.

However, you could go further and use the HTMLReportGenerator transformer and HTML writer to generate a report that is more elegant than just plain text.

This should get you started. Basically you have a case whose solution ranges from the very simple to the very complex, depending on how you need to assess the data and how you want to style your output.

For further information check out the Common GIS Operations tutorial on the FME Knowledgebase (for info on assessing spatial relationships). For the report the Textfile writer is fairly self-explanatory, but for HTML reports there are a couple of blog posts (here and here) and this project on Github is a good example that generates such a report.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.