Expected to be in lat long (EPSG:4326).

@param s
@param version
@param srs
@return
762439
private static ProjectorBounds getBounds(String crs, String s, String version) {
		if (s == null)
			return null;
		String[] items = s.split(",");
		double minLong;
		double minLat;
		double maxLong;
		double maxLat;
		/**
		 * there is some confusion about order of bbox parameters. The OpenGIS
		 * WMS 1.3.0 spec says:
		 * http://portal.opengeospatial.org/files/?artifact_id=14416, 7.3.3.6:
		 * The value of the BBOX parameter in a GetMap request is a list of
		 * comma-separated real numbers (see 6.5) in the form
		 * "minx,miny,maxx,maxy". These values specify the minimum X, minimum Y,
		 * maximum X, and maximum Y values of a region in the Layer CRS of the
		 * request.
		 * 
		 * Yet, the GeoServer doco says:
		 * 
		 * http://docs.geoserver.org/stable/en/user/services/wms/basics.html
		 *
		 * Apparently the bbox parameter order is now that determined by the CRS
		 * definition. EPSG:3857 for instance has this in its WKT: AXIS [X,
		 * "EAST"] AXIS[Y,"NORTH"]. Still can't suss it but getting closer!
		 * 
		 **/

		if (("1.1.1".equals(version) || ("1.1.0".equals(version)) || !("CRS:84".equals(crs)))) {
			minLong = Double.parseDouble(items[0]);
			minLat = Double.parseDouble(items[1]);
			maxLong = Double.parseDouble(items[2]);
			maxLat = Double.parseDouble(items[3]);
		} else {
			// this is the order for CRS:84 but EPSG:4326 apparently not
			minLat = Double.parseDouble(items[0]);
			minLong = Double.parseDouble(items[1]);
			maxLat = Double.parseDouble(items[2]);
			maxLong = Double.parseDouble(items[3]);
		}
		ProjectorBounds bounds = new ProjectorBounds(crs, minLong, minLat, maxLong, maxLat);

		return bounds;
	}
446737
public static Date toDateFromIso8601(String s) {
        if (s == null) return null;
        return ISODateTimeFormat.dateTimeNoMillis().parseDateTime(s).toDate();
    }
923556
public LongitudePair getLongitudeOnGreatCircle(Position position, double latitudeDegrees) {
        double lat3 = toRadians(latitudeDegrees);
        double lat1 = toRadians(lat);
        double lon1 = toRadians(lon);
        double lat2 = toRadians(position.getLat());
        double lon2 = toRadians(position.getLon());
        double l12 = lon1 - lon2;
        double sinLat1 = sin(lat1);
        double cosLat2 = cos(lat2);
        double cosLat3 = cos(lat3);
        double cosLat1 = cos(lat1);
        double sinL12 = sin(l12);
        double A = sinLat1 * cosLat2 * cosLat3 * sinL12;
        double B = sinLat1 * cosLat2 * cosLat3 * cos(l12) - cosLat1 * sin(lat2) * cosLat3;
        double C = cosLat1 * cosLat2 * sin(lat3) * sinL12;
        double longitude = atan2(B, A);
        double v = sqrt(sqr(A) + sqr(B));
        if (abs(C) >= v) {
            // not found!
            return null;
        } else {
            double dlon = acos(C / v);
            double lonCandidate1Degrees = to180(FastMath.toDegrees(lon1 + dlon + longitude));
            double lonCandidate2Degrees = to180(FastMath.toDegrees(lon1 - dlon + longitude));
            return new LongitudePair(lonCandidate1Degrees, lonCandidate2Degrees);
        }
    }
333240
public static String getCodeFromCrs( CoordinateReferenceSystem crs ) throws Exception {
        String code = null;
        try {
            Integer epsg = CRS.lookupEpsgCode(crs, true);
            code = "EPSG:" + epsg; //$NON-NLS-1$
        } catch (Exception e) {
            // try non epsg
            code = CRS.lookupIdentifier(crs, true);
        }
        return code;
    }
204522
public static boolean isLong(String s) {
        if (s == null) {
            return false;
        }
        try {
            Long.parseLong(s.trim());
        } catch (NumberFormatException e) {
            return false;
        }
        return true;
    }
1325090
def ds_extent(ds, t_srs=None):
    
    ul, ll, ur, lr = gt_corners(ds.GetGeoTransform(), ds.RasterXSize, ds.RasterYSize) 
    ds_srs = get_ds_srs(ds) 
    if t_srs is not None and not ds_srs.IsSame(t_srs):
        ct = osr.CoordinateTransformation(ds_srs, t_srs)
        #Check to see if ct creation failed
        #if ct == NULL:
        #Check to see if transform failed
        #if not ct.TransformPoint(extent[0], extent[1]):
        #Need to check that transformed coordinates fall within appropriate bounds
        ul = ct.TransformPoint(*ul)
        ll = ct.TransformPoint(*ll)
        ur = ct.TransformPoint(*ur)
        lr = ct.TransformPoint(*lr)
    extent = corner_extent(ul, ll, ur, lr)
    return extent
