hhaccessibility / hhaccessibility.github.io

http://hhaccessibility.github.io/main/
7 stars 39 forks source link

Create location importer for uwindsor website #381

Closed joshi1983 closed 6 years ago

joshi1983 commented 7 years ago

Terence found some location information available on the University of Windsor's website and wanted to learn how to make an importer tool for it.

The page showing the locations is at: http://web2.uwindsor.ca/pac/campusmap/index.php

After some inspection using Chrome's developer tools, the following XML document was being downloaded which should have most of the information needed for an importer. http://web2.uwindsor.ca/pac/campusmap/markers.xml

This would involve using Python and Python's lxml package to convert the XML to a CSV file with fields for location name, latitude, and longitude.

This tool will help with gathering information on a few locations on the University of Windsor's campus and give Terence an opportunity to get familiar with creating location importers.

Beyond the minimal name, longitude, and latitude fields, the following fields would also be useful in the CSV file:

Blandine-AA commented 7 years ago
joshi1983 commented 7 years ago

The bus station is in our data but not bus stops right now. That can be adjusted, though.

Do you want all bus stops added and rate-able like any other location? I guess they'd all be named "bus stop" and have blank addresses.

yepterence commented 7 years ago

I managed to collect the information regarding the building and their location (lat/lng tuples), as well as the accessible locations (lat/lng tuples) for the buildings, their washrooms and the text which gave information on how to access the buildings.

I stored the information in a dictionary and I am currently trying to figure out how to tabulate the information I had collected.

On Thu, Jul 6, 2017 at 9:20 AM, Josh Greig notifications@github.com wrote:

The bus station is in our data but not bus stops right now. That can be adjusted, though.

Do you want all bus stops added and rate-able like any other location? I guess they'd all be named "bus stop" and have blank addresses.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/hhaccessibility/hhaccessibility.github.io/issues/381#issuecomment-313393832, or mute the thread https://github.com/notifications/unsubscribe-auth/AWfkELF29geKRdPLRyFxy4tiXpSiiE3bks5sLN8QgaJpZM4OLaJx .

joshi1983 commented 7 years ago

Great work, Terence.

I suggest using Python's csv package to write the output. An example using the csv package is in importers/toiletfinder.com/generate_csv.py.

You could write the file like any other plain text file by separating values with commas and separating each location with a line break("\n") but there are some special cases handled better by the csv package. These special cases include things like when a value contains a comma and therefore needs to be quoted or encoded in a special way.

I'll be available to chat after 6pm tonight. I could look at your code and help you make a pull request for it over gmail and TeamViewer.

joshi1983 commented 7 years ago

Terence's work on the uwindsor importer is merged. It included a name, latitude, longitude, URL, and description for each campus location.

Locations such as emergency phones were filtered out because I thought we wouldn't want them listed as accessibility ratable locations.

joshi1983 commented 7 years ago

We should look into this data source a little more before closing.

Blandine suggested the following in a previous comment:

The following fields should also be generated in the CSV:

The categories are listed on the home page at http://demo.accesslocator.com/.

joshi1983 commented 7 years ago

The seed data was updated to include all locations from the University of Windsor campus map importer. This didn't include the accessibility information Blandine mentioned even though that would be helpful.

This did include 2 handi transit stops, though. I don't know if maintaining all bus stops is worth it but the handi transit stops are only 2 and closely tied to accessibility.

I have yet to create a tool for safely updating the location data on app.accesslocator.com to use it. I could just drop and recreate the data with all the seed data in it but want to update the data on app.accesslocator.com the way I ultimately want to update it in demo when demo 0.0.5 is released so without dropping everything and recreating it.

joshi1983 commented 6 years ago

The tool to merge location data into app.accesslocator.com data has been created as part of work on #404. Since this is an import tool, it isn't directly testable on app.accesslocator.com. Some of the imported locations may have duplicates but this can be tested and troubleshooted with work on #404. Since I consider this complete and there's no way to test this through the app.accesslocator.com distinctly from testing #404, I'm closing this issue.