open source gis 기초교육 4일차 - geoserver 기초 2014년 7월판

Click here to load reader

Upload: bj-jang

Post on 25-May-2015

1.339 views

Category:

Technology


3 download

DESCRIPTION

Textbook of GeoServer Basic by OSGeo Korean Chapter

TRANSCRIPT

2. 2 1. GeoServer 2. GeoServer 3. Data Publishig 4. Map Styling 5. Styling 6. 7. 3. 3 1. GeoServer 1.1 GeoServer? 1.2 GeoServer 1.3 WMS 1.4 WFS 1.5 WCS 1.6 GeoServer 1.7 4. QGIS / . Post GIS . Geo Server . Open Layers GIS UI . 4 5. 5 Data GIS 6. 6 GeoServer WMS WFS WCS Vector Source Raster Source Formatted Map Feature Object Coverage Data png, jpeg, gif GML, GeoJSON ArcGrid, GeoTiff, bmp Vector Source: Shape, GeoDB Raster Source: GeoTiff, IMG, ArcGrid 7. 7 Web Map Service - OGC - - , , - Http - : GetCapabilities , GetMap - : GetFeatureInfo, DescribeLayer, GetLegendGraphic * OGC : Open Geospatial Consortium 8. 8 Web Map Service - http://neowms.sci.gsfc.nasa.gov/wms/wms?version=1.1.1&SERVICE=WMS& REQUEST=GetMap&LAYERS=BlueMarbleNG&FORMAT=image/jpeg&SRS=EP SG:4326&BBOX=-180,-90,180,90&WIDTH=1000&HEIGHT=500 - http://neowms.sci.gsfc.nasa.gov/wms/wms?version=1.1.1&SERVICE=WMS&R EQUEST=GetMap&LAYERS=MOD_LSTN_CLIM_M&FORMAT=image/jpeg&SR S=EPSG:4326&BBOX=124,34,131,40&&WIDTH=600&HEIGHT=600 - http://neowms.sci.gsfc.nasa.gov/wms/wms?version=1.1.1&SERVICE=WMS&R EQUEST=GetMap&LAYERS=MOD14A1_M_FIRE&FORMAT=image/jpeg&SRS =EPSG:4326&BBOX=-180,-90,180,90&&WIDTH=1000&HEIGHT=500 - http://61.43.91.120:8080/geoserver/wms?LAYERS=STD_LINK&SRS=EPSG%3 A4326&TILED=false&ISBASELAYER=false&FORMAT=image%2Fgif&TRANSPAR ENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&E XCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=125.420951,33.9194 28,129.376029,38.671569&WIDTH=480&HEIGHT=800 9. 9 Web Feature Service - OGC (Feature) - - , , - Http XML, GeoJSON - : GetCapabilities , DescribeFeatureType , GetFeature Feature = Geometry + attiribute 10. 10 Web Feature Service - http://www.openlayers.org/dev/examples/strat egy-paging.html http://www.openlayers.org/dev/examples/wfs- states.html - http://www.openlayers.org/dev/examples/wfs- snap-split.html - http://www.openlayers.org/dev/examples/wfs- spatial-filter.html 11. 11 Web Coverage Service - OGC - - , - Http - : GetCapabilities , DescribeCoverage , GetCoverage Coverage = Raster Data 12. 12 Web Coverage Service - http://demo.mapserver.org/cgi- bin/wcs?SERVICE=wcs&VERSION=1.0.0&REQUEST=GetCa pabilities - http://demo.mapserver.org/cgi- bin/wcs?SERVICE=wcs&VERSION=1.0.0&REQUEST=Descri beCoverage&COVERAGE=modis - http://demo.mapserver.org/cgi- bin/wcs?SERVICE=wcs&VERSION=1.0.0&REQUEST=GetCo verage&COVERAGE=modis- 001&CRS=EPSG:26915&BBOX=159707,4597395,1400707, 5501395&WIDTH=400&HEIGHT=300&FORMAT=GEOTIFF_ RGB 13. UI WEB Admin OS JAVA , WEB (GWC), Cache-Control 2.1.3 Data Processing WPS (: http://www.onspatial.com/2009/12/ogc-wps- operation-quick-reference.html) GIS 13 14. 14 Vector File ESRI Shape, GML, VPF, JAVA Property Raster File GeoTIFF, Gtopo30, WorldImage, ArcGrid, GDAL Suffor t Format(IMG, MrSID, ECW, JPEG2000, DTED, NITF) Geo DBMS PostGIS, Oracle, ArcSDE, SQL Server, MySQL, DB2, Ki aros, Tibro Web Interface WFS, WMS WMS PNG, JPEG, GIF, Tiff, KML, KMZ, SVG, GeoRSS, PDF, O penLayers, AtomPub WFS GML2, GML2-GZIP, GML3.1, GML3.2, GeoJSON, CSV WCS ArcGrid, Text Debug Grid, BMP, GeoTIFF, TIFF, PNG, J PEG Input Format Output Format WMS WFS WCS 15. 2.1 GeoServer 2.2 2.3 UI 2.4 Layer 15 16. 16 GeoServer http://geoserver.org/download OpenGeo Suite http://boundlessgeo.com/solutions/opengeo- suite/download/ OpenGeo Suite Service War 17. 17 Download : Stable > Maintenance : Stable < Maintenance 18. 18 JRE( ) 6 . 19. 19 Install as a Service GeoServer Run manually 20. 20 War WAS WAS war Tomcat webapp WAS UI 21. 21 services.msc 22. 22 Vista UAC( ) startup.bat cmd Control-Shift-Enter Run Manually 23. 23 http://localhost:8080/geoserver/ IE : : admin / geoserver 24. 24 UI 25. 25 & GseServer . Workspace, Stores, Layers, Layer Groups, Styles , . GeoServer WMS, WFS, WCS (/ ) . GeoWebCache GeoServer . Geowebcache . . GeoServer SRS(Spatial Reference System) OGC WMS, WFS, WCS Operation request . 26. 26 27. 27 28. 28 CQL 29. 29 3. Data Publishing 3.1 Data Publishing 3.2 Workspace 3.3 Shapefile 3.4 GeoTIFF 3.5 PostGIS 30. 30 (Workspace) (Store) , DBMS, (Style) () (Layer) Data Publishing (Layer Group) () () 31. 31 32. 32 33. 33 34. 34 Day4_GeoServer GeoSeverdata_dirdata 35. 35 36. 36 37. 37 38. 38 39. 39 40. 40 41. 41 + 42. Admin 42 ? 43. 43 44. 44 45. 45 46. 46 47. 47 48. 48 PostGIS 49. 49 50. 50 shp PostGIS 51. 51 4. Map Styling 4.1 SLD 4.2 SLD Sample 4.3 4.4 Vector 4.5 Raster 52. 52 Styled Layer Descriptor(SLD)? , , , / WMS XML OGC http://www.opengeospatial.org/standards/sld 53. 53 SLD /// /// // //// (//// ) 54. 54 SLD hierarchical structure Header FeatureTypeStyles Rules Symbolizers Symbolizer PointSymbolizer LineSymbolizer PolygonSymbolizer RasterSymbolizer TextSymbolizer * Featuretype layer 55. 55 56. 56 Header Symbolizer 57. 57 58. SLD Cookbook http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/index.html 58 59. 59 60. 60 61. 61 62. 62 63. 63 64. 64 SLD 65. 65 SLD 66. 66 67. 67 1~256 ShadedRelief.sld Upload 68. 68 69. 69 70. 70 71. 71 5. Styling 5.1 QGIS 5.2 5.3 5.4 72. QGIS - Admin_sid, admin_sgg, admin_emd 73. SLD 74. population_density_red.sld 75. GeoServer / 76. GeoServer Style population_density UTF-8 EUC-KR font-family [Submit] Preview 77. 78. Label MaxScaleDenominator 79. 79 6. 6.1 Google Earth 6.2 GetLegendGraphic 6.3 6.4 QGIS WMS 6.5 QGIS WFS 80. 80 81. 81 82. 82 83. 83 84. 84 Google Earth WMS http://localhost:8080/geoserver/wms?REQUEST= GetLegendGraphic&VERSION=1.0.0&FORMAT=im age/png&WIDTH=20&HEIGHT=20&LAYER=seoul: admin_emd GeoServer UI Publish SLD Role Title LEGEND_OPTIONS http://docs.geoserver.org/stable/en/user/serv ices/wms/get_legend_graphic/legendgraphic. html?highlight=legend 85. 85 select ST_AsText(ST_Transform(ST_SetSRID(ST_LineFromText('LINESTRING(110 20, 150 50)'), 4326), 900913)); select ST_AsText(ST_Transform(ST_SetSRID(ST_LineFromText('LINESTRING(110 20, 150 50)'), 4326), 2097)); select ST_AsText(ST_Transform(ST_SetSRID(ST_LineFromText('LINESTRING(110 20, 150 50)'), 4326), 32652)); http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request =GetMap&layers=world&styles=&width=660&height=330&format=applica tion/openlayers&srs=EPSG:4326&bbox=110,20,150,50 http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request =GetMap&layers=world&styles=&width=660&height=330&format=applica tion/openlayers&srs=EPSG:900913&bbox=12245143.9872601,2273030.926 98769,16697923.618991,6446275.84101716 http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request =GetMap&layers=world&styles=&width=660&height=330&format=applica tion/openlayers&srs=EPSG:2097&bbox=-1599161.20365349,- 1401708.62964815,1839996.14666927,2091714.20629109 http://localhost:8080/geoserver/wms?service=WMS&version=1.1.0&request =GetMap&layers=world&styles=&width=660&height=330&format=applica tion/openlayers&srs=EPSG:32652&bbox=- 1516012.385514,2328845.36574506,1998458.72659911,5753394.63053658 WGS84 Google TM UTM52N SQL 86. 86 87. 87 88. 88 7. 7.1 Web Cache Logic 7.2 Response Cache Header 7.3 Geo Web Cache(GWC) 7.4 7.5 7.5 89. 89 Text Text Web Browser GIS Server URI Browser Cache ? ? Browser Cache Hit! End If-Modified-Since: LastModifiedTime 304 not modified ? (GeoServer) ? 200 OK + No Yes Remain Expire No Yes 0.1 ms 10 ms 50 ms No Yes 500 ms 90. 90 Client A App Server Server Cache Contents Builder Browse Cache Client B Browse Cache RequestContents Check cache and ask the Production Storage Contents Check cache and reuse Check browser cache and reuse Request Same Contents RequestContents Server Cache On server machine Can share with others Browser Cache On each client machine Can not share with others 91. GeoServer Admin Data Layers WorldCountries Layer Publishing Edit Layer Response Cache Headers Cache Time 604800 (7) . 60 * 60 *24 * 7 = 604800 [Save] 91 92. GeoServer Admin Data Layer Preview demo:WorldCountries Layer OpenLayers Http Response (Chrome [F12], FireFox FireBug, IE HttpWatch) Response Header Expires, Cache- Control: max-age=604800 , Tiling Tiled , . 92 Cache Tiled ! 93. 9393 PNG/JPG (resolution), (scale) 94. 96 Enable direct integration with GeoServer WMS , Tiled=true GWC WMS GWC ( WMS http://localhost:8080/geoserver/wms GWC http://localhost:8080/geoserver/gwc/service/wms) GWC Response Header geowebcache-tile-index WMS Tile Client Recommendation OpenLayers WMS 2.3.x Grid Set UI var maxExtent = new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508), restrictedExtent = maxExtent.clone(), maxResolution = 156543.0339; var options = { projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326"), units: "m", numZoomLevels: 18, maxResolution: maxResolution, maxExtent: maxExtent, restrictedExtent: restrictedExtent }; map = new OpenLayers.Map('map', options); 95. JVM Setting 512MB : -Xmx512m Xms128m : -XX:SoftRefLRUPolicyMSPerMB=36000 : -XX:MaxPermSize=128m : -XX:+UseParallelGC OpenGeo Suite opengeo-suite.bat set VMOPTS=-Xms128m -Xmx512m -XX:MaxPermSize=128m GeoServer bin/startup.bat -Xms128m -Xmx512m GeoServer Wrapper/wrapper.conf wrapper.java.initmemory=128 wrapper.java.maxmemory=512 Tomcat Configure Tomcat 97 96. Logging UI global Setting . DEFAULT, VERBOSE, PRODUCTION, GEOTOOLS_DEVELOPER, GEOSERVER_DEVELOPER . PRODUCTION . Service Strategy GeoServer web.xml . SPEED . BUFFER . FILE . PARTIAL-BUFFER BUFFER SPEED . 98 97. data_dir Workspace, Store, Layer, Style , GWC , data_dir System GeoServer data_dir Web.xml GEOSERVER_DATA_DIR GEOSERVER_DATA_DIRD:geoserver_data_dir 99 98. Vector Data ! GeoServer . . ! . . ! (Simplofiy) . . MBR . ! (Transparecy) 2 . . (Halo) . 100 99. Raster Data JPEG ArcGRID ! . GeoTiff . ECW JPEG2000 . GeoTiff ! GDAL gdaladdo GeoTiff . Ex) gdaladdo -r average mytiff.tif 2 4 8 16 , ! . () . . 4GB GeoServer . 101 100. Output Format Selection png . . png8 . Gif png8 , . Jpeg . / Jpeg . Jpeg . Null value PNG . format option . &format_options=antialias:none Web safe palette png8 gif . &palette:safe 102 101. GeoServer http://geoserver.org GeoServer Documentation http://docs.geoserver.org/ http://open.gaia3d.com/doc/GeoServer/2.4.x/ MakingMapsFast http://www.slideshare.net/jangbi882/geo- server-20111028 103