Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/GeoUrlToBounds.java
r12624 r15184 19 19 * The pattern of a geo: url, having named match groups. 20 20 */ 21 public static final Pattern PATTERN = Pattern.compile("geo:(?<lat>[+-]?[0-9.]+),(?<lon>[+-]?[0-9.]+)(\\?z=(?<zoom>[0-9]+))?"); 21 public static final Pattern PATTERN = Pattern.compile( 22 "geo:(?<lat>[+-]?[0-9.]+),(?<lon>[+-]?[0-9.]+)(?<crs>;crs=wgs84)?(?<uncertainty>;u=[0-9.]+)?(\\?z=(?<zoom>[0-9]+))?"); 22 23 23 24 private GeoUrlToBounds() { -
trunk/test/unit/org/openstreetmap/josm/tools/GeoUrlToBoundsTest.java
r10636 r15184 40 40 41 41 /** 42 * Tests parsing Geo URLs with a CRS and/or uncertainty. 43 */ 44 @Test 45 public void testParseCrsUncertainty() { 46 assertThat( 47 GeoUrlToBounds.parse("geo:60.00000,17.000000;crs=wgs84"), 48 is(OsmUrlToBounds.positionToBounds(60.0, 17.0, 18)) 49 ); 50 assertThat( 51 GeoUrlToBounds.parse("geo:60.00000,17.000000;crs=wgs84;u=0"), 52 is(OsmUrlToBounds.positionToBounds(60.0, 17.0, 18)) 53 ); 54 assertThat( 55 GeoUrlToBounds.parse("geo:60.00000,17.000000;u=20"), 56 is(OsmUrlToBounds.positionToBounds(60.0, 17.0, 18)) 57 ); 58 } 59 60 /** 42 61 * Tests parsing invalid Geo URL. 43 62 */
Note:
See TracChangeset
for help on using the changeset viewer.