Package org.geotools.math

Examples of org.geotools.math.Statistics


     *
     * @throws FactoryException If the math transform can't be created or used.
     */
    public Statistics getErrorStatistics() throws FactoryException {
        final MathTransform  mt     = getMathTransform();
        final Statistics     stats  = new Statistics();
        final DirectPosition buffer = new GeneralDirectPosition(getDimension());
        for (final Iterator <MappedPosition> it=getMappedPositions().iterator(); it.hasNext();) {
            final MappedPosition mp = (MappedPosition) it.next();
            /*
             * Transforms the source point using the math transform calculated by this class.
             * If the transform can't be applied, then we consider this failure as if it was
             * a factory error rather than a transformation error. This simplify the exception
             * declaration, but also has some sense on a conceptual point of view. We are
             * transforming the exact same points than the one used for creating the math
             * transform. If one of those points can't be transformed, then there is probably
             * something wrong with the transform we just created.
             */
            final double error;
            try {
                error = mp.getError(mt, buffer);
            } catch (TransformException e) {
                throw new FactoryException(Errors.format(ErrorKeys.CANT_TRANSFORM_VALID_POINTS), e);
            }
            stats.add(error);
        }
        return stats;
    }
View Full Code Here


            if(success) {
                double millis = ((double) System.nanoTime() - start) / 1000000;
                Name name = WFSNotify.getTypeName(feature);
                serializationMillis.add(millis);
                serializationChars.add(sw.getBuilder().length());
                Statistics statsByType = serializationMillisByType.get(name);
                if(statsByType == null) {
                    Statistics newStats = new Statistics();
                    statsByType = serializationMillisByType.put(name, newStats);
                    if(statsByType == null) {
                        statsByType = newStats;
                    }
                }
View Full Code Here

    }

    @Override
    public void resetStats() {
        serializationMillisByType = new ConcurrentHashMap<Name, Statistics>();
        serializationMillis = new Statistics();
        serializationChars = new Statistics();
        failures = new AtomicLong();
        updates = new AtomicLong();
        deletes = new AtomicLong();
        lastFailure = null;
    }
View Full Code Here

    @Override
    public String createSerializationTimeHistogram() {
        StringBuilder sb = new StringBuilder();
        sb.append("<table><thead><tr><td>Type name</td><td>Count</td><td>Min</td><td>Max</td><td>Avg</td><td>Total</td></tr></thead>");
        for(Entry<Name, Statistics> e : serializationMillisByType.entrySet()) {
            Statistics st = e.getValue();
            sb.append("<tr><td>").append(e.getKey()).append("</td><td>").append(st.count()).append("</td><td>")
                .append(st.minimum()).append("</td><td>").append(st.maximum()).append("</td><td>").append(st.mean())
                .append("</td><td>").append(st.mean()*st.count()).append("</td></tr>");
        }
        sb.append("</table>");
        return sb.toString();
    }
View Full Code Here

TOP

Related Classes of org.geotools.math.Statistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.