Thursday, August 12, 2010

Nepal In - PHP Arrays

What is Nepal in PHP Arrays - Project ?
 
Are you a PHP developer in Nepal ? or do you use MySQL in your projects. How many of you have easier access to the places & cities of Nepal in simpler arrays, that can be taken for reference and used.

I am currently involved in a project named Gharbeti.com (get updates here ) and got in situation where i need to use the places in Kathmandu to implement the site theme. Gharbeti.com – The Rentals Solutions In Kathmandu.

I was searching through web, searching for some arrays of places, cities, districts headquarters etc. But i was not lucky enough to find them. Instead i thought i would search for places and list them as PHP Arrays or MySQL tables. This wiki page was handy though.

There is a project named PHP Arrays in Github -  I was solely inspired by this project. But, limiting myself to my country i decided to list resources related to Nepal in PHP arrays. This was how all it begun.

What is included in this project till now:

1. Places In Kathmandu - PHP Array & MySQL table
-> listing of most popular places in Kathmandu.
    -places_in_kathmandu.php
    -places_in_kathmandu.sql   


2. 14 Zones & 75 districts of Nepal
    -> 14 Zones (Anchals), 75 (Districts/Headquarters)
     -14_zones_75_districts_of_nepal.php


3. 75 Districts of Nepal and their Latitude & Longitude values.
    -> 75_districts_latitude_longitude.php
    -> If you want to calculate Latitude Longitude values by yourself: here's a little snippet using Google Maps API that we can loop through by yourself.

        $country = "Nepal";
        $city = "Kathmandu";
        $addEncoded = urlencode($country).",+".urlencode($city);
        $geoCode = file_get_contents("http://maps.google.com/maps/api/geocode/json?address=".$addEncoded."&sensor=false");                   
        $response = json_decode($geoCode);
        $lat = $response->results[0]->geometry->location->lat;
        $lng = $response->results[0]->geometry->location->lng;


    -> Pick up any latitude, longitude pair and try browsing in the following link format:
        This link should bring out Map for Chitwan district

 

Do you want to contribute to this Project?

Use the github repo url, clone a local copy or fork it, add files and push the changes.

0 comments :

Post a Comment