Monday, November 26, 2012

There are a few online web sites that can place watermarks on one or many images. However, in order to use those services, the images need to be uploaded to the web server before the water marking process can be done. The canvas element of HTML5 is a rich object for image processing and I used this element to write a web app to perform a similar water marking task locally using a modern browser like Chrome and Firefox or Internet Exporer 10+ without having to upload to a web server.

Monday, November 19, 2012

It is useful to programmatically retrieve the list of tables in a GeoMedia warehouse via the connection object. The GeoMedia MetadataService can be called upon to generate the list in a String array. The following C# code snippet shows how this can be done.

The connection object is passed in to the GetTableList method and returns an ArrayList of table names.

using GeoMedia = Intergraph.GeoMedia.GeoMedia;

using PCSS = Intergraph.GeoMedia.PCSS;

using PBasic = Intergraph.GeoMedia.PBasic;

using GDO = Intergraph.GeoMedia.GDO;

using PClient = Intergraph.GeoMedia.PClient;

using PService = Intergraph.GeoMedia.PService;

using GMService = Intergraph.GeoMedia.GMService;

//...etc...

private ArrayList GetTableList(PClient.Connection conn)

{

String[] list = null;

ArrayList tables = new ArrayList();

object oConn = (object)conn;

int mask = 0;

object vTables = null;

GMService.MetadataService metadataSvc = null;

//Create an instance of the GeoMedia MetadataService

metadataSvc = new GMService.MetadataService();

//Pass in the connection object to the MetadataService

metadataSvc.set_Connection(ref oConn);

//Get the connection's list of tables and put them into the vTables array

metadataSvc.GetTables(ref mask, ref vTables);

//copy the table list into an ArrayList and return to the calling function

Monday, November 5, 2012

The geographic (world) coordinate systems e.g. UTM typically have the positive Y-axis pointing upwards and the X-axis pointing eastward. Local coordinate systems such as the HTML5 or SVG canvas have the positive Y-axis pointing downwards. The figure below shows the differences between the world and local coordinate systems.
I found it useful to work out the 2-D equations to transform coordinates between the world and the local coordinate systems for encoding into software programming functions.

A simple non-matrix example is show below.

In the figure below, an image file has the origin O with the world coordinates (x0,y0) and dimensions of Δx and Δy.
The corresponding image file in the local coordinate system has the origin O'(x0',y0') and dimensions of Δx' and Δy'. Typically (x0',y0') = (0,0).

A point P(x,y) in the world coordinate system can be transformed to a point P'(x',y') in the local coordinate system with the following equations:x' = (x - x0) * Sxy' = -(y - y0) * Sy

where Sx = Δx'/ΔxSy = Δy'/Δy

A point P'(x',y') in the local coordinate system can be transformed to a point P(x,y) in the world coordinate system with the following equations:x = (x'/Sx) + x0y = -(y'/Sy) + y0