280 likes | 378 Views
Jessica Fendos MN Department of Employment and Economic Development University of Minnesota, CURA. Constructing an Open Source Powerhouse.
E N D
Jessica Fendos MN Department of Employment and Economic Development University of Minnesota, CURA Constructing an Open Source Powerhouse 2007 FOSS4G Conference Sept. 25, 2007
Presentation Outline • Background information • Data source and dynamic interface • Dynamic mapping and reporting • Building blocks of Open Source bundle • Observations on strengths and limitations • Questions
Minnesota 3D Overview • A GIS and internet-based mapping application aims to narrow the spatial mismatch between affordable housing and jobs for the Twin Cities metro area. • A portal that connects the general public, planners, developers, and public policy makers to employment, housing and economic development data.
Partnership • Developed by DEED and CURA, sponsored by Technology Opportunities Program grant. • Partner with the U.S. Census Bureau, Metropolitan Council, Housing Link, MN Department of Human Services, MN Child Care Resources,… • Launched in October of 2006, visited by users worldwide.
The Technical Side …. • Built on an open source bundle integrating MapServer, PostgreSQL, and Chameleon • Interactive systemthat automates commute shed and labor shed maps and community profile reports generation.
The Open Source Framework Chameleon Application M3D Users .phtml .map .html (CWC2, .js, .css) PostGIS Data Developer *Based on Chameleon Web Mapping Framework, Tyler Mitchell, 2005. 2007 FOSS4G Conference Sept. 25, 20078
2007 FOSS4G Conference Sept. 25, 200710
Census Origin Destination Data Work block group Work X, Y Od04_wbg w Home block group Home X, Y w.hbg Local Employment Dynamics Data Job counts
Dynamic Mapping • Map Commute shed and Labor shed • Select by Area • Rectangle • City • Neighborhood • Display by • Dot (block group) • City • Both
2007 FOSS4G Conference Sept. 25, 200713
Dynamic Reports • Select by Area • Rectangle • City • Neighborhood • Select Report • Workers • Workplace • Housing • Demographics
2007 FOSS4G Conference Sept. 25, 2007
Methodology - Building Blocks M3D.map MapServer Mapfile PostgreSQL Database M3D.phtml M3D.html Chameleon Templates SQL Connection String
Dynamic Mapping - Mapfile Define Display Area Type LAYER # Begin Laborshed NAME "Laborshed“ STATUS OFF DATA "the_geom FROM dummypoint" CONNECTION "user=XXXX password=XXXX dbname=M3D host=XXXX port=XXXX" CONNECTIONTYPE postgis TYPE POINT CLASSITEM "all_jobs" CLASS NAME ">100 Commuters" EXPRESSION ([all_jobs]>100) SYMBOL "circle" SIZE 12 COLOR 0 109 44 END … END # End of Laborshedshed layer
Dynamic Mapping - Mapfile Define Selection Area Type LAYER # Selected Block Groups NAME "BG_SELECT" STATUS OFF DATA "the_geom from censusbg_attributed" CONNECTION "user=XXXXX password=XXXX dbname=M3D host=XXXX port=XXXX" CONNECTIONTYPE postgis TYPE LINE CLASS NAME "Selected Block Groups" STYLE SIZE 2 COLOR 0 255 255 SYMBOL "circle" END END END # Selected Block Groups
Dynamic Mapping - M3D.html <input type="hidden" name="SelectValue“ value="[$SelectValue$]"> <script language="JavaScript" type="text/javascript"> function SelectTool() { for (var i=0; i < document.forms[0].rpt.length; i++) { if (document.forms[0].rpt[i].checked) { rad_val = document.forms[0].rpt[i].value; } } document.forms[0].SelectValue.value=(rad_val); } </script>
Dynamic Mapping - M3D_Report.html <script language="JavaScript" type="text/javascript"> if(document.forms[0].SelectValue.value == 'LSHED') {document.write('<input type="radio“ name="rpt“ onChange="SelectTool()" value="LSHED" checked>Dot ');} else {document.write('<input type="radio" name="rpt“ onChange="SelectTool()“ value="LSHED"> Dot ');} </script> 2007 FOSS4G Conference Sept. 25, 200720
Dynamic Mapping - M3D.html <input type="hidden" name="SelectType" value="[$SelectType$]"> <script language="JavaScript" type="text/javascript"> function SelectRegion() { for (var i=0; i < document.forms[0].area.length; i++) { if (document.forms[0].area[i].checked) { rad_val = document.forms[0].area[i].value; } } document.forms[0].SelectType.value=(rad_val); } </script> 2007 FOSS4G Conference Sept. 25, 200721
Dynamic Mapping -M3D_Report.html <script language="JavaScript" type="text/javascript"> if(document.forms[0].SelectType.value == 'RECT') {document.write('<input type="radio" name="area" onChange="SelectRegion()" value="RECT" onClick="ROIRectTool57()" checked="true">Rectangle (as drawn)<br/>');} else {document.write('<input type="radio" name="area" onChange="SelectRegion()" value="RECT" onClick="ROIRectTool57()">Rectangle (as drawn) <br/>');} </script> 2007 FOSS4G Conference Sept. 25, 200722
Chameleon ROI Widgets • <cwc2 type="ROIManager" mode="normal" onroichanged="myROIChanged()"/> • <cwc2 TYPE="ROIRectangleTool" Visible="false" Label="Select Area..." toolset="SelectArea"> </cwc2> • g <cwc2 type="UpdateMap”IMAGEWIDTH="120" LABELALIGN="LEFT" styleresource="NavButtons" visible="true" imagetip="generate report based on selection" label="Generate Map/Report"> <image state="normal"/> <image state="selected"/> <image state="hover"/> </cwc2>
Dynamic Mapping- Chameleon MapDHTML Widget if ($this->getVar( 'SelectValue' ) == "LSHED") { if ($this->getVar( 'SelectType' ) == "RECT") { $oLayer = $poMap->getlayerbyname('Laborshed'); $oLayer->set("status", MS_ON); $oLayer->set("data", " the_geom FROM (SELECT bg_centroid.the_geom AS the_geom, bg_centroid.objectid AS oid, w.all_jobs FROM bg_centroid right join (select w.hbg_fips, sum(w.jobs_all) as all_jobs from od04_wbg w where the_geom && SetSRID('BOX3D($rMinX $rMinY,$rMaxX $rMaxY)'::box3d,-1) AND within(the_geom, SetSRID('BOX3D($rMinX $rMinY,$rMaxX $rMaxY)'::box3d,-1) ) GROUP BY w.hbg_fips ORDER BY all_jobs desc ) as od04_wbg w on bg_centroid.fips = w.hbg_fips) AS new_table USING UNIQUE oid USING SRID=-1"); } }
Strengths and Limitations • Strengths • Free and Integrated: • Open source software bundle provides the foundation to construct spatial data powerhouse relatively quickly, e.g. MS4W package. • Support Network: • Open source users’ group provides support. • Limitations • Technical Consultation: • Long distance communication. • Application Development Cost: • Takes efforts to integrate building blocks contributed from various sources.
Flash Website http://jessicafendos.com/FOSS07 26
Acknowledgements Oriane Casale, DEED, LMI Steve Hine, DEED, LMI Kris Nelson, University of Minnesota, CURA Jeff Matson, University of Minnesota, CURA Jessica Deegan, Metropolitan Council Steve Lime, Department of Natural Resources Julien Samuel-Lacroix, MapGears 2007 FOSS4G Conference Sept. 25, 200727
The End…. 2007 FOSS4G Conference Sept. 25, 200728