From 880f483c345b687181027f0e0074ec4461039ba2 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 15 Sep 2011 14:59:42 +0200 Subject: Use GeopointParser to parse coordinates --- src/cgeo/geocaching/files/LocParser.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/cgeo/geocaching/files/LocParser.java') diff --git a/src/cgeo/geocaching/files/LocParser.java b/src/cgeo/geocaching/files/LocParser.java index 34ef7f1..240d61d 100644 --- a/src/cgeo/geocaching/files/LocParser.java +++ b/src/cgeo/geocaching/files/LocParser.java @@ -1,6 +1,5 @@ package cgeo.geocaching.files; -import cgeo.geocaching.cgBase; import cgeo.geocaching.cgCache; import cgeo.geocaching.cgCacheWrap; import cgeo.geocaching.cgCoord; @@ -8,7 +7,7 @@ import cgeo.geocaching.cgSearch; import cgeo.geocaching.cgSettings; import cgeo.geocaching.cgeoapplication; import cgeo.geocaching.enumerations.CacheSize; -import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.geopoint.GeopointParser; import org.apache.commons.lang3.StringUtils; @@ -96,10 +95,8 @@ public final class LocParser extends FileParser { final Matcher matcherLat = patternLat.matcher(pointString); final Matcher matcherLon = patternLon.matcher(pointString); if (matcherLat.find() && matcherLon.find()) { - final Map tmpLat = cgBase.parseCoordinate(matcherLat.group(1).trim(), "lat"); - final Map tmpLon = cgBase.parseCoordinate(matcherLon.group(1).trim(), "lon"); - pointCoord.coords = new Geopoint((Double) tmpLat.get("coordinate"), - (Double) tmpLon.get("coordinate")); + pointCoord.coords = + GeopointParser.parse(matcherLat.group(1).trim(), matcherLon.group(1).trim()); } final Matcher matcherDifficulty = patternDifficulty.matcher(pointString); if (matcherDifficulty.find()) { -- cgit v1.1