The ArcPad Team Blog

Unofficial stuff from the team behind the World's leading mobile GIS platform

Thursday, August 24, 2006

Performance Tips # 1 : Shapefile drawing speed tuning with greeking

ArcPad 7 users are already experiencing faster shapefile layers drawing than previous ArcPad versions. The performance gains come from a number of design improvements; one of which is known as ‘greeking’ and is an area of performance you can further tune.

The term greeking comes from the publishing world and is frequently used to describe the process of displaying graphics and text with approximated symbols. Such is the case when the resolution of the map display is not sufficient to fully draw features that are very small at the current map scale, instead a simplified approximation of the feature is drawn.

You can enable and disable greeking using the Display Quality tab in ArcPad’s Options dialog.
Further tuning is possible by editing ArcPadPrefs.apx and changing additional parameters related to greeking. The default parameters have been carefully chosen and work well for most situations. There still may be cases where you wish to further tweak the defaults for enhanced performance or display quality to suit your specific application needs.

The simplest technique of editing the additional greeking parameters is to open ArcPadPrefs.apx in ArcPad Studio. Look for the GREEKING branch in the tree. From here you can modify the parameters for each feature type.

Tip: You can just drag the file from Windows Explorer and drop it onto the ArcPad Studio window.

For each feature type you will see there are a number of thresholds. Altering these values will change the rules for when and how ArcPad will greek features in the layer. The parameters you most likely will tweak are the threshold values. As a general rule, each threshold will have a greater value than the one before. ie.

threshold1 < threshold2 < threshold3 < threshold4

Note the not each threshold value has meaning for each feature type.

The parameters related to greeking are all described in the ArcPad Studio Help file and should be referred to before making any changes.

Experiment with different setting and study the effect when a shapefile is drawn at differing scales. Typically the effects are most dramatic when a shapefile layer has many features and is being drawn zoomed out (larger scale values).

You should also test the parameters on your mobile devices to study the effects before wider deployment.

Example of greeking preferences stored in ArcPadPrefs.apx


<ArcPad>
<PREFERENCES>
… other preference elements …
<GREEKING>
<POINT greeking="true" color="Gray" threshold1="0" threshold2="0" threshold3="0" threshold4="0"/>
<POLYLINE greeking="true" color="Gray" threshold1="2" threshold2="5" threshold3="9" threshold4="0"/>
<POLYGON greeking="true" color="Gray" threshold1="1" threshold2="2" threshold3="5" threshold4="9"/>
<MULTIPOINT greeking="true" color="Gray" threshold1="3" threshold2="8" threshold3="0" threshold4="0"/>
</GREEKING>
</PREFERENCES>
</ArcPad>

Wednesday, August 23, 2006

Raster Tips # 1 - Choosing a raster format

To make a proper raster format choice, you should read the entire blog entry, however, having said that, my favourite is TIFF/LZW because it is every where, it has a good compression (10:1), uses little memory and is fast.

Bits Lossy Files Memory Drawing
BMP
1:1
any
n
large
tiny
fast raw
CADRG
55:1
8
n
small
tiny
fast tiles
GIF/LZW
10:1
8
n
small
tiny
slow
JPEG
20:1
24
y
tiny
large
fast memory
JPEG2000
20:1
any
y
tiny
medium
fast tiles
MrSID
20:1
any
y
tiny
medium
fast tiles
PNG
10:1
any
n
small
tiny
slow
TIFF/none
1:1
any
n
large
tiny
fast raw
TIFF/CCITT
100:1
2
n
small
tiny
slow
TIFF/LZW
10:1
any
n
small
tiny
fast strip
TIFF/DEFLATE
10:1
any
n
small
tiny
fast strip
ECW *
20:1
24
y
tiny
medium
fast tiles

* ECW requires a 3rd party extension

In the table Compression, Memory and Drawing speed are a rough guide based on my personal experience. You should always check by running your own performance tests on your data. You may get different results which could and should affect your choice of raster format.

