Hi,
Anyone can help me by telling me how to get the list of cities/towns in Malaysia? I tried to google it but no luck :S
Thanks
List of Malaysia Cities
List of Malaysia Cities
|
|
Feb 27 2011, 01:33 AM, updated 15y ago
Show posts by this member only | Post
#1
|
![]() ![]() ![]()
Junior Member
439 posts Joined: Oct 2005 |
Hi,
Anyone can help me by telling me how to get the list of cities/towns in Malaysia? I tried to google it but no luck :S Thanks |
|
|
|
|
|
Feb 27 2011, 01:43 AM
Show posts by this member only | Post
#2
|
![]() ![]() ![]() ![]()
Senior Member
539 posts Joined: May 2007 From: PD |
nyem posted this link to a question of mine in the last day or so:
http://www.diva-gis.org/gData You want the "gazetteer". |
|
|
Feb 27 2011, 01:43 AM
Show posts by this member only | Post
#3
|
![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
1,793 posts Joined: Oct 2008 From: UC Berkeley |
dude go to the map. zoom out until you only see kuala lumpur then you'll see other as important cities or town. and are u sure this is the right place to ask?
|
|
|
Feb 27 2011, 01:50 AM
Show posts by this member only | Post
#4
|
![]() ![]() ![]() ![]()
Senior Member
539 posts Joined: May 2007 From: PD |
|
|
|
Feb 27 2011, 02:21 PM
Show posts by this member only | Post
#5
|
![]() ![]() ![]() ![]()
Senior Member
565 posts Joined: Sep 2005 From: Sri Medan |
|
|
|
Feb 27 2011, 04:16 PM
Show posts by this member only | Post
#6
|
![]() ![]() ![]() ![]() ![]()
Senior Member
751 posts Joined: Jan 2007 |
|
|
|
|
|
|
Feb 27 2011, 05:59 PM
Show posts by this member only | Post
#7
|
![]() ![]() ![]() ![]()
Senior Member
565 posts Joined: Sep 2005 From: Sri Medan |
QUOTE(nyem @ Feb 27 2011, 04:16 PM) that's the old one. not updated.. use the link I posted earlier |
|
|
Feb 27 2011, 09:24 PM
Show posts by this member only | Post
#8
|
![]() ![]() ![]()
Junior Member
439 posts Joined: Oct 2005 |
Hi all,
Thanks for all the answer. I need to compile a list of cities to let user choose where they from for the system I am working on. Browsing google map of course i can see it but i am just wondering is there a compiled list for such thing,maybe i am just lazy, but programmers are all lazy,right? Added on February 27, 2011, 9:29 pm QUOTE(seanie @ Feb 27 2011, 01:50 AM) Hi Seanie,I think this is the list I am looking for. Thanks so much. This post has been edited by pufferfish: Feb 27 2011, 09:29 PM |
|
|
Feb 28 2011, 02:41 AM
Show posts by this member only | Post
#9
|
![]() ![]() ![]() ![]()
Senior Member
539 posts Joined: May 2007 From: PD |
Glad you got sorted. What I would expect from one of the sites in gov.my is an API where you can get this kind of data in a directly usable format such as XML, JSON or CSV. I've knocked up a little example of the sort of thing I think should be available (perhaps we just don't know where it is?) at spider.my using the gazetteer data linked above from diva-gis.org. That data is coded up (it looks to me) according to the scheme here:
http://www.geonames.org/export/codes.html So I'd expect to be able to get a list of towns and cities in Negeri Sembilan by looking for PPL (Populated Place), PPLA, etc. This is where it all goes wrong though, because that data isn't in very good shape. PPLs for N9: http://spider.my/api/geopoints.xml?q=F+des...Negeri+Sembilan ... doesn't include Port Dickson. Its administrative division (Adm1, though not used in a conforming way in the original data) is not set - you can see its entry by requesting Adm1= (the empty string): http://spider.my/api/geopoints.xml?q=F+des...PL&push&q=Adm1= The 'q' arguments are queries, applied in sequence, but applied to the same source and same target collections, so a sequence works like 'OR'. The 'push' argument makes the target collection the source and starts a new target collection, the next query works on the previous results, a bit like 'AND'. Here's another example, 'rock' and 'rocks' in Perak: http://spider.my/api/geopoints.xml?q=F+des...sh&q=Adm1=Perak The query scheme is a bit perverse - sorry - it was the quickest way to get a reasonably complex query online. Is there something in similarly usable format with 'official' data from somewhere in gov.my? |
|
|
Feb 28 2011, 09:40 AM
|
![]() ![]() ![]()
Junior Member
439 posts Joined: Oct 2005 |
QUOTE(seanie @ Feb 28 2011, 02:41 AM) Glad you got sorted. What I would expect from one of the sites in gov.my is an API where you can get this kind of data in a directly usable format such as XML, JSON or CSV. I've knocked up a little example of the sort of thing I think should be available (perhaps we just don't know where it is?) at spider.my using the gazetteer data linked above from diva-gis.org. That data is coded up (it looks to me) according to the scheme here: Looks good to me,I might consider using your API though...I also think that gov.my should have certain set of APIs for us to query on the cities/towns in malaysia, too bad there isnt any. I dont think technically its hard to achieve as the data is quite static. Your site performance quite good also,what language are you using? RoR? Can you provide a more detailed APIs list here? Thanks.http://www.geonames.org/export/codes.html So I'd expect to be able to get a list of towns and cities in Negeri Sembilan by looking for PPL (Populated Place), PPLA, etc. This is where it all goes wrong though, because that data isn't in very good shape. PPLs for N9: http://spider.my/api/geopoints.xml?q=F+des...Negeri+Sembilan ... doesn't include Port Dickson. Its administrative division (Adm1, though not used in a conforming way in the original data) is not set - you can see its entry by requesting Adm1= (the empty string): http://spider.my/api/geopoints.xml?q=F+des...PL&push&q=Adm1= The 'q' arguments are queries, applied in sequence, but applied to the same source and same target collections, so a sequence works like 'OR'. The 'push' argument makes the target collection the source and starts a new target collection, the next query works on the previous results, a bit like 'AND'. Here's another example, 'rock' and 'rocks' in Perak: http://spider.my/api/geopoints.xml?q=F+des...sh&q=Adm1=Perak The query scheme is a bit perverse - sorry - it was the quickest way to get a reasonably complex query online. Is there something in similarly usable format with 'official' data from somewhere in gov.my? |
|
|
Feb 28 2011, 12:05 PM
|
![]() ![]() ![]() ![]()
Senior Member
539 posts Joined: May 2007 From: PD |
QUOTE(pufferfish @ Feb 28 2011, 09:40 AM) Looks good to me,I might consider using your API though...I also think that gov.my should have certain set of APIs for us to query on the cities/towns in malaysia, too bad there isnt any. I dont think technically its hard to achieve as the data is quite static. Your site performance quite good also,what language are you using? RoR? Can you provide a more detailed APIs list here? Thanks. My site performance is like personal rocket boots: very fast between crashes! It's pure Java SE on one of Nocser's cheapest Xen VPSes (performance and reliability both seem good), I wrote the web / application server (Spinneret) myself. There's currently no caching being done for the geopoints API: it could be be many times faster with a little bit of caching, but the VPS only has 512MB RAM and I'd rather it didn't swap.I'll probably extend that geopoint api (because I have a couple of trivial applications in mind for it myself) in the next few days. I've added a lot of stuff to spider.my's api in the last couple of weeks and documentation is currently lagging. I'll add the data from world-gazetteer, though not quite sure how exactly to do the merge: whether to take the diva-gis names and coords as authoritative and just add the census data as 'extra' data to existing place entries or whether to create new place (geopoint) entries. I think perhaps I'll do the latter and add a 'source' or 'authority' attribute to say where the data is from, although it will swell the data a bit (I'll add a switch to the API for authority). The merge problem is why we need a national authority for this kind of data - there should be only one entry for 'Port Dickson in Negeri Sembilan' on which all PD data should be keyed. It's pointless me attempting to define a 'reference PD' - I just don't have that authority. I'm going to add a place name lookup and a 'places near' (specify coordinates and radius) method. It's reasonably straightforward to provide other formats (JSON, CSV) too, though I'll probably leave those until the XML method is stable. I'll update this thread when I have the new methods, and update the api documentation ... one day. Added on March 1, 2011, 1:25 amSo here's a first attempt at the new API methods. Find 8 names like Lahad: http://spider.my/api/geopoints.xml?namelike=Lahad,8 (ouch, that looks slow! Edit: Was not yet hotspot-compiled? Cache miss? Sometimes fast) Too much info. See the authorityURL? Use incextra to select the 'extra' data you want - such as Adm1 (Adminstrative division from DivaGIS): http://spider.my/api/geopoints.xml?namelik...8&incextra=Adm1 Or specify a non-existent extra key for no extra elements at all: http://spider.my/api/geopoints.xml?namelik...8&incextra=Rais 'namelike' uses Damerau Levenshtein to rank place names (specify number of suggestions after the comma), and also checks to see if your search string is 'in' each place name. 'nameedit' is plain old Damerau Levenshtein with an edit-distance cutoff after the comma: http://spider.my/api/geopoints.xml?nameedi...&incextra=zilch 'distance' returns points within some distance of a coordinate. Wikipedia suggests a degree of arc latitude is around 100km, with similar for longitude in Malaysia, so reefs within 20km of Lahad Datu: http://spider.my/api/geopoints.xml?distanc...ncextra=nothing The World Gazetteer data had some population figures in it, so here's a query that includes only places whose census2000 population > 250,000: http://spider.my/api/geopoints.xml?q=census2000>250000 I'm afraid 'greater than' is the only operator I've implemented! This post has been edited by seanie: Mar 1 2011, 01:28 AM |
| Change to: | 0.0175sec
0.79
5 queries
GZIP Disabled
Time is now: 16th December 2025 - 11:12 PM |