shapefile renderer restored

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

shapefile renderer restored

Jody Garnett-2
One of the most interesting parts of this was filling in the "render metrics" to actually make sense. I appreciate the nice clear javadocs that Emily did when defining the common constants.

From BasicFeatureMetrics:

        // RESOLUTION QUALITY VS SPEED TRADEOFFS
        IPreferenceStore store = ProjectPlugin.getPlugin().getPreferenceStore();
        boolean antiAliasing = store.getBoolean(PreferenceConstants.P_ANTI_ALIASING);
        if( antiAliasing ){
            this.resolutionMetric = RES_DENSE;
        }
        else {
            this.resolutionMetric = RES_PIXEL;
        }
        // DATA SOURCE PERFORMANCE INDICATORS
        ID id = context.getGeoResource().getID();
        Boolean memory = (Boolean) context.getLayer().getStyleBlackboard().get("net.refractions.udig.style.cache");

        

        if( id.isMemory() ){
            this.latencyMetric = LATENCY_MEMORY;
            this.timeToDrawMetric = DRAW_DATA_MEMORY;
        }
        else if( memory ){
            this.latencyMetric = LATENCY_MEMORY_CACHE;
            this.timeToDrawMetric = DRAW_DATA_MEMORY;
        }
        else if( id.isFile() ){
            this.latencyMetric = LATENCY_LOCAL;
            this.timeToDrawMetric = DRAW_DATA_RAW;
        }
        else if( id.isJDBC() || id.isWFS() ){
            this.latencyMetric = LATENCY_NETWORK;
            this.timeToDrawMetric = DRAW_DATA_RAW;
        }

And the difference for ShapefileRenderer?

        // RESOLUTION QUALITY VS SPEED TRADEOFFS
        this.resolutionMetric = RES_PIXEL;

        

        // DATA SOURCE PERFORMANCE INDICATORS
        this.latencyMetric = LATENCY_LOCAL;
        this.timeToDrawMetric = DRAW_DATA_INDEX;

So the difference between DRAW_DATA_INDEX vs DRAW_DATA_LOCAL will get the shapefile renderer selected.

Jody

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel