Top Banner
Farmers Markets App Development Colin van Vulpen GISY 6160 Independent GIS Project May 29, 2014
36

Farmers Markets Web Application

Jan 27, 2015

Download

Education

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.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Farmers Markets Web Application

Introduction

Farmers Markets App Development

Colin van VulpenGISY 6160Independent GIS ProjectMay 29, 2014

Page 2: Farmers Markets Web Application

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

Page 3: Farmers Markets Web Application

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

Page 4: Farmers Markets Web Application

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)

Page 5: Farmers Markets Web Application

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)

Page 6: Farmers Markets Web Application

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)

Page 7: Farmers Markets Web Application

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

Page 8: Farmers Markets Web Application

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)

Page 9: Farmers Markets Web Application

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)

Page 10: Farmers Markets Web Application

IntroductionProject Scope

Page 11: Farmers Markets Web Application

IntroductionProject Scope(continued)

Markets:

3) Annapolis Royal (2)9) Bridgetown17) Greenwood8) Berwick23) Kentville (2)40) Wolfville39) Windsor

Lawrencetown

Page 12: Farmers Markets Web Application

IntroductionData Collection

Vendor Questionnaires distributed starting in late October 2013.

Page 13: Farmers Markets Web Application

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.

Page 14: Farmers Markets Web Application

Table 1. Tables & Columns in the Relational Database

Page 15: Farmers Markets Web Application

IntroductionFigure 1. Entity Relationship Diagram (ERD)(Same numbering convention as Table 1)

Page 16: Farmers Markets Web Application

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

Page 17: Farmers Markets Web Application

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

Page 18: Farmers Markets Web Application

Introduction

MAMP(continued)

Page 19: Farmers Markets Web Application

IntroductionphpMyAdmin

Page 20: Farmers Markets Web Application

IntroductionphpMyAdmin(continued)

- Tables are created & populated with SQL scripts

- Scripts get pasted & ran in phpMyAdmin’s SQL window.

Page 21: Farmers Markets Web Application

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.

Page 22: Farmers Markets Web Application

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.

Page 23: Farmers Markets Web Application

IntroductionAJAX

Early days of web – change screen by reloading entire page.

Page 24: Farmers Markets Web Application

IntroductionAJAX

AJAX with JSON-encoded requests allows for asynchronous queries to the database.

Page 25: Farmers Markets Web Application

IntroductionAJAX

AJAX – Asynchronous Javascript and XML.

Page 26: Farmers Markets Web Application

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’

Page 27: Farmers Markets Web Application

IntroductionApplication Interface

Page 28: Farmers Markets Web Application

IntroductionChallenges / Features of the App

1) Keeping the ‘Action’ on the Map (navigation through InfoWindows vs. ‘side panel’ in earlier versions {below} – “distracted experience”)

Page 29: Farmers Markets Web Application

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)

Page 30: Farmers Markets Web Application

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

Page 31: Farmers Markets Web Application

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.)

Page 32: Farmers Markets Web Application

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.

Page 33: Farmers Markets Web Application

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

Page 34: Farmers Markets Web Application

Introduction

1) Dave MacLean (supervisor)

2) Jim Verran (database advice)

3) Kathleen Stewart (php help)

Acknowledgements

Page 35: Farmers Markets Web Application

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

Page 36: Farmers Markets Web Application

Thank you

Questions? / Comments?