Monday, December 29, 2014

Find your way around Osaka city's subway using the high resolution vector maps of the train network. The following metro rail lines are available:

Midosuji,

Tanimachi,

Yotsubashi,

Chuo,

Sennichimae,

Sakaisuji,

Nagahori-Tsurumi-ryokuchi,

Imazatosuji,

Newtram Nanko Port Town,

Kita Osaka Kyuko,

Kintetsu Keihanna,

Hankyu Kyoto,

Hankyu Senri,

Osaka Monorail, and

Kitakyu Namboku lines.

The maps have small file size footprints but with many levels of zoom and can work offline without connecting to the Internet. Users can click the train station box labels to open Google Maps or Google StreetView, where they can use all the functions of the Google apps to visualize the surrounding area and/or perform routing for directions. There is also an offline function to calculate the best way to travel from a station to another station with a direction breakdown and timings (which may vary from the actual travelling time).

On a mobile handset, the app will display a list of train maps, which when tapped will open up a detail view of the subway transit map, as shown below.
Tapping the station boxes will bring up an option menu where users can choose to display the station in Google Maps or Street View.
There is also an option to find the best direction to or from the tapped stations.
The app is also optimized for tablet sized devices. Both the list and the vector map are displayed at the same time, as shown below.
The user can toggle the map to full screen mode by tapping the action bar icon at the top right corner.
The app can be downloaded from the Google Play Store. Just click the button below.

Monday, December 15, 2014

Some remote sensing imagery TIFF files contain multiple bands of data such as red, green, blue, and infra-red data. In order to visualize these bands, it is necessary to combine them into an RGB format such as what is called a Colored Infra Red (CIR) display. The open source software ImageMagick can be used to generate the CIR display from the multi-channel TIFF files.

This post illustrates how to create a CIR image from an input RGBI TIFF file. In order to generate a CIR image, the input channels - RGBI has to be reordered to IRG i.e.

the file's output red channel is replaced with the input Infra red channel,

The Curves correction function in just about any image processing software can be used to easily correct the color cast problem. The open source application Gimp is used in this example.

The key to solving the problem is to use the fact that the color gray has the same RGB values. If a gray colored feature in the image e.g. an asphalt road has unequal RGB values, than the image has a color cast problem. To correct the problem, all you have to do is to get the RGB values for that gray point in the image to be the same using the Curves function. It may be necessary to do the correction in the middle, dark and light tones. The following example illustrates how to correct the color cast problem.

Start Gimp and open the aerial photograph. Optional. Make a duplicate layer of the image.

If the Pointer window is not displayed, then select Windows | Dockable Dialogs | Pointer.

Note: the circled area displays the RGB in pixel or percentage values.

Move the pointer around the mid tone gray colored feature e.g. paved road, as shown in the screenshot below. Observe the RGB values in the Pointer window.

Note: in this example, the RGB values are 142, 140, 189 or 55%, 55%, 74%. The numbers say that there is a blue cast in the mid tone values i.e. the blue values are too high and will have to be lowered. The red and green values are okay.

Select Colors | Curves.

The Adjust Color Curves dialog box appears.

Since blue is the problem color, select Blue in the Channel field. Then drag down the blue curve at around 189 pixel value as shown in the screenshot below. You can also move the cursor to the mid tone gray feature and check the new RGB values in the Pointer window. The correction is complete when the RGB values are about equal.

Note: if the preview is toggled on, the effect of the changes will be displayed in the image window.

In this example, the light tones do not seem to show much color cast. However, the dark tones don't seem to have enough red values as shown in the screenshot below. The dark area under the bridge show the RGB values of 1, 18, 17 or 0%, 7%, 7%.

In the Adjust Color Curves dialog box, change the Channel to Red. Click a point in the middle of the curve to anchor the mid and light tone red values since the problem is only in the dark tones. Then drag the 0 pixel curve point up to 17 pixel value.

Note: after every change, always move the cursor to the dark area and check the RGB values in the Pointer window.

When the numbers and preview look pleasing, click OK to confirm the changes.

Monday, December 1, 2014

I was following the official Android Studio documentation on building an Android project with Gradle but every time I run the app on my device, the activity for the library module kept on appearing no matter what changes I made to the app's default activity. The instruction added a button to the default activity and I was expecting a button to appear but what came out was as shown below.

The documentation did not mention anything about this. And after thinking through the problem, I figured that the Run configuration in the Android Studio needs to be told to run the app's activity. The following steps show how to change the Run Configuration.