고정 영역을 기반으로 한 오프라인 사용을 위해 OSM 타일을 다운로드하려고했는데 잠시 동안 코드가 제대로 작동했습니다.OSM 타일 다운로드, 동료에 의한 재설정
그러나, 나는 최근에이 오류에 직면했습니다 :이 OSM의 서버 문제로 인한 경우 난 그냥 궁금 해서요, 또는이 문제를 일으키는 비효율적 인 코딩 규칙의 일부 유형
ERROR(8936): recvfrom failed: ECONNRESET (Connection reset by peer)
?
이 내 코드를 다운로드 할 수 있습니다 :
for (int y = placeTopLeft.getYTile(); y <= placeBottomLeft.getYTile(); y++){
for(int x = placeTopLeft.getXTile(); x <= placeBottomRight.getXTile(); x++){
try {
String urlStr = "http://a.tile.openstreetmap.org/"+ v +"/"+x+"/"+y+".png";
URL url = new URL(urlStr);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
InputStream in = new BufferedInputStream(urlConnection.getInputStream());
File newFileDir = new File(Environment.getExternalStorageDirectory().toString()
+ "/test/"+ tID+ "/"+v+"/"+x);
newFileDir.mkdirs();
File newFile = new File(newFileDir, y+".png");
OutputStream output = new FileOutputStream(newFile);
int read;
while ((read = in.read()) != -1) {
output.write(read);
output.flush();
}
urlConnection.disconnect();
} catch (Exception e) {
mNotificationHelper.cancelled();
Log.e("URL::: ERROR", e.getMessage());
e.printStackTrace();
}
loopCount++;
publishProgress((int) ((loopCount/totalLoopCount) * 100));
}
}
내가 명확이 오류를 소개하기 위해 어떤 기타 세부 사항을 누락하는 경우 알려주세요, 감사합니다!
MOBAC에 익숙하신 분은 MOBAC에 익숙하시는 분이라면 서버 영역에 문제가 있는지 알려주시겠습니까? – NickT
죄송합니다. – lyk
모바일 아틀라스 크리에이터 http://mobac.sourceforge.net/ – NickT