Changeset 18353 in josm for trunk/src


Ignore:
Timestamp:
2022-01-02T19:23:32+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #21696 - add robustness in case NaN coordinates are being projected (just log a warning)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/proj/AbstractProj.java

    r16630 r18353  
    55import org.openstreetmap.josm.data.projection.ProjectionConfigurationException;
    66import org.openstreetmap.josm.tools.CheckParameterUtil;
     7import org.openstreetmap.josm.tools.Logging;
    78
    89/**
     
    170171    // Iteratively solve equation (7-9) from Snyder.
    171172    final double cphi2(final double ts) {
     173        if (Double.isNaN(ts)) {
     174            Logging.warn("Trying to project invalid NaN coordinates");
     175            return Double.NaN;
     176        }
    172177        final double eccnth = 0.5 * e;
    173178        double phi = (Math.PI/2) - 2.0 * Math.atan(ts);
Note: See TracChangeset for help on using the changeset viewer.