{"id":1612,"date":"2012-02-21T01:14:36","date_gmt":"2012-02-21T01:14:36","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=1612"},"modified":"2017-01-27T15:54:43","modified_gmt":"2017-01-27T06:54:43","slug":"java-%ed%8a%b9%ec%a0%95-%ed%8f%b4%eb%8d%94%ec%97%90%ec%84%9c-%ec%9b%90%ed%95%98%eb%8a%94-%ed%99%95%ec%9e%a5%ec%9e%90%eb%a5%bc-%ea%b0%80%ec%a7%80%eb%8a%94-%ed%8c%8c%ec%9d%bc-%eb%aa%a9%eb%a1%9d","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=1612","title":{"rendered":"[Java] \ud2b9\uc815 \ud3f4\ub354\uc5d0\uc11c \uc6d0\ud558\ub294 \ud655\uc7a5\uc790\ub97c \uac00\uc9c0\ub294 \ud30c\uc77c \ubaa9\ub85d \uad6c\ud558\uae30"},"content":{"rendered":"<p>\uc6d0\ud558\ub294 \ud3f4\ub354 \uc548\uc5d0.. \ud2b9\uc815\ud55c \ud655\uc7a5\uc790\ub97c \uac00\uc9c0\ub294 \ud30c\uc77c \ubaa9\ub85d\uc744 \uc5bb\uc5b4\uc57c \ud560\ub54c\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4\uc11c D:\/TEMP\ub77c\ub294 \ud3f4\ub354\uc548\uc5d0 \ud655\uc7a5\uc790\uac00 SHP\uc778 \ud30c\uc77c\uc758 \ubaa9\ub85d\uc744 \ubc30\uc5f4 \ud615\ud0dc\ub85c \ubc18\ud658\ud558\ub3c4\ub85d \ud558\ub294 \uacbd\uc6b0\uc774\uc9c0\uc694. \uc774\ub54c \uc0ac\uc6a9\ud560\ub9cc\ud55c \ud568\uc218\uc785\ub2c8\ub2e4.<\/p>\n<pre>private Vector getFileNames(String targetDirName, String fileExt) {\r\n    Vector fileNames = new Vector();\r\n    File dir = new File(targetDirName);\r\n    fileExt = fileExt.toLowerCase();\r\n  \r\n    if(dir.isDirectory()) {\r\n        String dirName = dir.getPath();\r\n        String[] filenames = dir.list(null);\r\n        int cntFiles = filenames.length;\r\n       \r\n        for(int iFile=0; iFile            String filename = filenames[iFile];\r\n            String fullFileName = dirName + \"\/\" + filename;\r\n            File file = new File(fullFileName);\r\n \r\n            boolean isDirectory = file.isDirectory();\r\n            if(!isDirectory && filename.toLowerCase().endsWith(fileExt)) {\r\n                fileNames.add(fullFileName);\r\n            }\r\n        }\r\n    }\r\n\r\n    return fileNames;\r\n }<\/pre>\n<p>\uc81c\uac00 \uc774 \ud568\uc218\uac00 \ud544\uc694\ud588\ub358 \uc774\uc720\ub294.. \ud2b9\uc815 \ud3f4\ub354\uc5d0 \uc874\uc7ac\ud558\ub294 \uc218\ubc31\uac1c\uc758 \ud56d\uacf5\uc601\uc0c1\uc774\ub098 \uc218\ubc31\uac1c\uc758 SHP \ud30c\uc77c\uc744 \ud55c\uaebc\ubc88\uc5d0 \ub808\uc774\uc5b4\ub85c \ucd94\uac00\ud558\uace0\uc790 \ud558\ub294 \ud544\uc694 \ub54c\ubb38\uc774\uc600\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc544\ub798\uc758 \ucf54\ub4dc\ub294 \uc548\ub4dc\ub85c\uc774\ub4dc \uae30\ubc18\uc758 GIS \uc5d4\uc9c4\uc778 \ube14\ub799\ud3ec\uc778\ud2b8\uc5d0\uc11c \uc704\uc758 \ud568\uc218\ub97c \uc0ac\uc6a9\ud574 25cm \ud574\uc0c1\ub3c4\uc758 192\uac1c\uc758 \ud56d\uacf5\uc601\uc0c1(GEOTIFF \uae30\uc900\uc73c\ub85c 40GB \uc774\uc0c1)\uacfc \uc77c\uc815\ud55c \uaca9\uc790\ub85c \ub098\ub208 &nbsp;SHP \ud30c\uc77c 185\uac1c(\uc804\uccb4 \uc6a9\ub7c9 85MB)\ub97c \uc62c\ub9ac\ub294 \ucf54\ub4dc\uc608\uc785\ub2c8\ub2e4.<\/p>\n<pre>LayerManager layerMan = map.getLayerManager();\r\n  \r\nString ess = Environment.getExternalStorageState();   \r\nString sdCardPath = null;   \r\nif(ess.equals(Environment.MEDIA_MOUNTED)) {   \r\n    sdCardPath = Environment.getExternalStorageDirectory().getAbsolutePath();\r\n    String rootDir = sdCardPath + \"\/mapdata\/yp\";\r\n    \r\n    \/\/ \ud56d\uacf5\uc0ac\uc9c4 \ub808\uc774\uc5b4 \ucd94\uac00  \r\n    Vector xrrFiles = getFileNames(rootDir +\"\/XrR\", \"xrr\");\r\n    for(int i=0; i        ILayer layer = new TileImageLayer(\"xrr_\" + i, xrrFiles.get(i), false);\r\n        layerMan.addLayer(layer);\r\n    }\r\n\r\n    \/\/ \uc218\uce58\uc9c0\ub3c4 \ub808\uc774\uc5b4 \ucd94\uac00\r\n    Vector cassFiles = getFileNames(rootDir + \"\/CBND\", \"shp\");\r\n    int cntCbndLyr = cassFiles.size();\r\n    for(int i=0; i        ILayer layer = new ShapeLayer(\"cbnd_\" + i, cassFiles.get(i));\r\n        layerMan.addLayer(layer);\r\n       \r\n        ShapeLayerLabel roadLbl = (ShapeLayerLabel)shpLyr.getLabel();\r\n        roadLbl.setFieldName(\"JIBUN\");\r\n        roadLbl.setEnable(true);\r\n        roadLbl.getFontSymbol().setTextSize(11);\r\n        SimpleDrawShapeTheme roadTheme = (SimpleDrawShapeTheme)shpLyr.getTheme();\r\n        roadTheme.getFillSymbol().setHollow(true);\r\n        roadLbl.getFontSymbol().setTextColor(Color.GREEN);\r\n        roadTheme.getStrokeSymbol().setColor(Color.YELLOW);\r\n}<\/pre>\n<p>\uc544\ub798\ub294 \uc704\uc758 \ucf54\ub4dc\uc5d0 \ubc18\uc601\ub41c \uc2dc\uc2a4\ud15c\uc5d0 \ub300\ud55c \uc2e4\ud589 \ud654\uba74\uc785\ub2c8\ub2e4. \ud074\ub9ad\ud558\uba74 \uc6d0\ubcf8 \ud06c\uae30\ub85c \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/1\/1190429698.jpg\" class=\"aligncenter\" width=\"710\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc6d0\ud558\ub294 \ud3f4\ub354 \uc548\uc5d0.. \ud2b9\uc815\ud55c \ud655\uc7a5\uc790\ub97c \uac00\uc9c0\ub294 \ud30c\uc77c \ubaa9\ub85d\uc744 \uc5bb\uc5b4\uc57c \ud560\ub54c\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4\uc11c D:\/TEMP\ub77c\ub294 \ud3f4\ub354\uc548\uc5d0 \ud655\uc7a5\uc790\uac00 SHP\uc778 \ud30c\uc77c\uc758 \ubaa9\ub85d\uc744 \ubc30\uc5f4 \ud615\ud0dc\ub85c \ubc18\ud658\ud558\ub3c4\ub85d \ud558\ub294 \uacbd\uc6b0\uc774\uc9c0\uc694. \uc774\ub54c \uc0ac\uc6a9\ud560\ub9cc\ud55c \ud568\uc218\uc785\ub2c8\ub2e4. private Vector getFileNames(String targetDirName, String fileExt) { Vector fileNames = new Vector(); File dir = new File(targetDirName); fileExt = fileExt.toLowerCase(); if(dir.isDirectory()) { String dirName = dir.getPath(); String[] filenames &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=1612\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[Java] \ud2b9\uc815 \ud3f4\ub354\uc5d0\uc11c \uc6d0\ud558\ub294 \ud655\uc7a5\uc790\ub97c \uac00\uc9c0\ub294 \ud30c\uc77c \ubaa9\ub85d \uad6c\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[73,71,5,51,85,53],"class_list":["post-1612","post","type-post","status-publish","format-standard","hentry","category-java","tag-android","tag-blackpoint","tag-gis","tag-java","tag-kass","tag-xr"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1612"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1612\/revisions"}],"predecessor-version":[{"id":3081,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1612\/revisions\/3081"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1612"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}