736793
@SuppressWarnings("unchecked")
	public static SavepointSerializer<?> getSerializer(int version) {
		SavepointSerializer<?> serializer = SERIALIZERS.get(version);
		if (serializer != null) {
			return serializer;
		} else {
			throw new IllegalArgumentException("Cannot restore savepoint version " + version + ".");
		}
	}
1168602
private SpatialReferenceSystem createIfNeeded(SpatialReferenceSystem srs,
			String organization, long id) throws SQLException {

		if (srs == null) {

			if (organization
					.equalsIgnoreCase(ProjectionConstants.AUTHORITY_EPSG)) {

				switch ((int) id) {
				case ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM:
					srs = createWgs84();
					break;
				case ProjectionConstants.EPSG_WEB_MERCATOR:
					srs = createWebMercator();
					break;
				case ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM_GEOGRAPHICAL_3D:
					srs = createWgs84Geographical3D();
					break;
				default:
					throw new GeoPackageException(
							"Spatial Reference System not supported for metadata creation. Organization: "
									+ organization + ", id: " + id);
				}
			} else if (organization
					.equalsIgnoreCase(ProjectionConstants.AUTHORITY_NONE)) {
				switch ((int) id) {
				case ProjectionConstants.UNDEFINED_CARTESIAN:
					srs = createUndefinedCartesian();
					break;
				case ProjectionConstants.UNDEFINED_GEOGRAPHIC:
					srs = createUndefinedGeographic();
					break;
				default:
					throw new GeoPackageException(
							"Spatial Reference System not supported for metadata creation. Organization: "
									+ organization + ", id: " + id);
				}
			} else {
				throw new GeoPackageException(
						"Spatial Reference System not supported for metadata creation. Organization: "
								+ organization + ", id: " + id);
			}
		} else {
			setDefinition_12_063(srs);
		}

		return srs;
	}
845705
def localortho(lon, lat):
    
    local_srs = osr.SpatialReference()
    local_proj = '+proj=ortho +lat_0=%0.7f +lon_0=%0.7f +datum=WGS84 +units=m +no_defs ' % (lat, lon)
    local_srs.ImportFromProj4(local_proj)
    return local_srs
847099
public static Point getPixelRelative(LatLong latLong, long mapSize, Point origin) {
        return getPixelRelative(latLong, mapSize, origin.x, origin.y);
    }
375990
public LocalDateTime toLocalDateTime(String s) throws SQLException {
    if (s == null) {
      return null;
    }

    int slen = s.length();

    // convert postgres's infinity values to internal infinity magic value
    if (slen == 8 && s.equals("infinity")) {
      return LocalDateTime.MAX;
    }

    if (slen == 9 && s.equals("-infinity")) {
      return LocalDateTime.MIN;
    }

    ParsedTimestamp ts = parseBackendTimestamp(s);

    // intentionally ignore time zone
    // 2004-10-19 10:23:54+03:00 is 2004-10-19 10:23:54 locally
    LocalDateTime result = LocalDateTime.of(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second, ts.nanos);
    if (ts.era == GregorianCalendar.BC) {
      return result.with(ChronoField.ERA, IsoEra.BCE.getValue());
    } else {
      return result;
    }
  }
1273441
public static Version copy(Version version) {
        if (version == null) {
            return null;
        }
        Version result = new Version();
        result.labels = new LinkedList<String>(version.labels);
        result.numbers = new LinkedList<Integer>(version.numbers);
        result.snapshot = version.snapshot;
        return result;
    }
139100
public boolean isGreaterOrEqual(String version) {
        JenkinsVersion create = create(version);
        return this.cv.compareTo(create.cv) >= 0;
    }
774004
public static Version parseVersion(String version) {
		if (!Strings.isNullOrEmpty(version)) {
			try {
				return Version.parseVersion(version);
			} catch (Throwable exception) {
				//
			}
		}
		return null;
	}
532427
def _lat_lons_from_geojson(s):
    
    if len(s) >= 2 and isinstance(s[0], _number) and isinstance(s[0], _number):
        lat, lon = s[1], s[0]
        return [(lat, lon)]
    else:
        return [lat_lon for sub in s for lat_lon in _lat_lons_from_geojson(sub)]
1065791
@FFDCIgnore(NumberFormatException.class)
    private void readWriteTimeAndJavaSpecVersion(WsResource res, String line) {
        int timeIndex = line.indexOf('=');
        int javaSpecVersionIndex = timeIndex >= 0 ? line.indexOf(';', timeIndex) : -1;
        if (timeIndex != -1) {
            try {
                String sTime = javaSpecVersionIndex > timeIndex ? line.substring(timeIndex + 1, javaSpecVersionIndex) : line.substring(timeIndex + 1);
                writeTime = Long.parseLong(sTime);
                if (javaSpecVersionIndex != -1) {
                    javaSpecVersion = Integer.valueOf(line.substring(javaSpecVersionIndex + 1));
                }
            } catch (NumberFormatException nfe) {
            }
        }

        if (writeTime <= 0) {
            writeTime = res.getLastModified();
        }
    }
788787
public static void set(
        MutableLongArrayND a0, LongSupplier s)
    {
        a0.coordinates().parallel().forEach(t ->
        {
            a0.set(t, s.getAsLong());
        });
    }