Discussion:
[Qgis-user] Atlas generation - Rule based renderer on two different layers??
Pietro Rossin
2014-03-28 07:55:34 UTC
Permalink
Hello people
I'm using the atlas generator and I'm able to use a rule based renderer on
the Atlas feature showed by the filter: $id = $atlasfeatureid

I'm wondering if it is possible to render the symbology of a second layer
using a distance criterion

I know postgis can query a feature layer by distance with a second layer
with st_dwithin(g1,g2,d).

Is it possible to make something similar on the fly using the $geometry of
the second layer and $atlasgeometry as the selector by distance of the
feature to be rendered?

bie
pietro





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
Alexandre Neto
2014-03-28 08:04:18 UTC
Permalink
Yes you can. check the end of this post.

http://nathanw.net/2013/12/02/waiting-for-qgis-22-highlighting-current-atlas-feature/

Alexandre Neto
Post by Pietro Rossin
Hello people
I'm using the atlas generator and I'm able to use a rule based renderer on
the Atlas feature showed by the filter: $id = $atlasfeatureid
I'm wondering if it is possible to render the symbology of a second layer
using a distance criterion
I know postgis can query a feature layer by distance with a second layer
with st_dwithin(g1,g2,d).
Is it possible to make something similar on the fly using the $geometry of
the second layer and $atlasgeometry as the selector by distance of the
feature to be rendered?
bie
pietro
--
http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140328/9fe6dc59/attachment.html>
Pietro Rossin
2014-03-28 09:03:10 UTC
Permalink
Thank you Alexandre
Yess!!!
I get rid of the problem just after this posting.. And indeed the solution
was as written on the end of Nathan post..

Now i was playing with label rules but without success...
I have two polygon layers, each feature of the first one can perfectly
contain one or more features of the second (this last is the layer for the
atlas generation), but sometimes the atlas feature can slightly exceed the
containing polygon of the first layer

I want the label to appear for the first layer only for the feature that
contains the atlas feature and not for the surrounding ones...

So I wrote this statement:
CASE WHEN contains($geometry , centroid($atlasgeometry)) THEN my label END

But it doesn't work...





2014-03-28 9:06 GMT+01:00 Alexandre Neto [via OSGeo.org] <
Post by Alexandre Neto
Yes you can. check the end of this post.
http://nathanw.net/2013/12/02/waiting-for-qgis-22-highlighting-current-atlas-feature/
Alexandre Neto
Em 28/03/2014 07:56, "Pietro Rossin" <[hidden email]<http://user/SendEmail.jtp?type=node&node=5131715&i=0>>
Post by Pietro Rossin
Hello people
I'm using the atlas generator and I'm able to use a rule based renderer on
the Atlas feature showed by the filter: $id = $atlasfeatureid
I'm wondering if it is possible to render the symbology of a second layer
using a distance criterion
I know postgis can query a feature layer by distance with a second layer
with st_dwithin(g1,g2,d).
Is it possible to make something similar on the fly using the $geometry of
the second layer and $atlasgeometry as the selector by distance of the
feature to be rendered?
bie
pietro
--
http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=5131715&i=1>
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=5131715&i=2>
http://lists.osgeo.org/mailman/listinfo/qgis-user
------------------------------
If you reply to this email, your message will be added to the discussion
http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712p5131715.html
To unsubscribe from Atlas generation - Rule based renderer on two
different layers??, click here<http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5131712&code=cGllcmlnaXNAZ21haWwuY29tfDUxMzE3MTJ8MjMwODY1MTQ5>
.
NAML<http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712p5131732.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140328/9a4380a1/attachment.html>
Pietro Rossin
2014-03-28 13:03:15 UTC
Permalink
Hello
If I try to apply a ruled style with this statements I cannot achieve
expected result
IE apply a style to feature layer if the centroid of the atlas feature is
in the feature to be styled

intersects(centroid($atlasgeometry), $geometry )
within(centroid($atlasgeometry), $geometry )
contains($geometry,centroid($atlasgeometry) )

