Andrea Aime | 1 Jun 10:23 2012
Picon

Re: need write many rules because of scaleDenominator in sld



On Fri, Jun 1, 2012 at 9:36 AM, vrbikdan <vrbikdan <at> gmail.com> wrote:
Hi all,
I have small question about writing sld. I need to implement
MaxScaleDenominator but only for changing of font-size. But I have to write
long rule for styling my labels. So if I want to use scaleDenominator I have
to write this rule whole again and again and again and again... only with
one change, change of font-size. 

Use uom and live happily with just one rule:


Cheers
Andrea
 
--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
Geoserver-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
vrbikdan | 1 Jun 10:57 2012
Picon

Re: need write many rules because of scaleDenominator in sld

Thanks for suggestion, but for labels it does not exactly what I need but it
is good to know for sizing other stuffs.

Let suppose, that I need to change another thing as color, font-family or if
I will use some filter for making choropleth map where only thing I need to
change is fill color. But always only one or two things in rule. Is it some
easy way to do this?

Sorry for my questions, I'm trying to make my work easier :)
Dan

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/need-write-many-rules-because-of-scaleDenominator-in-sld-tp4978460p4978483.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Andrea Aime | 1 Jun 11:22 2012
Picon

Re: need write many rules because of scaleDenominator in sld

On Fri, Jun 1, 2012 at 10:57 AM, vrbikdan <vrbikdan <at> gmail.com> wrote:
Thanks for suggestion, but for labels it does not exactly what I need but it
is good to know for sizing other stuffs.

Let suppose, that I need to change another thing as color, font-family or if
I will use some filter for making choropleth map where only thing I need to
change is fill color. But always only one or two things in rule. Is it some
easy way to do this?

Not in SLD. You may want to have a look at the CSS module instead, it
uses the cascading concept to avoid repeating everything for the various
rules

Cheers
Andrea
 

--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
Geoserver-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Martin Davis | 1 Jun 18:08 2012

Re: need write many rules because of scaleDenominator in sld

If the styling parameters are controlled by feature attributes, that you might be able to use Filter expressions in the parameters to compute the value dynamically.


GeoServer supports the OGC SE Recode function now, which might make this easier.

It would be interesting to hear back if this works for you.


On Fri, Jun 1, 2012 at 1:57 AM, vrbikdan <vrbikdan <at> gmail.com> wrote:
Thanks for suggestion, but for labels it does not exactly what I need but it
is good to know for sizing other stuffs.

Let suppose, that I need to change another thing as color, font-family or if
I will use some filter for making choropleth map where only thing I need to
change is fill color. But always only one or two things in rule. Is it some
easy way to do this?

Sorry for my questions, I'm trying to make my work easier :)
Dan

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/need-write-many-rules-because-of-scaleDenominator-in-sld-tp4978460p4978483.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
Geoserver-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users



--
Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
Geoserver-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Andrea Aime | 2 Jun 10:10 2012
Picon

Re: need write many rules because of scaleDenominator in sld

On Fri, Jun 1, 2012 at 6:08 PM, Martin Davis <mdavis <at> opengeo.org> wrote:
If the styling parameters are controlled by feature attributes, that you might be able to use Filter expressions in the parameters to compute the value dynamically.

GeoServer supports the OGC SE Recode function now, which might make this easier.

The above all help in case the rule work on the feature attributes, but the case here is working
against the scale denominator instead.

Now, it would be possible to use them in case the scale denominator is exposed as a enviroment
variable (env function), which is not available right now. GetMap.java has the following:

        EnvFunction.setLocalValue("wms_bbox", mapContent.getRenderingArea());
        EnvFunction.setLocalValue("wms_crs", mapContent.getRenderingArea().getCoordinateReferenceSystem());
        EnvFunction.setLocalValue("wms_srs", mapContent.getRequest().getSRS());
        EnvFunction.setLocalValue("wms_width", mapContent.getMapWidth());
        EnvFunction.setLocalValue("wms_height", mapContent.getMapHeight());

If we added the scale denominator it would also be possible to use "categorize" to
apply different values based on the current scale (categorize works against ranges,
recode is a point to point map instead).

Since it takes more time to write this mail than to add that line of code, I just did:

GeoServer 2.2-beta3 will have the scale denominator available as an env variable
under the wms_scale_denominator name.

Cheers
Andrea
 

--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
Geoserver-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Martin Davis | 3 Jun 05:19 2012

Re: need write many rules because of scaleDenominator in sld

Nice!  I'll add it to the doc (and maybe even provide an example at some point)


On Sat, Jun 2, 2012 at 1:10 AM, Andrea Aime <andrea.aime <at> geo-solutions.it> wrote:
On Fri, Jun 1, 2012 at 6:08 PM, Martin Davis <mdavis <at> opengeo.org> wrote:
If the styling parameters are controlled by feature attributes, that you might be able to use Filter expressions in the parameters to compute the value dynamically.

GeoServer supports the OGC SE Recode function now, which might make this easier.

The above all help in case the rule work on the feature attributes, but the case here is working
against the scale denominator instead.

Now, it would be possible to use them in case the scale denominator is exposed as a enviroment
variable (env function), which is not available right now. GetMap.java has the following:

        EnvFunction.setLocalValue("wms_bbox", mapContent.getRenderingArea());
        EnvFunction.setLocalValue("wms_crs", mapContent.getRenderingArea().getCoordinateReferenceSystem());
        EnvFunction.setLocalValue("wms_srs", mapContent.getRequest().getSRS());
        EnvFunction.setLocalValue("wms_width", mapContent.getMapWidth());
        EnvFunction.setLocalValue("wms_height", mapContent.getMapHeight());

If we added the scale denominator it would also be possible to use "categorize" to
apply different values based on the current scale (categorize works against ranges,
recode is a point to point map instead).

Since it takes more time to write this mail than to add that line of code, I just did:

GeoServer 2.2-beta3 will have the scale denominator available as an env variable
under the wms_scale_denominator name.

Cheers
Andrea
 



--
Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
Geoserver-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Gmane