Upload
cogs-presentations
View
106
Download
1
Tags:
Embed Size (px)
DESCRIPTION
A report on the steps taken to build a database on local farmers markets, the attending vendors, and vendor suppliers, then serve that information via an online-capable application.
Citation preview
Introduction
Farmers Markets App Development
Colin van VulpenGISY 6160Independent GIS ProjectMay 29, 2014
Introduction
• My background:• B.Sc. (Biology) – Acadia University• B.Tech (Public Health) - CBU• Food Safety Specialist
(Department of Agriculture), Dartmouth NS.
• Came to COGS with an interest in expanding my skill set to include up-to-date mapping techniques & technologies.
Introduction
Introduction
1) in Ontario the Pork Producers Marketing Board of Canada has completed a Premise ID project with the University of Guelph’s Department of Land Resource Science called “BarnBase” in which the location of each hog farm in the province is added to the database and mapped according to its GPS coordinates1.
GIS Uses in Food Sector
Introduction
2) Chicken Farmers of Ontario (CFO) has entered the location data of its members into a GIS database, which contains producer
information such as the farm name, its owner, phone numbers, the address, how many chickens are on the farm, their buyers
and many other details2.
GIS Uses in Food Sector(continued)
Introduction
3) The Dairy Farmers of Ontario (DFO) has recorded the locations of all dairy farms and
bulk storage tanks in a GIS maintained and used by the DFO to route milk trucks and provide data in the event of a disease
outbreak3.
GIS Uses in Food Sector(continued)
Introduction
4) Consumer Education
GIS can be used by farmers and vendors at public markets to show consumers where and how their foods are grown, raised and prepared.
Such transparency confers a marketing advantage for their products as increasingly media-savvy consumers are encouraged to develop a closer relationship through improved visibility and accessibility of information pertaining to the food source, thereby winning customer trust4. (food security, supporting local economy)
GIS Uses in Food Sector(continued)
Introduction
• This project merges the growing popularity of:• online applications• consumer interest in locally-grown foods (“Buy local”)
• Goal was to create an application that promotes local foods by showing consumers not only where to buy them but also tracing those foods back to the farms and suppliers whose foods are used as ingredients.
The Project
Introduction
• Suppliers can be:
1) The vendor themselves (farm) typically selling raw produce, meat, etc.
2) Value-added vendor offering baked goods, ready-to-eat foods, frozen pies, etc.
The Project(continued)
Introduction
• Target Questions for the App to Answer:
1) Where can Local Foods be purchased?2) When can Local Foods be purchased?3) Where do those foods originate?
The Project(continued)
IntroductionProject Scope
IntroductionProject Scope(continued)
Markets:
3) Annapolis Royal (2)9) Bridgetown17) Greenwood8) Berwick23) Kentville (2)40) Wolfville39) Windsor
Lawrencetown
IntroductionData Collection
Vendor Questionnaires distributed starting in late October 2013.
IntroductionData Collection (continued)
Not all required data could be collected from vendor questionnaires - e.g. latitude / longitude of suppliers.
Some Lats / Lons gathered at www.selectnovascotia.ca
Remainder estimated by entering civic address into Google Earth.
Table 1. Tables & Columns in the Relational Database
IntroductionFigure 1. Entity Relationship Diagram (ERD)(Same numbering convention as Table 1)
Introduction
• Programming Languages Involved:1) HTML / Javascript (client-side)2) PHP (server-side)
• Behind-the-scenes requirements for the application:
1) Database Storage System capable of serving data2) Web-server
– Both needs filled by MAMP
Technical Implementation
Introduction
MAMP stands for:i) MacOsX (the operating system it’s designed
for)Versions for Windows (WAMP) and Linux (LAMP) also
exist.
ii) Apache (the internet server)
iii) MySQL (the database management system)
iv) PHP (the programming language used to communicate with the database)
Best of all, it’s open source.
MAMP
Introduction
•
MAMP(continued)
IntroductionphpMyAdmin
IntroductionphpMyAdmin(continued)
- Tables are created & populated with SQL scripts
- Scripts get pasted & ran in phpMyAdmin’s SQL window.
IntroductionJavascript
• Javascript is the “muscle” that puts action on a website
(e.g. addMarker function)
• GoogleMaps API– a programming
extension for online mapping
– Free under 25,000 hits/day and no charge to visitors.
IntroductionRetrieving Data From Database
• php scripts send SQL queries requesting data in certain order by specific columns
• SQL returns data as “rows”
• Data of interest from each row is placed into variables ($var).
• Data “echoed” back to Javascript.
IntroductionAJAX
Early days of web – change screen by reloading entire page.
IntroductionAJAX
AJAX with JSON-encoded requests allows for asynchronous queries to the database.
IntroductionAJAX
AJAX – Asynchronous Javascript and XML.
Introduction
Step 1) Search by Market… Day… & Category using the drop-down select lists
Step 2) Click a Market icon on the Map to see Vendors
Step 3) In the Market infoWindow click “Show Me the Vendors at this Market”
Step 4) In the Vendors List infoWindow “click a Vendor to map Suppliers”
Step 5) In the Foods List infoWindow “click from the list of Food Categories… to see Product Details”
Application ‘Flow’
IntroductionApplication Interface
IntroductionChallenges / Features of the App
1) Keeping the ‘Action’ on the Map (navigation through InfoWindows vs. ‘side panel’ in earlier versions {below} – “distracted experience”)
Introduction
2) Navigation (forward and backward) within InfoWindows
3) Vendors displayed in Alphabetical Order
4) Introduction Pop-up Window offering background & user instructions
5) Intuitive user experience (directing the users’s eye, efficient wording of instructions)
Challenges / Features of the App(continued)
IntroductionChallenges / Features of the App(continued)
6) If a food category was specified in the initial search vendors selling it are listed first and highlighted as selling that food
IntroductionChallenges / Features of the App(continued)
7) Foods selected for further “Product Details” are also highlighted. (example below: “fruit” is highlighted to indicate the product details being displayed are for that category.)
IntroductionChallenges / Features of the App(continued)
8) Visual Concealment of Supplier Markers
- In lieu of transparent infoWindows the main infoWindow is briefly closed and re-opened in Step 5, at least making the user aware of supplier markers that may be behind it.
Introduction
1) Marker Clustering - issues to work out with emptying the
array of GoogleMap API’s “MarkerClusterer” method.2) Enable typing searches
3) User input / interaction (reviews, comments)
Possible Additions
Introduction
1) Dave MacLean (supervisor)
2) Jim Verran (database advice)
3) Kathleen Stewart (php help)
Acknowledgements
Introduction
1. Oger, R., Krafft, A., Buffet, D., Debord, M. (2010, June 28). Geotraceability: An Innovative Concept to Enhance Conventional Traceability in the Agri-Food Chain, Biotechnol. Agron. Soc. Environ. 2010 14(4), 633-642 Retrieved from HYPERLINK http://popups.ulg.ac.be/1780-4507/index.php?id=6375
2. Wang, L., Lu, C., Xie, J., Hu, Y., (2005) Review of Traceability System for Farm Animals and Their Products. Retrieved from HYPERLINK http://www.jaaslib.ac.cn:88/daamnet/DAAM-7/Review%20of%20Traceability%20System%20for%20Farm%20Animals%20and%20Their%20Products.htm
3. Mann, S., (2005) What to do When an Emergency Strikes: Farm and Industry Groups Prepare Their Defenses Against the Next Foreign Animal Disease Outbreak. Retrieved from HYPERLINK http://www.betterfarming.com/2005/bf-dec05/cover.htm
4. Haines, R.J., (2004) Farm to Fork: A Strategy for Meat Safety in Ontario. Retrieved from HYPERLINK http://www.attorneygeneral.jus.gov.on.ca/english/about/pubs/meatinspectionreport/
References
Thank you
Questions? / Comments?