Blog

Home / Blog

Adding data into ExtJS grid from PostgreSQL with PHP-The JSON format

GIS
Data loading from a database into an application is useful more so if there will be frequent changes on the data stored in the databases. The data is loaded from the database when the application is loading. Any changes on the data are reflected into the grid carrying our data in the application. I will demonstrate using PHP and ExtJS on how to query a database and return the data into a JSON format that will be used in our JavaScript application. First, we write a script that will query our database in PHP (data.php)  //data.php $db = pg_connect("host=somehost port=someport dbname=**** user=**** password=****") or die('could not connect:'.pg_last_error()); $result = pg_query($db, "SELECT *,ST_AsGeoJSON(geom) FROM Africa") or die("Data load failed:".pg_last_error()); $rows = array(          'type'      => 'FeatureCollection',         'features'  => array()  …
Read More
Open Source Web Mapping

Open Source Web Mapping

GIS, Web-GIS
During my second year of college, I came across this technology where maps could be rendered online (web mapping) and users could interact with the maps for visualization and analysis. I found this technology interesting and decided to give it a shot. I encountered the “usual” barriers experienced by any beginner in coding. Then, I came across these interesting and well explained platforms for web mapping (Open Source platforms). After a couple months of research, I settled for ExtJS, OpenLayers, GeoExt, GeoServer, PHP, QGIS, PostgreSQL /PostGIS and HTML/CSS as my development platforms for my web maps. I knew this was a huge project for me to undertake but always motivated by the capabilities the platforms offered me. Spending days and nights on-line trying to come up with something meaningful was…
Read More

Tourist attractions in the USA

General
        USA is prominent worldwide for its ample and startling tourist attractions. It has interesting and fascinating sites in the world and thus receives millions of tourists annually.      Tourists flood this country every year to see for themselves remarkable, outstanding  and most attractive spots like the Niagara falls, uncountable parks and grand canyon only to name a few.The list below has the top 10 tourist attractions that make it an awesome country to make your holidays fantastic.GRAND CANYON        The Grand Canyon is a top tourist attraction in the world and heavily visited all the years. It is simply a mind blowing site that you should not miss touring while in the USA.         The canyon is situated on the northern part of Arizona. The canyon is spectacular with clean and…
Read More

RICE GROWING IN MWEA, KENYA

General
This is an explanation of the activities involved in growing rice in Mwea irrigation scheme. INTRODUCTION Mwea irrigation scheme is in Kirinyaga county, Central province and is the biggest rice producing scheme in Kenya. Rice is a highly-valued staple food in Kenya. Rice yields well in black-cotton soil and needs ample supply of water for better growth. Water in the Mwea irrigation scheme is mainly from two rivers namely; River Nyamindi and River Thiba. In Mwea, there are various types of rice grown including pishori, sindano e.t.c. Each type has its own characteristics separating it from the others and the differences are very evident, even visually. Flooded rice cultivation is profitable but requires high initial investment which is usually not affordable to smallholder farmers. Flooded rice usually yields more than…
Read More