On Mon, Dec 31, 2012 at 6:39 PM, Ákos Maróy <[email protected]> wrote:

>
> > to specify a size in millimeters on the target device? The "x-units"
> > is intended to mark the "extension".
> but, isn't the existing uom feature already an extension to SLD?
>

It is an extension to SLD 1.0, not an extension to SE 1.1, where it's
part of the standard


>
> anyway, I'm happy with whatever naming we come up with.
>

Cool, hopefully others will chime in and provide suggestions about
the naming.


>
>
>
> > The idea of using the UomRescaleStyleVisitor is a good one, and would
> > make for minimal changes.
> ok, one question here: currently the uom value is of type Unit<Length> -
> which does not allow for including a flag that would show if this unit
> is to be interpreted as a real-world size, or as a target-device size. I
> wonder if a new type should be created, that would have a Unit<Length>
> as a member, and a boolean property showing if this is a target-device
> size or a real-world size? would you think of this as a good approach?
>

Ah, good point, I haven't considered it before.
Hum... the code that builds the multiplier used by UomConverter is this one:

/**
     * Computes a rescaling multiplier to be applied to an unscaled value.
     *
     * @param mapScale
     *            the mapScale in pixels per meter.
     * @param uom
     *            the unit of measure that will be used to scale.
     * @return the rescaling multiplier for the provided parameters.
     */
    protected double computeRescaleMultiplier(double mapScale, Unit<Length>
uom) {
        // no scaling to do if UOM is PIXEL (or null, which stands for
PIXEL as well)
        if (uom == null || uom.equals(NonSI.PIXEL))
            return 1;

        // converts value from meters to given UOM
        UnitConverter converter = uom.getConverterTo(SI.METER);
        return converter.convert(mapScale);
    }

whilst the UomOgcMapping contains the mapping between the names and the
Unit<Lenght>.

Wondering if we should just create a custom Unit implementation targeting
device space, something like "DeviceUnit implements Unit<Length>" and have
it be a delegate to an underlying Unit<Length>, such as SI.METER (that
would be configurable, so that people can express the screen sizes
in inches if they want to).

The code above would check for DeviceUnit and do a different conversion
from the target value to the equivalent number of pixels.

Hum... and to do that, I guess UomRescaleStyleVisitor would have to receive
not only the scale denominator, but also the current DPI?

Cheers
Andrea


-- 
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to