Wednesday, June 17, 2015

Using GDAL to cut a large GeoTIFF raster image to smaller files

Sometimes it may be necessary to cut up a large raster image into smaller tiles so that the dataset can be more manageable. GDAL's command line executable gdal_translate has a projwin option where a bounding window in geographical coordinates can be specified to extract a smaller subset from the input raster image into one or more smaller raster files.


The following steps show how this can be done.

  1. Create a DOS batch file with commands of the following syntax.

    gdal_translate -projwin xlow yhigh xhigh ylow input.tif output.tif

    Note:
    replace xlow with the clipping box's low X geographical coordinate
    replace yhigh with the clipping box's high Y geographical coordinate
    replace xhigh with the clipping box's high X geographical coordinate
    replace ylow with the clipping box's low Y geographical coordinate


  2. Run the clipping batch file.



    The larger image is separated into smaller tiles.

Wednesday, June 10, 2015

WebApp for monitoring traffic incidents in Singapore

This web app allows users to monitor traffic incidents in Singapore including accidents, vehicle breakdowns, obstacles, road blocks, traffic diversions etc. in Singapore (updated every 2 minutes) on a Google Maps backdrop by subscribing to the traffic incidents geoRSS feed. The incidents are shown as clickable and color coded icons with tool tips. 


Clicking on the icon will bring up more details about the incident. 

Together with Google's StreetView, users can truly immerse themselves into the incident environment.


The traffic incidents are also shown as a list on the right pane. The list can be sorted by incident category, and date-time - either in ascending or descending order. Clicking the Maps hyperlink will automatically locate, zoom, and center the incident in the Map view.
The WebApp can be launched from this link http://dominoc925-pages.appspot.com/webapp/trafmon_sg/default.html

Tuesday, June 2, 2015

Using Git with Visual Studio: cloning a repository

I like using the source code repository tool Git with Microsoft Visual Studio 2013. It makes life easier for a developer in managing software code. To start using Git, perhaps one of the first thing to do is to set up Git with Visual Studio and clone an existing repository. The following steps illustrate the basic steps.

  1. Start Visual Studio.


  2. Select View | Team Explorer.

    The Team Explorer pane appears on the right.

  3. Click Settings. Then click Git Settings.

    The Git Global Settings appear.

  4. Type in your User Name and Email Address that you want to associate with Git. If you like, define the Default Repository Location. Click Update.

    The settings are saved.

  5.  Click the Connect to Team Projects button.


  6. Click Clone.


  7. Type in the URL to the Git repository.


  8. Define the directory to clone to, e.g. D:\GitRepos\gps-localtime-windows\.
  9. Click Clone.

    Processing messages appear.


    Finally, the repository is cloned.