JPEG, JPEG2000, MrSID and ECW are lossy. They achieve high 20:1 compression by losing/replacing bits of image often undetected by the human eye. Choose lossy compression for captured imagery (e.g. scan images, digital camera photos and aerial photography) otherwise choose a non lossy compression for computer generated images such as a cartographic map. If you inadvertently choose a lossy compression for a cartographic map the edges of lines will distort noticeably producing a poorer looking map. JPEGs should be used for small photos like 1 mega pixel images. This is because when JPEGs are loaded into ArcPad they are decompressed in their entirety and can consume large amounts of memory. MrSID, JPEG2000 and ECW are hierarchical tile formats. They are fast when viewing the overall image but may slow down when you zoom in since higher detailed tiles are being retrieved and decompressed which consumes more memory and more CPU time. MrSID and JPEG2000 are supported out of the box by ArcPad whereas ECW requires a 3rd party extension downloadable from ERMapper's website: http://www.ermapper.com/downloads/plugins.aspx.

GIF and PNG are widely used on the internet and both achieve a decent compression of 10:1. These formats are ideal for small images, but are definitely not ideal for large images since both of these formats are sequential meaning they must be read from start to finish. If we zoom in to the centre of these images, ArcPad cannot jump to the right place in the file, it must always read from the beginning of the file and often has to decode large volumes of off screen data before it finds the portion required.

CADRG file format is used by the National Geospatial-Intelligence Agency and is claimed to have compression ratios up to 55:1. I suspect this figure is an overestimation due to mixing 8 bit and 24 bit file formats and the real figure lying between 10:1 and 20:1. The file sizes are small. It also does not use much memory or require much speed to draw in ArcPad. The only limitation is that the format is extremely restrictive in its geographic area and resolution.

BMP, TIFF/none are extremely fast to draw because ArcPad knows where to look in a file to retrieve exactly the right data to reconstruct an image. In addition no decompression step is needed. This format is suitable in terms of speed for both small and large images alike. Its only disadvantage is the file size and therefore it's impact on cost and size of memory cards needed to make such data portable.

TIFF/CCITT is tailored for black/white fax transmissions. It assumes that a large portion of your document is white and assigns a highly compressed binary code for such an area. Such a technique can yield up to 100:1 compression ratios, however, in practice, 50:1 may be more realistic. This format is often coded in a single strip which makes it behave like a sequential file format. This means its will suffer from the same limitations that exists in GIF and PNG in that when you zoom in to the centre of the image large portions of off screen imagery needs to be decoded before ArcPad reaches the portion needed.

TIFF/LZW and TIFF/DEFLATE are both good. They both achieve decent 10:1 compression, require small file sizes, use little memory to decompress and are relatively fast. They are strip based formats so that ArcPad can decompress the image that it needs by decompressing the right strips. The most ideal layout is to have exactly 1 row per strip. This will guarantee that ArcPad decompresses the least amount of data to reconstruct the image. TIFF/LZW is widely supported by various software applications whereas TIFF/DEFLATE (sometimes called ZIP-in-TIFF) is supported mainly by Adobe software.

Tuesday, August 22, 2006

Debugging Tips # 1 - Using the ArcPad 7 Console Window

A common practice in debugging when customising ArcPad with scripts is to place message boxes in your script code to inspect variables or check that your scripts are executing via a particular logic path. However using message boxes can introduce problems as they interrupt the execution of your code and can affect the way your application runs. Message boxes are also not practical for debugging background activity such as GPS and communications events (eg OnPosition, OnComm, etc.) . Message boxes can also be annoying if they appear frequently and usually cannot be easily left in your application for future debugging or in deployment code.

ArcPad 7 introduced the Console window object which can be used as an alternative way of displaying messages without the side effect of interrupted application flow. The Console window can also be used for background activity messages.

Using the Console window is very simple. For example you might be using something like the following VBScript code to display the contents of a variable named Value:

MsgBox “The value is” & Value

To display Value in the Console window instead, use:

Console.Print “The value is” & Value

Or in JScript :

Console.Print("The value is " + Value);

When the Console.Print method is run, the ArcPad console window will be automatically opened and the message displayed without interrupting the application flow.

You can also use color to improve the display of your messages, for example :

