Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlas current feature filter #17472

Closed
qgib opened this issue Oct 3, 2013 · 23 comments
Closed

Atlas current feature filter #17472

qgib opened this issue Oct 3, 2013 · 23 comments
Labels
Feature Request Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

Comments

@qgib
Copy link
Contributor

qgib commented Oct 3, 2013

Author Name: David McDermott (David McDermott)
Original Redmine Issue: 8766

Redmine category:map_composer/printing


Good morning to the QGIS community,

First off, thank you for QGIS 2.0.1, its a great piece of software and the GUI is fantastic. I have been looking forward to the atlas integration for a long time but I don't think it's quite there yet. When I print map books, I often have features close together. What I would like Atlas to do is apply a filter so that only the current feature is visible (or all features expect the current is visible). What I envisage is a feature similar to ESRIs data driven pages, page definition queries (http://tinyurl.com/p5ptq28).

I posted this request in the User Forum (http://tinyurl.com/puvazlh) but Vincent Picavet suggested I post it here. I'm not sure if this is already possible. I have tried several iteration in the feature filter dialog such as $feature=$feature or $rownum=$rownum with no success. The expression $feature=$currentfeature (if there was a $currentfeature) might work. On a layer by layer basis, a tick box in the layer filter option called "atlas filtering" might also be an option.

Thanks,

David


@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2013

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was configured as Future Release - Nice to have
  • category_id was configured as Map Composer/Printing

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Anónimo (Anónimo)


Fixed in changeset "bff6fe5913f2666b5d90cea47ae062b429604a22".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Nathan Woodrow (@NathanW2)


Now that we have $currentfeature we can match that in a rule to highlight the active Atlas feature.

image

Result:

image


  • 6446 was configured as output_1.jpg
  • resolution was changed from to fixed/implemented

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Regis Haubourg (@haubourg)


Hi, I was about to ask the same feature! So great.. The idea was to be able to filter labeling only in currentfeature with a intersect clause.
Having another feature simplified on the current scale (with new simplification improvement by A.Huarte and V.Mora) would avoid performances issues with big polygons.. My two cents.
Régis

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Nathan Woodrow (@NathanW2)


Regis,

You could do this in using a CASE in a label expression (for now)

@case
WHEN $id = $currentfeature THEN "yourlabel"
END@

image

You could even use a case statement in the transparency property to get something like this.

@case
WHEN $id != $currentfeature THEN 50
END@

image

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Mathieu Pellerin - nIRV (Mathieu Pellerin - nIRV)


kudos Nathan, that's very useful

@qgib
Copy link
Contributor Author

qgib commented Nov 7, 2013

Author Name: Regis Haubourg (@haubourg)


Nathan Woodrow wrote:

Regis,

You could do this in using a CASE in a label expression (for now)

@case
WHEN $id = $currentfeature THEN "yourlabel"
END@

Hi Nathan,
that works only for Atlas coverage layer right ?

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: David McDermott (David McDermott)


Thank you Nathan, this is perfect. How do I go about implementing this fix? I downloaded and installed the most recent (10/11/13) version of QGIS but there is no $Currentfeature function.

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: Nathan Woodrow (@NathanW2)


Have you enabled Atlas in the composer. It will only be active then.

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: David McDermott (David McDermott)


Atlas composer is active, and I have the $feature function. I took your idea and put ($feature + 1) = $id in the style expression and it works. I have added a few photos.


  • 6454 was configured as atlas_on.png
  • 6453 was configured as atlas_exp.png

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: Nathan Woodrow (@NathanW2)


I wouldn't use $feature + 1 because $feature is just a count and $id is not ordered or can having missing numbers so this expression will fail.

Can you QGIS Code revision you have in your About dialog.

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: David McDermott (David McDermott)


My $feature+1 $id was just a temporary workaround that worked on this dataset. The code version is ebebdf3. Here is a screen shot


  • 6455 was configured as qgis_version.png

@qgib
Copy link
Contributor Author

qgib commented Nov 11, 2013

Author Name: Nathan Woodrow (@NathanW2)


Oh your still running 2.0. You will have to grab a nightly build if you want this feature. You can get the nighly dev version using the OSGeo4W installers at http://qgis.org/en/site/forusers/download.html

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Regis Haubourg (@haubourg)


Hi Nathan,
I can't see $currentfeature variable in latest revision on OSGEO4W (5f5cd4c) , with Atlas enabled..
Any idea? OSGEO4W is late?

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Nathan Woodrow (@NathanW2)


Very old. Are you using the OSGeo4W of the qgis site?

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Regis Haubourg (@haubourg)


Yep, updated osgeo4w 64 bit today. Will check 32 bit now...

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Regis Haubourg (@haubourg)


Hum, in fact 32 bit package is realy old, 64 bit is up to 2.1.0-60

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Jürgen Fischer (@jef-n)


regis Haubourg wrote:

Hum, in fact 32 bit package is realy old, 64 bit is up to 2.1.0-60

What do you mean? The packages both are from today.

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Regis Haubourg (@haubourg)


In my 32 bit osgeo4w installer, I get 2.1.0-55 where I get -60 in 64 bits version.

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Jürgen Fischer (@jef-n)


regis Haubourg wrote:

In my 32 bit osgeo4w installer, I get 2.1.0-55 where I get -60 in 64 bits version.

Right, but that doesn't mean they contain different QGIS versions. Just that the 32bit version wasn't built successfully as many many times as the 64bit version.

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Regis Haubourg (@haubourg)


Ok, didn't know that. Anyway, it seems nathan's code is not functionnal in 32 bit package. Maybe other reasons explain that.

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Nathan Woodrow (@NathanW2)


Can you paste a image of your about QGIS dialog.

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2013

Author Name: Regis Haubourg (@haubourg)


here is what I see:

Version de QGIS 2.0.1-Dufour Révision du code ebebdf3
Compilé avec Qt 4.7.1 Utilisant Qt 4.7.1
Compilé avec GDAL/OGR 1.10.1 Utilisé avec GDAL/OGR 1.10.1
Compiled against GEOS 3.3.8-CAPI-1.7.8 Running against GEOS 3.4.2-CAPI-1.8.2 r3921
Version du client PostgreSQL 8.3.10 Version de SpatiaLite 4.1.1
Version de QWT 5.2.1 Version de PROJ.4 : 480
Version de QScintilla2 2.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

No branches or pull requests

1 participant