Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Farmers Markets Web Application


Published on

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.

Published in: Education
  • Be the first to comment

  • Be the first to like this

Farmers Markets Web Application

  1. 1. Introduction Colin van Vulpen GISY 6160 Independent GIS Project May 29, 2014
  2. 2. 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.
  3. 3. 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.
  4. 4. 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.
  5. 5. 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.
  6. 6. 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)
  7. 7. 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.
  8. 8. 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.
  9. 9. 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?
  10. 10. Introduction
  11. 11. Introduction Markets: 3) Annapolis Royal (2) 9) Bridgetown 17) Greenwood 8) Berwick 23) Kentville (2) 40) Wolfville 39) Windsor Lawrencetown
  12. 12. Introduction Vendor Questionnaires distributed starting in late October 2013.
  13. 13. Introduction Not all required data could be collected from vendor questionnaires - e.g. latitude / longitude of suppliers. Some Lats / Lons gathered at Remainder estimated by entering civic address into Google Earth.
  14. 14. Table 1. Tables & Columns in the Relational Database
  15. 15. Introduction
  16. 16. 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 data 2) Web-server – Both needs filled by MAMP
  17. 17. 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.
  18. 18. Introduction •
  19. 19. Introduction
  20. 20. Introduction - Tables are created & populated with SQL scripts - Scripts get pasted & ran in phpMyAdmin’s SQL window.
  21. 21. Introduction • 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.
  22. 22. Introduction • 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.
  23. 23. Introduction Early days of web – change screen by reloading entire page.
  24. 24. Introduction AJAX with JSON-encoded requests allows for asynchronous queries to the database.
  25. 25. Introduction AJAX – Asynchronous Javascript and XML.
  26. 26. 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”
  27. 27. Introduction
  28. 28. Introduction 1) Keeping the ‘Action’ on the Map (navigation through InfoWindows vs. ‘side panel’ in earlier versions {below} – “distracted experience”)
  29. 29. 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)
  30. 30. Introduction 6) If a food category was specified in the initial search vendors selling it are listed first and highlighted as selling that food
  31. 31. Introduction 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.)
  32. 32. Introduction 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.
  33. 33. 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)
  34. 34. Introduction 1) Dave MacLean (supervisor) 2) Jim Verran (database advice) 3) Kathleen Stewart (php help)
  35. 35. 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 2. Wang, L., Lu, C., Xie, J., Hu, Y., (2005) Review of Traceability System for Farm Animals and Their Products. Retrieved from HYPERLINK 7/Review%20of%20Traceability%20System%20for%20Farm%20Animals%20and%2 0Their%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 dec05/cover.htm 4. Haines, R.J., (2004) Farm to Fork: A Strategy for Meat Safety in Ontario. Retrieved from HYPERLINK ort/