Console.Print("ArcPad 7 Is Very Cool”, apRed, apYellow);

Would display red text on a yellow background.

The contents of the Console can be cleared at any time using Console.Clear method, or hidden using Console.Visible = False. You can also change the title of the Console window by setting the Console.Caption property and the background colour of the window via Console.Color. Eg:

Console.Caption = “Debug Messages”
Console.Color = apCyan

You may also wish to keep your debug messages in your application and allow the user to enable them when support is required. Simply wrap each Console.Print call with an if statement which checks if the application is running in a debug state.eg:

If Application.UserProperties(“debug”) = true then
Console.Print “The value is” & Value
End If


In the example above the debug state is kept in the Application.UserProperties(“debug”) variable. This approach uses an ArcPad application global variable that is accessible across all applets, forms and layers. This then allows debug messages to be turned on or off via a single simple statement. You can also leave all your handy debug messages in your code, without impacting the user. Eg :

Application.UserProperties(“debug”) = true

Attach script code similar to the above to an ArcPad toolbar button, and your application user can then easily turn on or off debug messages via just a toolbar button click. This technique could be useful if you have to provide support to remote users and you’d like to them to report some of the debug messages you left in your code.


Another useful feature of the Console object is that it can be used to display ArcPad’s internal debugging messages, which is especially useful for watching which events are firing when ArcPad is running and seeing map draw timing information. To enable the internal debug messages, set the Console.DebugFlags property to 3. Eg:

Console.DebugFlags = 3


Finally, the Console window is not limited to just debugging code, you can also consider it as another way of presenting messages in your application such as status information, when user intervention is not required.

Saturday, August 19, 2006

Where in the ArcPad World are you?

We would like to know where in the world you are!
(And so would other ArcPad-ers)

So if you're an ArcPad User, or an ArcPad Service Provider such as a consultant, trainer or offer other related services; please add yourself to our new ArcPad World map.
If you have a website related to your projects or services, add the URL into the Shoutout field when adding your location. Add a picture too if you have one, we'd all like to see you :)

If you have any additional interesting project sites, add them too as ArcPad Project locations.

Even if you're not an ArcPad user, go ahead and add yourself as a Friend of ArcPad :)

Friday, August 18, 2006

UC2006 Over : A Successful Conference for ArcPad Users and the Team

UC2006 is over and as always it was an exhausting (but satisfying) experience no matter what your involvement is.
This year's conference was great for ArcPad. We had many hundreds of people attend the various ArcPad technical workshops, user presented papers sessions and visiting us at the Mobile GIS island.

For the team, we greatly enjoyed spending time with users, presenting our workshop sessions and of course getting your feedback and experience. Unfortunately no matter how long the conference was, there isn't ever enough time to get to talk to you all. We're left with the impression that users love ArcPad 7.0, they are anxious to get their hands on the forthcoming 7.0.1 release and that we're focusing on the right features for 7.1. Over the coming weeks we will be *mashing* all the feedback and comments we got and tuning our development efforts.

We will also be publishing more information on this blog of the sorts of things we heard you wanted to see and hear about.

In our technical sessions we presented various application demonstrations, including an applet that can calculate a route using almost any polyline shapefile and various more advanced examples enabling your applications to access device capabilities such as email, text messages (SMS) and contact lists. These samples will be made available soon. We'll make the announcements via this blog as soon as they are ready for download.


Thank you to all that attended the conference, came to our sessions and visited the island.

Thursday, August 03, 2006

GeoCollector Field Data Collection Solution Now Available


The GeoCollector Series consists of ESRI's ArcPad software and Trimble's GPScorrect for ArcPad software preinstalled on a GeoExplorer 2005 series handheld. Users can also purchase Trimble's GPS Analyst extension to ArcGIS Desktop to complete the end-to-end GeoCollector workflow.

Full details.

Wednesday, August 02, 2006

ActiveSync 4.2

If you have not upgraded to ActiveSync 4.2 I highly recommend that you consider doing so. For some strange reason I could not sync my PC with a Windows Mobile 5 device using previous versions of ActiveSync. After upgrading to ActiveSync 4.2 I have no problems syncing with WM5 devices.
You can download ActiveSync 4.2 from here.

Tuesday, August 01, 2006

ArcPad Today Powertoy


The ArcPad Today Powertoy is a small, configurable Today Screen plug-in for Pocket PCs.

The powertoy allows you to have quick access to useful tools and monitor vital device status information from the Today screen of your Pocket PC.

  • Run ArcPad! - You can also specify ArcPad to start with different configuration files
  • Battery monitor - Displays how much power you have left

  • Program Memory Monitor - Displays how much free memory your device has for programs to run in

  • Storage Memory Monitor - Displays how much free space is available on your device and your storage card

  • Program Launcher - Configure the powertoy to run other applications installed on your device


Download it Today :-)

Wait there's more ...

- Send script code to ArcPad.
- Send application events to ArcPad.

All this and it's Free!!