Where is my mistake?
bie
Post by Pietro Rossin
Thank you Alexandre
Yess!!!
I get rid of the problem just after this posting.. And indeed the solution
was as written on the end of Nathan post..
Now i was playing with label rules but without success...
I have two polygon layers, each feature of the first one can perfectly
contain one or more features of the second (this last is the layer for the
atlas generation), but sometimes the atlas feature can slightly exceed the
containing polygon of the first layer
I want the label to appear for the first layer only for the feature that
contains the atlas feature and not for the surrounding ones...
CASE WHEN contains($geometry , centroid($atlasgeometry)) THEN my label END
But it doesn't work...
2014-03-28 9:06 GMT+01:00 Alexandre Neto [via OSGeo.org] <[hidden email]<http://user/SendEmail.jtp?type=node&node=5131732&i=0>
Post by Alexandre Neto
Yes you can. check the end of this post.
http://nathanw.net/2013/12/02/waiting-for-qgis-22-highlighting-current-atlas-feature/
Alexandre Neto
Em 28/03/2014 07:56, "Pietro Rossin" <[hidden email]<http://user/SendEmail.jtp?type=node&node=5131715&i=0>>
Post by Pietro Rossin
Hello people
I'm using the atlas generator and I'm able to use a rule based renderer on
the Atlas feature showed by the filter: $id = $atlasfeatureid
I'm wondering if it is possible to render the symbology of a second layer
using a distance criterion
I know postgis can query a feature layer by distance with a second layer
with st_dwithin(g1,g2,d).
Is it possible to make something similar on the fly using the $geometry of
the second layer and $atlasgeometry as the selector by distance of the
feature to be rendered?
bie
pietro
--
http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=5131715&i=1>
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=5131715&i=2>
http://lists.osgeo.org/mailman/listinfo/qgis-user
------------------------------
If you reply to this email, your message will be added to the
http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712p5131715.html
To unsubscribe from Atlas generation - Rule based renderer on two
different layers??, click here.
NAML<http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
------------------------------
View this message in context: Re: Atlas generation - Rule based renderer
on two different layers??<http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712p5131732.html>
Sent from the Quantum GIS - User mailing list archive<http://osgeo-org.1560.x6.nabble.com/Quantum-GIS-User-f4125267.html>at Nabble.com.
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140328/39ac8907/attachment-0001.html>
Pietro Rossin
2014-03-31 10:05:19 UTC
Permalink
The statement for the label:
CASE WHEN contains($geometry , centroid($atlasgeometry)) THEN my label END

WORKS!
But the two layers must be in the same reference system...
Thanks!
Post by Pietro Rossin
Hello
If I try to apply a ruled style with this statements I cannot achieve
expected result
IE apply a style to feature layer if the centroid of the atlas feature is
in the feature to be styled
intersects(centroid($atlasgeometry), $geometry )
within(centroid($atlasgeometry), $geometry )
contains($geometry,centroid($atlasgeometry) )
Where is my mistake?
bie
Post by Pietro Rossin
Thank you Alexandre
Yess!!!
I get rid of the problem just after this posting.. And indeed the
solution was as written on the end of Nathan post..
Now i was playing with label rules but without success...
I have two polygon layers, each feature of the first one can perfectly
contain one or more features of the second (this last is the layer for the
atlas generation), but sometimes the atlas feature can slightly exceed the
containing polygon of the first layer
I want the label to appear for the first layer only for the feature that
contains the atlas feature and not for the surrounding ones...
CASE WHEN contains($geometry , centroid($atlasgeometry)) THEN my label END
But it doesn't work...
2014-03-28 9:06 GMT+01:00 Alexandre Neto [via OSGeo.org] <[hidden email]<http://user/SendEmail.jtp?type=node&node=5131732&i=0>
Yes you can. check the end of this post.
Post by Alexandre Neto
http://nathanw.net/2013/12/02/waiting-for-qgis-22-highlighting-current-atlas-feature/
Alexandre Neto
Em 28/03/2014 07:56, "Pietro Rossin" <[hidden email]<http://user/SendEmail.jtp?type=node&node=5131715&i=0>>
Post by Pietro Rossin
Hello people
I'm using the atlas generator and I'm able to use a rule based renderer on
the Atlas feature showed by the filter: $id = $atlasfeatureid
I'm wondering if it is possible to render the symbology of a second layer
using a distance criterion
I know postgis can query a feature layer by distance with a second layer
with st_dwithin(g1,g2,d).
Is it possible to make something similar on the fly using the $geometry of
the second layer and $atlasgeometry as the selector by distance of the
feature to be rendered?
bie
pietro
--
http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
_______________________________________________
Qgis-user mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=5131715&i=1>
http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
[hidden email] <http://user/SendEmail.jtp?type=node&node=5131715&i=2>
http://lists.osgeo.org/mailman/listinfo/qgis-user
------------------------------
If you reply to this email, your message will be added to the
http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712p5131715.html
To unsubscribe from Atlas generation - Rule based renderer on two
different layers??, click here.
NAML<http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
------------------------------
View this message in context: Re: Atlas generation - Rule based renderer
on two different layers??<http://osgeo-org.1560.x6.nabble.com/Atlas-generation-Rule-based-renderer-on-two-different-layers-tp5131712p5131732.html>
Sent from the Quantum GIS - User mailing list archive<http://osgeo-org.1560.x6.nabble.com/Quantum-GIS-User-f4125267.html>at Nabble.com.
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140331/e84727b2/attachment.html>
Loading...