nusmodifications / nusmods

🏫 Official course planning platform for National University of Singapore.
https://nusmods.com
MIT License
588 stars 319 forks source link

Manually curate / Crowdsource venue-building / geocoding information #654

Closed ZhangYiJiang closed 6 years ago

ZhangYiJiang commented 6 years ago

From user feedback

I can't even find the different abbreviations of the venue on the NUS website TT~TT however i guess it is good to have a legend or something to show what each abbreviation stands for? Like TP, ERC, and like DV all these

I think this would be useful. Building a crowdsourced solution may be too difficult, so a stopgap measure may be something simpler, like a manually updated CSV or JSON file that we can direct students to update themselves via Google Spreadsheet/Forms or GitHub.

The page can automatically expand abbreviations, like

Education Resource Center - Seminar Room 1 (ERC-SR1)

or maybe include it in a tooltip, or a table on the sidebar. The data doesn't need to be perfect to be useful.

yangshun commented 6 years ago

That's a good idea. The data doesn't change often and it'll be worth the time to do so.

taneliang commented 6 years ago

We could use the NUS Living Lab APIs to get some data. In fact we may even be able to download a list of ALL the rooms in NUS here https://nuslivinglab.nus.edu.sg/api_dev/api/Dept?name=&output=json.

However, that data doesn't correspond to our computed venues list exactly. Specifically:

  1. There are many rooms in our computed Venues list that do not exist in the API. E.g. dRm1
  2. There are many rooms in the API that do not exist in our list. My guess is that these are the rooms we don't really care about anyway, such as staff rooms etc.
  3. There are some room locations in the API that are a bit dubious. Can't remember any off the top of my head though.
  4. Some venues names in our list do not match the entries in the API. E.g. AS1-0207 and AS1-02-07. This looks like a consistent discrepancy across some faculties though, so we could write a script to format the names correctly before querying.

Could still be a good starting point though.

We could also merge the lists to come up with an integrated campus map + venue lessons view. I'm sure we can beat NUS Campus Map's design

taneliang commented 6 years ago

With the Dept API described in my last comment, slightly less than half of our venues can be enhanced with room names and their departments. The results of this attempt can be found here.

But not all hope is lost! I found a catalog of NUS location APIs here: https://arcgis.ami-lab.org/arcgis/rest/services. Some notes:

  1. Floor plans.
    1. These include detailed floor renderings, e.g. https://arcgis.ami-lab.org/arcgis/rest/services/FULL_NUS_NETWORK_051017/FloorplanGroup11/MapServer?f=jsapi
    2. Room shapes, e.g. AS1-01-02
  2. Room locations (x, y, and even z coords!) can be found at various endpoints. However, most include some UTown data such as ERC and SRC but not the RCs. These two below seem to be the most complete, with UTown RCs included:
    1. The POI locator API. e.g. AS1-01-02.
      1. Returns 3D coords and room codes, and that's about it.
      2. However, batch and fuzzy searches are supported - an example. However, we have to be careful as non-existent rooms like "AS1-02-02" will still match "S11-02-02".
    2. The full NUS network API, e.g. BIZ1-03-02.
      1. Returns (among other things): room names ("ARTIFICIAL INTELLIGENCE LAB 3"), floor numbers, room codes ("COM1-01-19"), item category (e.g. "ROOM", "BUILDING") and 3D coords if returnZ param is set.
      2. However, batch and fuzzy searches are not supported, although substring searches are. This means that a hacky way to dump all the data will be just to search for "A", "B", ..., "Z", "0", "1", ..., "9".
    3. Some rooms like "dRm1" still can't be found.
  3. Unfortunately, the bus route APIs are very outdated.
  4. @yangshun has found that some of the APIs use the EPSG:3857 coordinate system. These can be transformed to the "usual" EPSG:4326 coordinates online and offline. Here's also an interesting post describing their differences. The POI locator and full NUS network APIs use EPSG:3414 coords however.

Given these APIs, we should be able to do the following:

  1. In the short term, enhance the Venues feature:
    1. Sanitize most of the venue names (a.k.a. room codes) using the fuzzy batch search in the POI Location API.
    2. All found venues can be enhanced with 3D coordinates, room names and floor numbers using the NUS network API.
    3. We can then display room names, floor numbers, the official NUS room codes (not the inconsistent official junk CORS feeds us), and a pin on a map describing the location.
    4. It'll be nice to be able to get the building name of every room for even easier navigation. If there's no API for this, we could just manually place every room by using the building polygons and the room coordinates.
  2. With much more work, implement a new Maps feature. There are many more rooms (probably around 5-10x more) than our Venues feature contains and this provides an opportunity to create many interesting features. E.g. it'll be interesting to have a feature that tells you the nearest male/female toilet to you. This may be best implemented as a mobile app as well. React Native? 😄
ZhangYiJiang commented 6 years ago

Done in #1106