Practical Introduction to Mapguide Open Source
Total Page:16
File Type:pdf, Size:1020Kb
Practical Introduction to MapGuide Open Source Tom Fukushima FOSS4G 2008 Cape Town, South Africa October 3, 2008 1 Workshop Outline Introduction MapGuide Open Source overview Install MapGuide Open Source Administration/system configuration Publishing a map Creating an application © 2006 Autodesk 2 Workshop Outline Introduction MapGuide Open Source overview Install MapGuide Open Source Administration/system configuration Publishing a map Creating an application © 2006 Autodesk 3 What is MapGuide? Open Source web-based geospatial platform • Dynamic data visualization • Feature selection and attribute display • Uniform data query and update • Geometric analysis • Comprehensive API • Support for Open Geospatial Consortium standards • Support for Google Earth © 2006 Autodesk 4 Historical Context © 2006 Autodesk 5 Project Goals and Players Mission: To provide an all in one web-based platform that enables users to quickly develop and deploy web mapping applications and geospatial web services. Project Goals: Players: easy to configure, deploy, and manage Autodesk, Inc. fast, scalable, and cross platform DM Solutions Group support rich access to spatial data both Spatial Integrators, Inc. vector and raster SL-King Spatial Solutions provide a full suite of spatial analysis GEOGRAF A/S produce visually stunning cartographic maps provide the highest degree of map interactivity possible support open standards © 2006 Autodesk 6 Backend Features • Fast, Scalable, Secure • Fully multi-threaded and takes Server Platform advantage of multi-core / multi- processor technology • Support for load balancing multiple servers to improve scalability • Apache mod and ISAPI extensions • Database connection pooling • Map tile caching • Connection-oriented, access-based security • Configurable logging • Web-based site administration allows remote server configuration, and log file access © 2006 Autodesk 7 Backend Features • Fast, Scalable, Secure •Provides hierarchical storage of Server Platform XML resource documents that define maps, layers, data • Built-in Resource Database connections, symbology, and for Manageability viewer layout •Allows you to define data sources and layers once and then reference them from multiple maps •Provides an access-based security model with inheritable permissions •Permits metadata and binary data to be associated with resource documents © 2006 Autodesk 8 Backend Features • Fast, Scalable, Secure •Use of the Feature Data Objects Server Platform (FDO) API for vector and raster • Built-in Resource Database feature data access for Manageability ESRI SHP and SDF vector file formats PostGIS, Oracle, SQL Server, ESRI ArcSDE, MySQL, and ODBC database • Uniform Data Access formats Other vector formats via OGR Raster file formats via GDAL OGC WMS and WFS •Use of DWF for CAD-based data access © 2006 Autodesk 9 Backend Features • Fast, Scalable, Secure • Create, query, read, and write Server Platform resource documents • Query and update feature data • Built-in Resource Database • Perform coordinate re-projection and for Manageability great circle distance computation • Uniform Data Access • Create, manipulate, and analyze geometry with support for spatial • Extensive Server-Side APIs predicates based on the DE-9IM model, overlay functions (intersection, union, difference, symmetric difference), buffer, convex hull, area, and distance functions • Produce stylized vector and raster maps and legends • Manipulate runtime maps and layers © 2006 Autodesk 10 Backend Features • Fast, Scalable, Secure •Extensive support for defining Server Platform custom data-driven symbology for Points, Lines, and Fills • Built-in Resource Database •Scale-dependent detail for Manageability •Rule-driven thematic layer • Uniform Data Access stylization • Extensive Server-Side APIs •Dynamic labeling with overpost detection, labels that follow the • Quality Cartographic path of a line, and automatic Output label resizing •Anti-aliased image rendering using AGG •True color support •TrueType font support © 2006 Autodesk 11 Frontend Features • Highly Interactive and •Uses template driven Fusion Flexible AJAX Viewer technology with Open Layers •Allows feature selection by point, rectangle, radius, or polygon •Displays feature properties in multi-line tool tips •Displays properties of the selected feature in a property browser panel •Supports feature buffering, query within polygon, distance measuring tools •Provides printing and plotting support © 2006 Autodesk 12 Frontend Features • Highly Interactive and •Support for Web Map Service Flexible AJAX Viewer Specification • No SLD support • Limited Support for OGC •Support for Web Feature Service Standards Specification • No WFS/T © 2006 Autodesk 13 Frontend Features • Highly Interactive and •Supports dynamic generation of Flexible AJAX Viewer KML/KMZ via 3 CGI operations • GetMapKml • Limited Support for OGC • GetLayerKml Standards • GetFeaturesKml • Support for Google Earth •Can be used directly in Google Earth via Network Links © 2006 Autodesk 14 Frontend Features • Highly Interactive and Flexible AJAX Viewer • Limited Support for OGC Standards • Support for Google Earth • Maestro Map Authoring Application © 2006 Autodesk 15 Creating a MapGuide Web Application MapGuide applications are defined in terms of XML documents called resources Web Layout Define application functionality and layout Map Definition Combine layers to make a map Layer Definition Define the presentation of a feature class Data Connection Define connections to data files / databases © 2006 Autodesk 16 MapGuide components © 2006 Autodesk 17 MapGuide supported configurations Windows only © 2006 Autodesk 18 Application Development Web tier • PHP, ASP.NET or Java/JSP • A rich API that is 100% identical in all three programming languages Client tier • CSS to separate presentation from contents • JavaScript API that allows manipulation of the viewer and supports interaction with the map (e.g. selection, digitize operations, etc). © 2006 Autodesk 19 Application Interaction Command invocation results in Web Browser HTTP Get or Post request that MapGuide Viewer executes server-side page logic. Application HTML + DWF HTML or Web Server HTML + Image(s) Web Application PHP/ASP.NET/JSP Page Logic MapGuide Site HTTP MapGuide API Resource Service MapGuide MapAgent TCP/IP Feature Service Drawing Server-side page Service Response may includelogic may new call any Mapping Service HTML for displaynumber in a frame, of MapGuide APIs to query data, client-side script, XML or text for Rendering AJAX clients, or a combination.change layer Service visibility, create new Tile data and/or layers, Service etc. © 2006 Autodesk 20 Server-Side APIs System data types thatServices enable thatcommon perform Runtime objects for APIs inserver-side different data analysis, operationslanguages. such as transformation,data query, update, and System mapand viewmap updates.rendering. Runtime Services © 2006 Autodesk 21 Questions? © 2006 Autodesk 22 Workshop Outline Introduction MapGuide Open Source overview Install MapGuide Open Source Administration/system configuration Publishing a map Creating an application © 2006 Autodesk 23 Install from c:\mgos\Software… MapGuide Open Source Server • Run MgServerSetup-2.0.2.3006.exe • Use defaults for everything MapGuide Open Source Web Tier • Run MgWebServerExtensionsSetup-2.0.2.3006.exe • Use defaults for everything • Open http://localhost:8008 in your web browser Maestro • Run MapGuide Maestro 1.0.9.msi • Use defaults for everything © 2006 Autodesk 24 Verify install To quickly verify the install • Start > All Programs > MapGuide Maestro • Change server to http://localhost:8008/mapguide/mapagent/mapagent.fcgi • Press OK to connect © 2006 Autodesk 25 Workshop Outline Introduction MapGuide Open Source overview Install MapGuide Open Source Administration/system configuration Publishing a map Creating an application © 2006 Autodesk 26 Server Admin pages Point your browser at http://localhost:8008/mapguide/mapadmin/login.php Default credentials for administrator/root: Username: Administrator Password: admin Demo… © 2006 Autodesk 27 Exercise 1: Load the Redding package 1. Copy c:\mgos\Data\Redding.mgp to C:\Program Files\MapGuideOpenSource2.0\Server\Packages 2. Start up the Server Admin pages 3. Select “Manage Packages” 4. Load the package © 2006 Autodesk 28 Exercise 2: Add an alias for external files 1. Bring up the Server Admin pages 2. Select “Add Alias” under “Configure External Files” 3. Alias Name: ReddingData 4. Path to External Folder: C:\mgos\Data\Redding 5. Press Save 6. Restart the Server service © 2006 Autodesk 29 Questions? © 2006 Autodesk 30 Workshop Outline Introduction MapGuide Open Source overview Install MapGuide Open Source Administration/system configuration Publishing a map Creating an application © 2006 Autodesk 31 Publishing a Map Goal: Publish a Redding map that has roads and hospitals © 2006 Autodesk 32 Publishing a Map: Data Goal: Publish a Redding map that has roads and hospitals © 2006 Autodesk 33 Exercise 3: Create a feature source • Start Maestro and connect • Create a new folder in the site and call it MyRedding • Create a Dataconnection and select the SHP provider • In the SHP feature source editor, select “File on the server (Unmanaged)” • Browse and select the “City_Boundary.shp” file • Save the feature source and call it “City boundary” in he MyRedding folder © 2006 Autodesk 34 Publishing a Map: Layer Goal: Publish a Redding map that has roads and hospitals ©