Friday, July 24, 2009

Map View vs Application vs Trail Coordinate System

In setting up the iFactor Virtual Earth Connector™ product for a few customers (both actual and evaluation), I have seen the flexible Smallworld projection functionality take more of a front-and-center role for a customer.

Typically customers have set up their SWAF application to use a particular application coordinate system and then they forget about it.

With the VE Connector, rendering can happen in any coordinate system but as you can probably appreciate, the fastest and highest quality rendering can happen if the current map view's coordinate system is the same as the coordinate system that Microsoft's Bing Maps (formerly Virtual Earth) were cached at. So the VE Connector comes with a pre-defined coordinate system (we call it "Virtual Earth") that switches the mapview coordinate system to the same one used by Bing Maps.

Changing the mapview coordinate system has typically caused our customers two "surprises".

The first surprise is that their trail measurements are now different than they used to be. The second surprise is that their application coordinate system is different that it used to be.

Both these "surprises" indicate that the trail coordinate system and the application coordinate system have been "locked" to the mapview coordinate system.

You can change these settings by choosing Tools -> Options from the menu bar.

To change the application coordinate system so that it is always what you want it to be regardless of the current mapview coordinate system, select Geometry Calculations in the Options panel.



To change the trail coordinate system so that it is always what you want it to be regardless of the current mapview coordinate system, select View Defaults in the Options panel and "unlock" the trail coordinate system from the mapivew coordinate system.



That's all there is to it. Remember that changes to the Options panel are typically saved in the ACE so for your changes to be set for all users, you will need to take the usual steps involved with propagating ACE changes down the ACE alternative structure.



Thursday, July 23, 2009

Simplifying Complex Code

I saw an example in code today that cried for simplifaction. Actually, it reminded me of the first piece of code I had reviewed by someone in Cambridge and it got hacked to pieces. It was a bit hard to swallow, but that kind of feedback definitely helped me in the long run.

So here is the perfectly logical, but unnecessarily complex piece of code...

_method cit_circuit.is_bearer?
l_bearer? << _if _self.cit_circuit_type.code = "Bearer"
_then >> _true
_else >> _false
_endif
>> l_bearer?

_endmethod
$

... which can be greatly simplified to...

_method cit_circuit.is_bearer?

_return _self.cit_circuit_type.code = "Bearer"

_endmethod
$


Any time you see an if/then/else block of code that returns a boolean that should raise a red flag for you that your code structure is too complex.

Thursday, April 30, 2009

View Microsoft Virtual Earth data in Smallworld

I'm very excited to share with you all that the company I work for (iFactor Consulting) earlier this week released Version 1 of the Virtual Earth Connector for Smallworld. You can read the official announcement here.

The VE Connector makes use of Smallworld Core Spatial Technology Spatial Object Manager (SOM) functionality to render landbase and aerial imagery tiles served up by Virtual Earth on your Smallworld map view.

The product page has a demonstration video that shows the functionality. If you want to try it out for yourself, you can get a full version evaluation release here.

It seems like all the big players (ESRI, MapInfo, Oracle Spatial) are going in this direction and now iFactor presents this capability for Smallworld.

I would like to acknowledge Brad Sileo (iFactor VP Business Development by day and mclib master by night) for getting the original product code going. All of the iFactor executives are also master coders!

We used alot of standards-based functionality to get this to work. Let's see how many buzzwords I can remember :) : Source Forge mclib, C#, SOAP, Web Services, SWAF, SOM, ACP.

Incidentally, from the Magik Components Source Forge library, we made good use of:
  • sw_dotnet_acp (thanks to Pedro Miranda for making this code available in mclib!)
  • mclib_package
  • mclib_http_interface (thanks to Tony Sileo and Brad Sileo for contributing to this!)
So, here's a plug for Magik Components: It can greatly help you with your own projects, too!

We are operating under an agile "release early, release often" model. So, once you have the product loaded, you can check for updates regularly in the "About" dialog and download the latest revision as soon as it becomes available.