PocketGIS Connection Scheme's are stored in TSP files which are actually NTF level 5 files (NTF is a now obsolete British map data format).
The following provides sufficient detail for third parties to read, and possibly write, TSP files. It is assumed you have a TSP fie to look at or have created a one which represents what you want in PocketGIS Connection.
Each line of the file starts with a two character record number which determines what the record contains, and ends with a '%' character. Lines are no more than 80 characters long. '\' terminates variable length strings.
The first record is always 01:
01 Pocket Systems Ltd 2009012200000150200V%\0%
which contains the date the scheme was written and some NTF format data which is always the same as shown here.
90 is a comment record:
90PocketGIS Connection Settings Document0%
If a record continues past 80 characters then a '1' appears before the % (otherwise it's '0') and the continuation records start with '00', eg:
02OS MasterMap 8 PSTrnsSpec 19970307 1%
00OS MasterMap Topolog20000101 00000000000%
The first (fixed width) field of the 02 record contains the scheme name. The rest of the first line is always as shown here and the second line contains a database name and date which can be set to anything (the fields are fixed width).
The file ends with:
99PocketGIS Connection0%
Which contains a variable length string which names the program that wrote the file.
The remaining records are as follows and are best included in the order they appear in this document (for some records this is significant). Records are only required if there is relevant data present. Refer to PocketGIS Connection to determine what some of the settings are for.
54 - Map Definition
5400OS Mastermap_Moray 00%
The first value is:
0 - Read Only Map.
1 - Read / Write Map.
2 - Raster Map.
The second value is:
0 - don't download id's.
1 - download id's.
The third value is the map name in a 20 character fixed width field.
The fourth value is:
0 - Map extent can be increased by PocketGIS.
1 - Map extent cannot be increased.
52 - Copyright Statement
If required to be displayed on screen.
21© Crown copyright\0%
First value:
0 - Can be edited in Connection.
1 - Cannot be edited in Connection.
Second value:
Variable length string containing copyright statement.
53 - Data Details
530102100%
First value is the data units. The second value is the PocketGIS units. As in:
00 - Unknown.
01 - Metres.
02 - Centinmeters.
03 - Kilometres.
04 - Millimetres.
05 - Miles.
06 - Feet.
07 - Inches.
08 - Decimetres.
09 - Tenths of inches.
The third is:
0 - Cannot edit units.
1 - Can edit Units.
The fourth is not important.
74 - Password
A trivial password protection to prevent casual modification of the scheme in Connection.
Variable lenth string (ends with \).
59 - Specification Level Attributes
Rarely used.
61 - Table
610102Genus\0%
First value:
01 - Lookup table.
02 - Category Lookup table.
Second value:
01 - Numeric codes.
02 - Alphanumeric codes.
Third value:
Table name.
65 - Table Category
65Acacia spp\0%
Only value is the category.
62 - Numeric Table Entry
620000000001Value\0%
First value: the code, 10 character fixed width.
Second value: the value, variable length string.
(Optional) third value: the category, variable length string.
63 - Alphanumeric Table Entry
63Rhus spp\Rhus spp\0%
First value: the code, variable length string.
Second value: the value, variable length string.
(Optional) thrid value: the category, variable length string.
75 - Table Entry Bitmap
In BMP format.
56 - Layer
56Layer\10%
First value: layer name, variable length string.
Second value:
0 - Not downloadable.
1 - Downloadable.
57 - Layer Feature
List of features in layer.
57woodland\0%
One value: feature code (internal feature name), variable length string.
67 - Display Scheme
67RoadRail\0%
One value: the display scheme name.
68 - Display Scheme Range
68000000000000001000000%
One value: minimum scale, 20 charachter fixed width number.
69 - Range Feature Code
6910168\0%
One value: the code of a feature that is displayed in the range.
70 - Legend
70Buildings\0%
One value: the legend name.
71 - Legend Style
7110019\01040101010210100%
First value: the feature code, variable length string.
Contact us if you'd like to know the rest.
05 - Feature
050001 woodland Woodland\0%
First value: 4 char numeric feature code (internal to TSP file).
Second value: 10 char feature code (absent if 20 char code used).
Third value: 20 char feature code (absent if 10 char code used).
Fourth value: feature name, variable length string.
50 - Feature Type
5004010%
First value: Feature Type:
00 - Unknown.
01 - Line.
02 - Point.
03 - Text.
04 - Area.
05 - Raster Tile.
Second value:
0 - Undefined (can be changed in Connection).
1 - Defined
(cannot be changed in Connection).
Third value:
0 - Cannot be captured in PocketGIS.
1 - Can be captured in PocketGIS.
60 - Original Feature Code
One value, variable length string, used by Connection to restore original feature codes on export. Sometimes happens with DXF if, say, a line and point has the same code.
51 - Attribute
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
First value is attribute type:
01 - String.
02 - Integer (32 bit).
03 - Real.
04 - Date.
05 - Logical (Boolean).
06 - Time.
07 - Short integer (16 bit).
08 - Sketch.
09 - Picture (photo).
10 - Section Header.
11 - Long integer (64 bit).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
The second value is the field width (2 chars, 00 = variable).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
The third is decimal places (2 chars, 00 = not applicable).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Then some flags, 1 if flag set, 0 if not, in this order:
Manditory.
Read Only.
Visible.
Locked.
Has a default value.
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Next value is "Special Type":
00 - None.
01 - Font.
02 - Text Height.
03 - Orientation.
04 - Text Position.
05 - Text String.
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Then some more flags, 1 if flag set, 0 if not, in this order:
Fixed Width.
Should be downloaded.
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Next is the internal name, followed by the external (user visible) name, both variable length.
Following that is the default value if there is one. For string attributes this is a variable length string (ending with \). For integer attributes there is a fixed width number, the width being the field width (specified above). For real attributes there is a fixed width number, the width being the field width, no decimal point, but the number of decimal places is as given above.
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Has nil value (0 = no, 1 = yes) - if yes the nil value follows.
Has minimum value (0 = no, 1 = yes) - if yes the min value follows.
Has maximum value (0 = no, 1 = yes) - if yes the max value follows.
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Then some more flags, 1 if flag set, 0 if not, in this order:
Export Lookup Values.
Upload this value.
Remember
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Then the format id, variable length string, if not set then it's just the terminator '\'.
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Then the auto set value + 48 (single char).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
The field width (4 char numeric).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
The edit field width (4 char numeric).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
The number of lines (2 char numeric).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
The auto value:
00 - None.
01 - Area calculation.
02 - Length calculation.
03 - Auto increment.
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Next is the multi select flag (for lookup tables, 1 = on, 0 = off).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
If auto increment values are set then next up is the prefix (variable length)...
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
...followed by the starting value (10 char numeric).
51010000001000001genus\Genus\000010\00000000001000\0000000001000000%
Then some more flags, 1 if flag set, 0 if not, in this order:
Short Format.
Alpha Tab Popup.
Use Image Popup.
Use Image Values.
Allow new entries in lookup tables.
64 - Attribute Lookup Table
64Table Name\0%
The name of the lookup table for the preceeding attribute (51 record), variable length string.
55 - Orientation Attribute
550orientation\0%
First value:
0 - Don't snap to line.
1 - Do snap to line.
Second value:
The name of the orientation attibute, variable length string.
58 - Annotation Attribute
First value:
0 - Don't generate annotation points.
1 - Do generate annotation points.
Second value:
The name of the annotation attibute, variable length string.
66 - Dependent Attribute
First value:
The name of the attibute this applies to, variable length string.
Second value:
The name of the dependent attibute, variable length string.



Demo
