Unique Ski Area identifier?
#1
Posted 14 May 2009 - 09:09 PM
Thanks
#2
Posted 14 May 2009 - 09:28 PM
WBSKI, on May 15 2009, 03:09 PM, said:
Thanks
What about the resort logo? I know they change and it's not ideal or as foolproof as a regulated numbering system, but it does allow people to quickly recognise data relating to one area at a glance. I've put the resort logo next to the resort name for reports which compare data between resorts and people say that it makes it easier for them to find information relating to a particular resort.
.
.
#3
Posted 15 May 2009 - 12:06 PM
#4
Posted 18 May 2009 - 05:59 AM
www.skiareasexample.com/United States/Crystal_Mountain_WA
www.skiareasexample.com/United States/WA/Crystal_Mountain
That will work so long as there aren't two ski areas with the same name in any state.
#5
Posted 18 May 2009 - 10:24 AM
#6
Posted 18 May 2009 - 12:14 PM
I totally agree with you on this point, it makes no sense to have a name as a primary key! My point is to have a good web service (that other websites/apps can request data from), you need to have some sort of identifier for each ski area that is constant and also standardized across the web. If some website wants to call a web service for information about Whistler, they would have to know the automatically generated unique identifier in advance. On the other hand, if there was some standardized system, like isbn or country codes, then the client website would know what they are asking for (assuming they have a database of the ski area ids). The client could alternatively ask for a ski area by name/state/country, and the service could search the database for the most relevant record, but this poses a problem as well since the client may not get the expected ski area returned. I know that using the name is a problem from the experience of linking Skiingbc.info to Skimap.org. Some ski area pages on skiingbc.info say they do not have any maps, when in reality skimap.org can simply not find the ski area that skiingbc.info is requesting. This could be solved by a better algorithm for sure, but still, if a ski area's name changes, or skimap.org uses a different ski area name than the client, communication will be hindered. Therefore, I am looking for some sort of standardized system to tie everything together, so as to save the client website from manually linking IDs that are only relevant to one database rather than all ski area databases that use the system.
Makes sense? Maybe I should just start a small project to give each ski area a standardized unique identifier that is somewhat logical..
#7
Posted 18 May 2009 - 12:29 PM
Then you could use a two digit number for province, or state. Then a number for the resort.
So let's say you were to do the sates in alphabetical order, then alphabetical, or really arbitrary for the resort.
So for example let's say you wanted a number for Eaglecrest Ski Area in Alaska the number would be
01-02-04
Cause it's in the US (international code 01) Alaska, (State 2 alphabetically) and then i just assigned 4 to it.
I've put together a database of all the US and Canada ski resorts and I'd be happy to make identifiers for them if we settle on the best pattern to do so by, so we can be standardized.
#8
Posted 18 May 2009 - 12:42 PM
Another solution though is to just create another column in your resort table with the identifier your client requests. So when they run a query, SELECT * FROM resorts WHERE resort_id_2 = 502; it will still make this match.
#9
Posted 18 May 2009 - 01:35 PM
#10
Posted 18 May 2009 - 02:04 PM
I think I will go for a name based search system, that returns the most relevant id keys, which can be used to query the DB. Alternatively, the client can call based on a standardized system like iceberg210's. I am happy to run a script on skimap.org's db of several thousand ski areas and generate a special key for each as iceberg suggested. No need for you to make identifiers by hand! After I have done that, I will publish the up-to-date list of ski area names + stats + identifier in a couple formats.
I have an idea for another website which just deals with databases and client websites connecting to the databases, so this could be the start of that.. (you can add a ski area to that website and then you will get a identifier to use on your website).
A couple things still need to be worked out however. For instance, some ski areas span across regions and countries - how are these handled? Also how are ski area mergers handled. Solutions are welcome!
#11
Posted 18 May 2009 - 02:25 PM
So for Lost Trail, Idaho
It may have the foreign key of 556 (pk in resort table), Idaho 42 and Montana 40 for their foreign key from the state table.
So in the join table, it would look like this
556 | 42
556 | 40
Then when you run your query, it will be based off both the resort and join tables and Lost Trail would appear in both the Montana and Idaho state lists. This same concept applies to the country table.
However, I feel you probably know about joined tables and how to make relationships with them.
#12
Posted 18 May 2009 - 03:39 PM
I think a better approach to countries/regions is to use already standardized abbreviations
Using ISO standards is optimal: (for regions within countries)
http://www.commondatahub.com/live/geograph...6_2_state_codes
For countries (using alpha-2)
http://en.wikipedia....wiki/ISO_3166-1
So for instance: CA-BC-2 (Apex Mountain Resort)
Some work will have to be done on this front in overseas regions if we plan to always use region codes since my ski area db currently does not use regions for more obscure parts of the world.
#13
Posted 18 May 2009 - 04:20 PM
Quote
Exactly and the country and state reference will be made in the joined/weak table (a weak table is one where there is no primary key). However, most countries do break sections into states and providences like Germany and Switzerland, so therefore you should consider just having a table that contains states/providences so that you don't have redundancy with having to list the country id.
#14
Posted 18 May 2009 - 04:31 PM
#16
Posted 19 May 2009 - 07:44 AM
In BC the BCSA assigns a number to each resort and lift. I believe they are all unique. IIRC Blackcomb is 140 and Whistler is 3, but would have to check.
Ray's Rule for Precision - Measure with a micrometer, mark with chalk, cut with an axe.
#17
Posted 19 May 2009 - 08:05 AM
This post has been edited by WBSKI: 19 May 2009 - 08:05 AM
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users











