Author Archives: ssumbera

ikatastr2 on AppStore

I have just release iKatastr2 app on AppStore (free) that  might be useful for you to look at as it uses WMS sources and  custom tile loading on top of google.

App does simple stuff – shows cadastral information by tapping on cadastral  map of the Czech Republic.

As all is driven by JSON configuration it is quite easy to render similar information from other sources.

http://itunes.apple.com/us/app/ikatastr2/id545292674?ls=1&mt=8

 

enjoy !

 

ESA App challenge winner

  I have participated in the first ESA (European Space Agency)  app dev challenge where 5 teams competed on best  concept/prototype that will bring GMES data sources to the public on mobile devices. Our team (Czech Republic, Germany, Macedonia) won and each member got iPad 3 . We won not because we were best in terms of  the best prototype,  concept or presentation, but because we fit best to the criteria imposed by this challenge and each piece of delivery (5 page long document describing concept, presentation, prototype demo)  was pretty good and simple enough to be feasible for final realization. Moreover a unique value of mobile devices plus unique value of  GMES satellites have been addressed.  Full article can be read here :   http://www.esa.int/esaEO/SEMIQOBXH3H_index_0.html

Update 08/08/2012 : there is also press release from my company  Intergraph : http://www.intergraph.com/assets/pressreleases/2012/08-01-2012.aspx

 

ikatastr.cz vs katastr2.cz

quite interesting graph of racing between katastr2 and iKatastr. iKatastr.cz started 10 months later, with big gap in visits against katastr2.cz. Let’s look on the first graph that compares apples to apples – 2 web sites performing the same service – information from cadastral system by taping into the map:

 

it took 17 months to overcome established and quite popular web site, quite long time even though iKatastr.cz offered from the beginning more functionality  (more maps, less clicks, simple UI) and faster performance.

Lesson learned: even you start later and you are outsider, you can eventually catch up and become a leader !..but for that you have to use other forms of achieving this and in case of iKatastr this was idea to bring iKtastr not only on web but mainly on mobile devices. We have launched iKatastr on iOS , Android and WP7 and now let’s look on graph that shows overall visit from all iKatastr apps against katastr2, quite impressive.

now from this perspective, katastr2 seems flat

One last note, I was hoping that mobile iKatastr would help to increase visits to iKatastr.cz, but this has never happened, rather SEO optimization is only what makes difference to  increase search results that consequently increases visits.

 

 

 

 

Statistics of Web vs. Mobile usage

iKatastr apps including Web, iOS (iPhone, iPad) and Android has reached all together 1 million sessions over the period of 19 months. This was exactly on April 28th.

Here are 2  graphs, note, that Android version has started  7 months later thus reflects only period of 12 months

 

 

MapKit optimization

  1. MKMapRect and CGRect are the same !
  2. MapKit sends duplicate requests for CanDraw. Duplication found is 10 of 20 tiles (full iPad screen) are sent twice. Very interesting is that  drawRect in base map does that too (duplicated request is sent from the second running thread )
  3. MapKit is using CATiledLayer underneath
  4. Don’t do copy-paste 2 loops (see MapTile WWDC 2010 sample project from Apple) if your tiles fits exactly to the matrix of the Google tiles

// for (NSInteger x = minX; x < = maxX; x++) {{
//for (NSInteger y = minY; y < = maxY; y++) }}

Relation between MKMapRect and Spherical Mercator Resolution

MKMapRect projected coordinate system used in iOS MapKit  is not the same as Spherical Mercator used by Google, Bing and others. However there is a close linear relationship of the resolution in official spherical mercator and scale used by MapKit and that is   0.149291.

this number is constant for this relation :spherical mercator resolution (e.g. used by OpenLayers)  * zoomscale (used in MapKit)

spherical mercator resolution calculated as : spherical mercator width / view width

zoomscale in MapKit is calculated as : view width / mkMapRect.size.width

that is : spherical mercator width / mkMapRect.size.width = 0.149291  always.

So now any resolution from Spherical Mercator can be directly mapped into the MapKit internal coordinate system (mkMapRect) and vice versa without heavy calculations from mkMapRect to WGS84 and then to Spherical Mercator.

more about projection used in MapKit can be found here : LocationAwarenessPG

How to disable base Google Maps in MapKit

Sept 26th 2012 update :for erasing iOS6 base maps look here: http://blog.sumbera.com/2012/09/26/how-to-erase-ios6-maps-in-mapkit/ 

I have searched this and couldn’t find any answer, so here is my own research so far on this subject. You can disable MapKit base layers using 3 approaches:

#1 remove subview from MKMapView (quite bad as you will loose all overlays too)

#2 use undocumented function (bad too as this will be rejected by Apple approval process):

// get MKMapTileView from view hierarchy
UIView * mkMapTileView = [((UIView*) [ ((UIView*)[self.subviews objectAtIndex:0]).
subviews objectAtIndex:0]).subviews objectAtIndex:0];
// call undocumented method
if ( [mkMapTileView respondsToSelector:@selector(setDrawingEnabled:)]){
[mkMapTileView performSelector:@selector(setDrawingEnabled:) withObject:(id) NO];

#3 use method swizzle

inspired by http://www.mikeash.com/pyblog/friday-qa-2010-01-29-method-replacement-for-fun-and-profit.html

http://atastypixel.com/blog/making-uitoolbar-and-uinavigationbars-background-totally-transparent/

this method is fine as it is official method and enables you to ‘subclass’ a class that you don’t have access in compile time.

#import <objc/runtime.h>

// original method declaration
static void (*_origDrawLayerInContext)(id, SEL, CALayer*, CGContextRef);
// set up subclass in runtime..in some entering method
UIView * mkMapTileView = [((UIView*) [ ((UIView*)[self.subviews objectAtIndex:0]). subviews objectAtIndex:0]).subviews objectAtIndex:0];

Method  origMethod = class_getInstanceMethod([mkMapTileView class], @selector(drawLayer:inContext:));

_origDrawLayerInContext = (void *)method_getImplementation(origMethod);

if(!class_addMethod([mkMapTileView class], @selector(drawLayer:inContext:), (IMP)OverrideDrawLayerInContext, method_getTypeEncoding(origMethod)))

method_setImplementation(origMethod, (IMP)OverrideDrawLayerInContext);

// implement our Override
static void OverrideDrawLayerInContext(UIView *self, SEL _cmd, CALayer *layer, CGContextRef context) {
// possibly call original method if you leave it empty base google maps will not be displayed. You can draw custom content here as well...
//  _origDrawLayerInContext(self, _cmd, layer, context);

}

Skylight UI for SONAR X1 – inspiration for geospatial desktops

This might be of your interest to see  how music production software solved the UI for many controls and options the user might want to control at the same (real!) time.   SONAR X1 actually haven’t brought any new functionality in this new version, just completely redesigned UI and build on top of this marketing campaign. Another fact I like is that they haven’t use all these fancy styles on windows that makes things look ‘nice’ like powerpoint but are not well readable or effective for eyes. To me it is kind of mixture of VisualStudio 2010 UI plus Office Ribbon bar plus good color scheme and additional tweaks to make it really usable.

watch the video here: http://www.youtube.com/watch?v=97LnrViar38