GeoTIFFããUTFGridãä½æããããã°ã©ã ãä½ãã¾ããã
ããã使ãã°ãç»åã¨å
±ã«å±æ§å¤ãã¿ã¤ã«ã§é
ä¿¡ã§ããããã«ãªãã¾ãã
ç¹å¾´ã¯ã
- webãµã¼ãã¼ãããã°ããã
- âMapServerãGeoServerãªã©ã®å°å³é ä¿¡ãµã¼ãã¼ãç«ã¦ãªãã¦ãããã
- ã¿ã¤ã«ãªã®ã§ã¯ã©ã¤ã¢ã³ãã®åä½ã軽ãã
- âããªã´ã³ãã¼ã¿ããã¯ãã«ãã¼ã¿ã¨ãã¦èªã¿è¾¼ãã¨é ãã¦åããªãã
- 誰ã§ãå±æ§ä»ãå°å³ãã¼ã¿ãä½æã§ãã¦ãé
ä¿¡ã§ããã
- ã¤ã¾ããOpenTileMapã¨ãã¦å ±æã§ããï¼ï¼ï¼
ã¨ãããã¨ã§ã使ãæ¹ãç´¹ä»ãã¾ãã
ã§ããããã¯ãããªæã
æ¨é«ã®ä¾
http://www.ecoris.co.jp/map/utfgrid_test.html?zoom=13&lat=4823548.9824&lon=15744694.52498&layers=BTTTTTT
æ¤çã®ä¾
http://www.ecoris.co.jp/map/utfgrid_test.html?zoom=13&lat=4799872.6129&lon=15744694.52498&layers=BTTTTTT
çµµå°å³ã®ä¾
http://www.ecoris.co.jp/map/utfgrid_test.html?zoom=16&lat=4607129.48013&lon=15683405.16591&layers=BTTTTTT
A.ããã°ã©ã ã®æºå
ここからプログラムをとってきてãOSGeo4Wã®binã«å ¥ãã¾ãã"C:\OSGeo4W\bin\ ã¨ã"
- gdal2tilesXYZ1band.py
- 1ãã³ãã®GeoTIFFã1ãã³ãã®XYZã¿ã¤ã«ã«å¤æãã¾ããgdal2tilesã¯å¼·å¶çã«3ãã³ãã«å¤æããã®ã§ã1ãã³ãã®ãã¼ã¿ããã®ã¾ã¾1ãã³ãã®ã¾ã¾ã¿ã¤ã«ã«ãã¾ããã¾ãããã®éã«TMSå½¢å¼ã§ã¯ãªãXYZå½¢å¼ã§åºåãã¾ãã
- gdal2tilesXYZ.py
- 3ãã³ãã®GeoTIFFã3ãã³ãã®XYZã¿ã¤ã«ã«å¤æãã¾ããgdal2tilesã®åºåã¯TMSå½¢å¼ãªã®ã§ããããXYZå½¢å¼ã«ãããã®ã§ãããã ããgdal2tilesãåºåããã¡ã¿ãã¼ã¿ãhtmlã¯åºåãã¾ããã
- tile2utfgrid.py
- ã¿ã¤ã«ç»åããUTFGridãã¡ã¤ã«(.json)ãä½æãã¾ãã
- tile2utfgrid.bat
- OSGeo4Wã®ããã®ãã¡ã¤ã«ã§ããä¸è¨ããã°ã©ã ãå¼ã³åºãã ãã§ãã
- gdal2tilesXYZ1band.bat
- OSGeo4Wã®ããã®ãã¡ã¤ã«ã§ããä¸è¨ããã°ã©ã ãå¼ã³åºãã ãã§ãã
- gdal2tilesXYZ.bat
- OSGeo4Wã®ããã®ãã¡ã¤ã«ã§ããä¸è¨ããã°ã©ã ãå¼ã³åºãã ãã§ãã
B.ãã¼ã¿ã®ä½æ
ãã¼ã¿ã®ä½ææ¹æ³ã«ã¯ä»¥ä¸ã®3éãããã¾ãã
ããã¿ã¼ã³1ã
- 1ãã³ãã®ã©ã¹ã¿ã¼å¤ããã®ã¾ã¾å±æ§å¤ã«ãããæ¨é«ãã¼ã¿ãªã©
ããã¿ã¼ã³2ã
- 1ãã³ãã®ã©ã¹ã¿ã¼å¤ã«å¯¾å¿ããå¡ä¾ãã¡ã¤ã«ãç¨æãã¦ããããå±æ§å¤ã¨ãããæ¤çãã¼ã¿ãªã©
ããã¿ã¼ã³3ã
- 3ãã³ãã®RGBå¤ã«å¯¾å¿ããå¡ä¾ãã¡ã¤ã«ãç¨æãã¦ããããå±æ§å¤ã¨ãããçµµå°å³ãªã©
以ä¸ããããã®ãã¿ã¼ã³ã«ã¤ãã¦èª¬æãã¾ãã
ãã¿ã¼ã³1ã®å ´åï¼æ¨é«ãªã©ï¼
1.æ¨é«ãã¼ã¿ãåã£ã¦ãã¦ãgeotiffã«å¤æãã¾ãã
ãã¡ãåç §ãhttp://www.ecoris.co.jp/contents/demtool.html
ä½æãããã¡ã¤ã«ã¯ãdem.tifãã¨ãã¾ããæå½±æ³ã¯ç·¯åº¦çµåº¦ã§ãï¼epsg:4326ï¼
2. 1ãã³ãã®ã¿ã¤ã«ãä½æãã¾ãã
gdal2tilesXYZ1band -s epsg:4326 -r bilinear -z 1-15 dem.tif
3. UTFGridãä½æãã¾ãã
tile2utfgrid dem
å¼æ°ã«ã¯ã¿ã¤ã«åãããGeoTIFFã®å ¥ã£ã¦ãããã©ã«ããæå®ãã¾ãã
4. æ¨é«ç»åãã好ã¿ã§ä½æãã¾ãã
gdaldem color-releif dem.tif color.txt dem_color.tif
â»color.txtã¯èªåã§ç¨æãã¦ãã ããã
5. ç»åãã¿ã¤ã«ã«ãã¾ãã
dem_color.tifã®ååãdem.tifã«å¤æ´ãã¾ãã
â»demãã©ã«ãã«ã¿ã¤ã«ãä¿åãããã
gdal2tilesXYZ -s epsg:4326 -z 1-15 dem.tif
ãã¿ã¼ã³2ã®å ´å(æ¤çãªã©)
1.æ¤çãã¼ã¿ãåã£ã¦ãã¦ãgeotiffã«å¤æãã¾ãã
- こちらからæ¤çãã¼ã¿ããã¦ã³ãã¼ããã¾ãã
- shpãQGISã«èªã¿è¾¼ãã§ããã¼ãã«ã®HANREI_Cããrasterãã¨ããååã§æ´æ°åã¨ãã¦ã³ãã¼ãã¾ãã
- rasteråã使ã£ã¦ãã¯ã¿ã¼ããã©ã¹ã¿ã¼ã«å¤æãã¾ãã
ä½æãããã¡ã¤ã«ã¯ãsyokusei.tifãã¨ãã¾ããæå½±æ³ã¯ç·¯åº¦çµåº¦ã§ãï¼epsg:4326ï¼
2. 1ãã³ãã®ã¿ã¤ã«ãä½æãã¾ãã
gdal2tilesXYZ1band -s epsg:4326 -r near -z 1-15 syokusei.tif
è£éã¯nearã«ãã¾ããï¼ã³ã¼ãå¤ãªã®ã§ï¼
epsgã4326ã§æå®ãã¾ãã
3. å¡ä¾ãã¡ã¤ã«ãä½æãã¾ãã
- å¡ä¾ãã¡ã¤ã«ã«ã¯ãã©ã¹ã¿å¤ã«å¯¾å¿ãããrasterãåãå¿ è¦ã§ãã
- ãã®ä»ã®åã¯ãrasterå¤ã«å¯¾å¿ããä»»æã®å±æ§ãå ¥ãã¦ãã ããã
- æåã³ã¼ããUTF-8ã«ãã¦ãã ããã
ããã§ã¯ãæ¤çãã¼ã¿ã®dbfãã¡ã¤ã«ãcsvã¨ãã¦ä¿åããå¡ä¾ãã¡ã¤ã«ã¨ãã¾ãã
ä¿åããcsvãterapadãªã©ã§éãã¦utf-8ã§ä¿åãç´ãã¦ãã ããã
ä½æãããã¡ã¤ã«ã¯ãp594123.csvãã¨ãã¾ãã
4. UTFGridãä½æãã¾ãã
tile2utfgrid syokusei p594123.csv raster
第1å¼æ°ã«ã¯ã¿ã¤ã«åãããGeoTIFFã®å
¥ã£ã¦ãããã©ã«ããæå®ãã¾ãã
第2å¼æ°ã«ã¯å¡ä¾ãã¡ã¤ã«ãæå®ãã¾ãã
第3å¼æ°ã«ã¯"raster"ãæå®ãã¾ããï¼"color"ãæå®ããå ´åã¯ã次ã§èª¬æï¼
5. æ¤çç»åãä½æãã¾ãã
QGISã§ã好ã¿ã®è²ãä»ãã¦RGBã®GeoTIFFã§æ¸ãåºãã¦ãã ããã
ãã¡ãã®ãã©ã°ã¤ã³ã使ãã¨åºæ¥ã¾ãã
http://www.bc-consult.com/free/bccAddRColor.html
syokusei_color.tifãã¨ãããã¡ã¤ã«åã§ä½æããã¨ãã¾ãã
6. ç»åãã¿ã¤ã«ã«ãã¾ãã
syokusei_color.tifã®ååãsyokusei.tifã«å¤æ´ãã¾ãã
â»syokuseiãã©ã«ãã«ã¿ã¤ã«ãä¿åãããã
gdal2tilesXYZ -s epsg:4326 -z 1-15 syokusei.tif
ãã¿ã¼ã³3ã®å ´å(çµµå°å³ãªã©)
1.èªä½ã®çµµå°å³ãªã©ãgeotiffã«å¤æãã¾ãã
ä½æãããã¡ã¤ã«ã¯ãmymap.tifãã¨ãã¾ããæå½±æ³ã¯ç·¯åº¦çµåº¦ã§ãï¼epsg:4326ï¼
2. XYZã¿ã¤ã«ãä½æãã¾ãã
gdal2tilesXYZ -s epsg:4326 -r near -z 1-15 mymap.tif
è£éã¯ã好ã¿ã§ãã¨ããããnearã«ãã¾ãã
epsgã4326ã§æå®ãã¾ãã
3. å¡ä¾ãã¡ã¤ã«ãä½æãã¾ãã
- GeoTIFFç»åã®RGBè²ã«å¿ããå¡ä¾ãã¡ã¤ã«ï¼csvï¼ãä½æãã¾ãã
- ãRããGããBãåã«ãå¡ä¾ãã¤ãããè²ã10é²æ°(0ã255)ã§æå®ãã¾ãã
- è²ã«å¹ ãããå ´åã¯ã155-160ã®ããã«ç¯å²ã§R,G,Båãæå®ã§ãã¾ãã
- ãã®ä»ã®åã¯ãRGBå¤ã«å¯¾å¿ããããä»»æã®å±æ§ãå ¥ãã¦ãã ããã
- æåã³ã¼ãã¯utf-8ã«ãã¦ãã ããã
ä½æãããã¡ã¤ã«ã¯ãlegendRGB.csvãã¨ãã¾ãã
3. UTFGridãä½æãã¾ãã
tile2utfgrid mymap legendRGB.csv color
第1å¼æ°ã«ã¯ã¿ã¤ã«åãããpngã®å
¥ã£ã¦ãããã©ã«ããæå®ãã¾ãã
第2å¼æ°ã«ã¯å¡ä¾ãã¡ã¤ã«ãæå®ãã¾ãã
第3å¼æ°ã«ã¯"color"ãæå®ãã¾ãã
C.ãã¼ã¿ã®ã¢ãããã¼ã
ä½æããä¸è¨ãã¼ã¿ãwebãµã¼ãã¼ã«ã¢ãããã¼ããã¦ãã ããã
D.htmlã®ä½æ
Openlayersã使ã£ã¦XYZã¿ã¤ã«ãUTFGridãå¼ã³åºãã³ã¼ããæ¸ããhtmlãä½æãã¾ãã
ã©ã¹ã¿å¤ãåå¾ããå ´åã¯ãUTFGridã®dataãªãã¸ã§ã¯ãã®å¤ã¯"V"ã«ãªãã¾ãããã®ä»ã®dataãªãã¸ã§ã¯ãã®å¤ã¯ãå¡ä¾ã§æå®ããååã®éãã§ãã
ããã§ã§ããããã§ãã
è£è¶³
TMSã¿ã¤ã«ã¯å西端ãåç¹ã¨ããã®ã«å¯¾ããXYZã¿ã¤ã«ã¯å西端ãåç¹ã¨ãã¾ãã
gdal2tilesã¯TMSã¿ã¤ã«ãä½æãã¾ãã
UTFGridã®ä»æ§ã¯ãXYZã¿ã¤ã«ã§ãã
ã³ã¡ã³ã
- ãã°ããã£ããæãã¦ãã ããã
- ãã¼ã¿ãå ¬éããéã¯ãåãã¼ã¿ã®è¦ç´ããããèªã¿ãã ããã
- ãã®ããã°ã©ã ã¯ããOpenTileMapããã¸ã§ã¯ãï¼ä»®ï¼ãã®ãããç§å人ãåæã«ä½æãããã®ã§ããä½ãåé¡ãã£ããããããªããã