300 likes | 488 Views
Dean Anderson Polk County, Oregon GIS in Action 2014. Modifying Open Source Software (A Case Study). GeoMoose. GeoMOOSE is a Web Client JavaScript Framework for displaying distributed cartographic data.
E N D
Dean Anderson Polk County, OregonGIS in Action 2014 Modifying Open Source Software (A Case Study)
GeoMoose • GeoMOOSE is a Web Client JavaScript Framework for displaying distributed cartographic data. • The GeoMOOSE core is written using JavaScript and HTML. It is entirely possible to run GeoMOOSE with nothing more than a basic web server (Nginx, Apache, IIS). But besides the basic client core, GeoMOOSE also comes prepackaged with a number of built in services written in PHP.
GeoMoose Components • GeoMoose.html – starts it all • Mapbook.xml – basic configuration for GeoMoose • Services – PHP based “services” that provide functionality • Extensions – JavaScript that provides added client side capabilities • Maps/Templates – mapserver controls for how maps and data are displayed
GeoMoose 2.61/Oregon – Print The current version of GeoMoose provides a mechanism to print mailing labels for selected property features. CSV or PDF
GeoMoose 2.61/Oregon – Print Good • Easy to implement • Works Well • Easy to use Bad • Only one layer can print per application • Can only print as a “mailing label”
GeoMoose 2.61/OregonNew Print Extension What is needed • A simple way to print the contents of the “results tab” for ANY feature layer. • A simple way to implement the tool I want to print this stuff! Surveys
GeoMoose 2.61/OregonNew Print Extension How to make it happen…. • JavaScript – to print contents of a “div”. • (A willingness to hack code) • A way to register it so GeoMoose knows what to do. • A way to call it from GeoMoose. • The willingness to DOCUMENT and SHARE your results.
GeoMoose 2.61/OregonNew Print Extension 1. JavaScript – PrintTab.js
GeoMoose 2.61/OregonNew Print Extension 2. Register – geomoose.html “Registered”
GeoMoose 2.61/OregonNew Print Extension 3. Template – Select_header.html “Reference to our registered javascript function” <img src='images/toolbar/printer.png' style="cursor:pointer;" title="PrintList" alt="PrintList" onclick='GeoMOOSE.printInfoLst("parcel_holder");'/> <img src='images/toolbar/printer.png' style="cursor:pointer;" title="PrintTable" alt="PrintPrintTable" onclick='GeoMOOSE.printInfoTab("parcel_holder");'/>
GeoMoose 2.61/OregonNew Print Extension 4. Document and Share! Everyone I know….
GeoMoose 2.61/OregonNew Print Extension How it happened Polk Wrote Original Code – OR 2.4 Houston Engineering Expanded It – OR 2.6 Polk County Expanded Code – OR 2.61
GeoMoose 2.61/OregonNew Print Extension Summary • It worked! • GeoMoose has good architecture that supports client extensions. • GeoMoose has a good community for sharing. • When you get an upgrade you have to “re-install”.
GeoMoose 2.61/Oregon – Query The current version of GeoMoose includes a powerful tool to manage queries for features. • Referenced as a service in the Mapbook.xml • Results are displayed using a template html.
GeoMoose 2.61/Oregon – Query Good • Powerful • Easy to implement Bad • We need a SIMPLE way to search for property with few clicks • Users can NOT remember all the field names used for searching (ie. to find a property owner you have to search BOTH owner and agent). • Users can NOT remember the format of the data in our fields for searching (ie. does street direction come after or before the street name and is owner stored by first name first or last name first). • Users can not remember how to implement wild cards (ie. is a * of a %). • Users CAN NOT remember the proper order for ands/or etc to put the needed queries together.
GeoMoose 2.61/OregonModified Service What is needed • A new service that is more intuitive to use that does not require the user to enter in fields, values, and comparators…. • Something my Mom could use.
GeoMoose 2.61/OregonNew Query Service How to make it happen…. • Design a new way to query. • Modify existing PHP service. • Modify Mapbook.xml so the service can be called from GeoMoose. • The willingness to DOCUMENT and SHARE your results.
GeoMoose 2.61/OregonNew Query Service 1. Design – How do you make a Search Similar to GOOGLE ? • INALL (Match All Entered Words) - the values entered must be in all occurrences of a field(s) - this is a "shorthand" way of entering the repetitive "AND“. • INANY (Match Any Entered Words) - the values entered could be in any occurrence of the value in a field(s) - this is a "shorthand" way of entering the repetitive "OR“. • Search Field Collections - Add the ability to collect fields into search "collections" before doing the search. Instead of explicitly selecting each field and the condition for searching.
GeoMoose 2.61/OregonNew Query Service 1. Design – How do you make a Search Similar to GOOGLE ? • INALL (Match All Entered Words) • INANY (Match Any Entered Words) • Search Field Collections • (([OWNER] LIKE "ANDERSON") AND ([OWNER] LIKE "DEAN")) OR (([AGENT] LIKE "ANDERSON") AND ([AGENT] LIKE "DEAN")) Dean Russell Anderson Where ‘Dean’ AND ‘Russell’ AND ‘Anderson’ Dean Russell Anderson Where ‘Dean’ OR ‘Russell’ OR ‘Anderson’
GeoMoose 2.61/OregonNew Query Service 2. Code – Change Query Services htdocs/php/query.php
GeoMoose 2.61/OregonNew Query Service 3. Mapbook.xml – Make a new service
GeoMoose 2.61/OregonNew Query Service Find property owned by Dean Anderson.
GeoMoose 2.61/OregonNew Query Service Find property at 15840 Guthrie.
GeoMoose 2.61/OregonNew Query Service 4. Document and Share • Add Code back to “Oregon 2.61 Demo and Test”. • Add code back to “GeoMoose 2.61 Demo and Test”. • Share Oregon 2.61 Demo with Oregon Users. • Submit New Query Service as a “enhancement request” back to GeoMoose. • Send out e-mails to all that this works!
GeoMoose 2.61/OregonNew Query Service How it happened GeoMoose Core Wrote Original Code – 2.4 Houston Engineering Wrote Original Code – OR 2.4 Houston Engineering Expanded It – OR 2.6 Polk County Expanded Code – OR 2.61
GeoMoose 2.61/OregonNew Query Service Summary • It worked! • GeoMoose has good architecture that supports services. • GeoMoose has a good community for sharing. • GeoMoose is NOT very good at updating core • (is this different from ANY developer?)
Open Source Case Study Summary • It is “relatively” easy to enhance open source software. • The “shared” development model is VERY enabling and powerful. • The “extension design” is a very cool part of GeoMoose. • It is EASY NOT to share, but you should! • It is frustrating to work with core programmers who do not share your sense of urgency to get what you need done. • Doing your thing and sharing with others works.
How ‘You Too’ Can Play • Download Software http://www.geomoose.org/download.html • Install and Test GeoMoose 2.6 • Download Oregon 2.62 - ftp://ftp.co.polk.or.us/ Login: general Password: general File: GeoMoose2.62Oregon.zip • Install as in Readme