diff --git a/app/src/main/java/com/example/cosmosclient/services/CosmosBackgroundService.java b/app/src/main/java/com/example/cosmosclient/services/CosmosBackgroundService.java index 3ff44f4..0b21880 100644 --- a/app/src/main/java/com/example/cosmosclient/services/CosmosBackgroundService.java +++ b/app/src/main/java/com/example/cosmosclient/services/CosmosBackgroundService.java @@ -457,8 +457,12 @@ } } //cosmosから区画情報から取得 - int areaInfoId =(int)((NowLat+90)/0.1)+(int)((NowLon/0.1)*1800); - codeToFeature =cosmos.getAreaInfo(areaInfoId).getFeature(); + + CosmosLocation cosmosLocation = new CosmosLocation(); + cosmosLocation.setLatitude(NowLat); + cosmosLocation.setLongitude(NowLon); + int areaInfoId = cosmosLocation.hashCode(); + codeToFeature=cosmos.getAreaInfo(areaInfoId).getFeature(); //codeToFeatureの中の50m圏外Featureを削除していく。 //HashMapを順番に実行 for(HashMap.Entry> e : codeToFeature.entrySet()) {