Spatial Data Modelling Language


SDML format is very simple text which provides for easy parsing and support for attribute information which is becoming more and more critical to analytic work (but generally unsupported in the general sense with most viewing/rendering systems today!). This makes the SDML suitable for CAD and GIS sources with and without attribute data. We do not intend this to be the end-all of spatial description languages but it works well for a wide variety of Landscape Planning, Design, and Architectural databases.

There are currently 2 accepted SDML formats, one being the original, the other the new version 1.0 standard:

Original [Old] SDML Format

The original is derived from the ASCII format used in CLRview and PolyTRIM software environments. Those with CLRview or PolyTRIM can directly utilize models saved in those environments with only minor adjustments. CLRview provides translators from DXF, SGO, Architrion, Arc/Info, MAPII, MacGIS, and other formats. Likewise, it is very simple to write direct converters to SDML format. For the original format, please refer to the Old SDML notes and CLR Raw Polygon Format notes. Currently URL extensions must be added manually or through the use of the addpolyurl Unix utility.

v1.0 SDML Format (February 5, 1995)

The new, v1.0 SDML format is a more detailed, capable, and size-optimized format that is now being used, supporting all of the features of CLRMosaic v1.00a4. The only current conversion route to SDML v1.0 is from the PolyTRIM software, v1.78 (Jan 31, 95) or later. This support will be added to the next release of CLRview, v2.0 when it is publicly released. Due to the limited nature of the pre-1.0 SDML file loader in CLRMosaic, v1.00a3 and previous versions of CLRMosaic will CRASH if given a v1.0 SDML file; this is unavoidable and natural in an Alpha release of the software - v1.00a4 is more robust and should avoid such crashes in the future as the format evolves. The following information describes the SDML v1.0 format as it exists now (Feb 5, 95) - it will likely change somewhat before the final release of CLRMosaic 1.00 but this will likely be in the form of additions, rather than changes to these tags.

Sample Structure:

  1. Version header: /* Version: 1.0
  2. Model title: title string
  3. Layer name: name layername
    • Terrain Identifier: terrain
    • Triggers: tigger over (indicates that the polygons are ones that when walked over, trigger corresponding URLs, vs clicking on them)
    • Texture to apply: texture type# URL
      type# is either '1' = apply texture individually on each poly or '2' = apply texture as sheet over all polys (aerial photos, etc.)
    • Geometry Points: vl #verts+1 followed by X Y Z sets (#verts of them)
    • Geometric Types:
      • Colour Specifier: col red grn blu [alp] (0.0-1.0 range)
      • Object URL Link: url URL
      • Geomatric Type: poly or line
        • Vertex Information: vi vertindex# vertindex# vertindex# ... (numbers from 0 to (#verts-1))
  4. Additional layers...

  5. View name: view viewname
    • Viewer Standing Point and Lookat Point: eye vx vy vz lx ly lz (an animation is a view with more than one 'eye')
    • Clipping Volume, Near & Far: clip near dist and clip far dist
    • Field of View Angle: fov angle
    • Speed of user movement in model: speed horiz dist and speed vert dist (as units moved in model when appropriate movement keys pressed)
    • Speed of user angular movement in model: speed rot angle and speed tilt angle (for head rotation [left/right] and tilt [up/down])
    • Override display for model geometry: display [individual|off|wire|solid|outline] (ALL layers are displayed with this setting or use their 'individual' settings)
    • Individual layer display setting: display [off|wire|solid|outline] layername (only works when override is individual)
    • displaymode [2D|3D] - 3D is assumed by default - 2D is only supported in v1.00a7 and later
  6. Additional views...

    The LAST view in the SDML file will be the default starting position of the viewer in the model


Example SDML v1.0 file
/* Version: 1.0

/* Created By: PolyTRIM v1.78
/* Created On: Thursday January 26 12:53:48
title Trigger Test Model, (c) 1995, CLR
name Pavillion
texture 1 /PEOPLE/RODNEY/tex1.rgb
vl 46
22.9 4.7 0
12.4 29.5 0
11.2 28.9 0
21.9 4.2 0
22.9 4.7 3
12.4 29.5 3
11.2 28.9 3
21.9 4.2 3
25 -2 0
23.9 -2.1 0
23.9 -5.4 0
9.9 -1.4 0
9.6 -2.5 0
25.3 -7.2 0
25 -2 3
23.9 -2.1 3
23.9 -5.4 3
9.9 -1.4 3
9.6 -2.5 3
25.3 -7.2 3
-3.1 1.8 0
-3.5 0.6 0
-21 6.1 0
-15.9 10.9 0
-15.2 10.1 0
-18.6 6.6 0
-3.1 1.8 3
-3.5 0.6 3
-21 6.1 3
-15.9 10.9 3
-15.2 10.1 3
-18.6 6.6 3
-11.8 15.3 0
-11 14.2 0
10 34.8 0
9.5 36.3 0
-11.8 15.3 3
-11 14.2 3
10 34.8 3
9.5 36.3 3
-20.8 6.1 3
6.6 14 15
9.6 36.3 3
22.9 4.6 3
25.2 -7.3 3
col 0.501961 0.501961 0.501961
poly
vi 0 1 2 3
poly
vi 4 5 6 7
poly
vi 0 1 5 4
poly
vi 1 2 6 5
poly
vi 2 3 7 6
poly
vi 3 0 4 7
poly
vi 8 9 10 11 12 13
poly
vi 14 15 16 17 18 19
poly
vi 8 9 15 14
poly
vi 9 10 16 15
poly
vi 10 11 17 16
poly
vi 11 12 18 17
poly
vi 12 13 19 18
poly
vi 13 8 14 19
poly
vi 20 21 22 23 24 25
poly
vi 26 27 28 29 30 31
poly
vi 20 21 27 26
poly
vi 21 22 28 27
poly
vi 22 23 29 28
poly
vi 23 24 30 29
poly
vi 24 25 31 30
poly
vi 25 20 26 31
poly
vi 32 33 34 35
poly
vi 36 37 38 39
poly
vi 32 33 37 36
poly
vi 33 34 38 37
poly
vi 34 35 39 38
poly
vi 35 32 36 39
poly
vi 40 41 42
poly
vi 42 43 41
poly
vi 43 44 41
poly
vi 44 41 40
/* THE FOLLOWING LAYER IS walk-over trigger layer,
/* any polygons in it are by default invisible but will
/* trigger associated URL's if they are walked over
name triggerlayer
trigger over
vl 58
1.65926e-28 3.28384e-29 0
12.4 29.5 0
11.2 28.9 0
21.9 4.2 0
22.9 4.7 3
12.4 29.5 3
11.2 28.9 3
21.9 4.2 3
25 -2 0
23.9 -2.1 0
23.9 -5.4 0
9.9 -1.4 0
9.6 -2.5 0
25.3 -7.2 0
25 -2 3
23.9 -2.1 3
23.9 -5.4 3
9.9 -1.4 3
9.6 -2.5 3
25.3 -7.2 3
-3.1 1.8 0
-3.5 0.6 0
-21 6.1 0
-15.9 10.9 0
-15.2 10.1 0
-18.6 6.6 0
-3.1 1.8 3
-3.5 0.6 3
-21 6.1 3
-15.9 10.9 3
-15.2 10.1 3
-18.6 6.6 3
-11.8 15.3 0
-11 14.2 0
10 34.8 0
9.5 36.3 0
-11.8 15.3 3
-11 14.2 3
10 34.8 3
9.5 36.3 3
-20.8 6.1 3
6.6 14 15
9.6 36.3 3
22.9 4.6 3
25.2 -7.3 3
9.98883 34.8517 0
5.55509 30.4565 0
7.32859 26.6396 0
12.4563 29.4541 0
22.9045 4.66367 0
18.4322 2.62029 0
20.0515 -2.04478 0
24.9479 -2.04478 0
-15.9197 10.9095 0
-11.7173 15.3047 0
-8.90279 11.1408 0
-12.8739 7.97935 0
defattrib URL CHAR
attribvalindex 3 URL
0 -16711681 "#sdmlref;view=eye1" 
1 -16733441 "/clr.html" 
2 -16776961 "/collab.html" 
col 0.501961 0.501961 0.501961
url #sdmlref;view=eye1
aindex 0
poly
vi 45 46 47 48
url /clr.html
aindex 1
poly
vi 49 50 51 52
url /collab.html
aindex 2
poly
vi 53 54 55 56
/* VIEWS DEFINED BELOW HERE
view eye1
eye 19.557 38.3385 1.7 -57.0474 -25.9403 1.7
/* Version: 1.0
view anim1
fov 60
speed horiz 2
speed vert 1
speed rot 5
speed tilt 2
display outline pavilion
display wire triggerlayer
display individual
eye 19.556992 38.338493 1.700000 -57.047440 -25.940254 1.700000
eye 18.599436 37.535011 1.700000 -58.004997 -26.743738 1.700000
eye 17.626919 36.718971 1.700000 -58.977516 -27.559776 1.700000
eye 16.624477 35.877823 1.700000 -59.979954 -28.400925 1.700000
eye 15.577151 34.999012 1.700000 -61.027283 -29.279736 1.700000
eye 14.469977 34.069984 1.700000 -62.134453 -30.208765 1.700000
eye 13.287994 33.078182 1.700000 -63.316437 -31.200565 1.700000
eye 12.016241 32.011055 1.700000 -64.588196 -32.267693 1.700000
eye 10.639755 30.856045 1.700000 -65.964676 -33.422703 1.700000
eye 9.143575 29.600599 1.700000 -67.460861 -34.678146 1.700000
eye 7.557624 28.269829 1.700000 -69.046814 -36.008919 1.700000
eye 5.911825 26.888840 1.700000 -70.692612 -37.389908 1.700000
eye 4.236103 25.482742 1.700000 -72.368332 -38.796005 1.700000
eye 2.560381 24.076645 1.700000 -74.044052 -40.202103 1.700000
eye 0.914582 22.695656 1.700000 -75.689850 -41.583092 1.700000
eye -0.671369 21.364885 1.700000 -77.275803 -42.913864 1.700000
eye -2.167550 20.109440 1.700000 -78.771988 -44.169308 1.700000
eye -3.544035 18.954432 1.700000 -80.148468 -45.324318 1.700000
eye -4.815789 17.887302 1.700000 -81.420227 -46.391445 1.700000
eye -5.997771 16.895502 1.700000 -82.602203 -47.383247 1.700000
eye -7.104945 15.966473 1.700000 -83.709381 -48.312275 1.700000
eye -8.152271 15.087662 1.700000 -84.756706 -49.191086 1.700000
eye -9.154713 14.246514 1.700000 -85.759148 -50.032234 1.700000
eye -10.127230 13.430475 1.700000 -86.731667 -50.848274 1.700000
eye -11.084785 12.626991 1.700000 -87.689224 -51.651756 1.700000
eye -12.042341 11.823507 1.700000 -88.646782 -52.455238 1.700000
eye -13.074706 10.957251 1.700000 -89.352516 -53.113411 1.700000
eye -14.256689 9.965448 1.700000 -89.554604 -53.480949 1.700000
eye -15.663099 8.785331 1.700000 -89.001221 -53.412544 1.700000
eye -17.368744 7.354124 1.700000 -87.440559 -52.762878 1.700000
eye -19.448437 5.609056 1.700000 -84.620781 -51.386642 1.700000
eye -21.976982 3.487355 1.700000 -80.290070 -49.138515 1.700000
eye -25.029190 0.926248 1.700000 -74.196602 -45.873184 1.700000
eye -28.679871 -2.137036 1.700000 -66.088554 -41.445335 1.700000
eye -32.711342 -5.539637 1.709766 -56.401512 -36.108280 1.709766
eye -36.905914 -9.118692 1.739063 -45.571045 -30.115330 1.739063
eye -41.045906 -12.711340 1.797656 -34.032738 -23.719799 1.797656
eye -44.913639 -16.154720 1.895312 -22.222168 -17.175001 1.895312
eye -48.291424 -19.285969 2.041797 -10.574915 -10.734245 2.041797
eye -50.961578 -21.942225 2.246875 0.473444 -4.650846 2.246875
eye -52.706417 -23.960627 2.520312 10.487331 0.821887 2.520312
eye -53.308258 -25.178312 2.871875 19.031168 5.430638 2.871875
eye -52.927673 -25.703627 3.301562 26.243610 9.318153 3.301562
eye -51.725243 -25.644913 3.809375 32.263321 12.627179 3.809375
eye -49.861546 -25.110514 4.395312 37.228962 15.500459 4.395312
eye -47.497154 -24.208775 5.059375 41.279190 18.080738 5.059375
eye -44.792645 -23.048038 5.801562 44.552670 20.510763 5.801562
eye -41.908592 -21.736649 6.621875 47.188057 22.933279 6.621875
eye -39.005573 -20.382950 7.520312 49.324009 25.491030 7.520312
eye -36.244167 -19.095285 8.496876 51.099190 28.326759 8.496876
eye -33.567265 -17.819136 9.522266 52.315010 31.190565 9.461911
eye -30.917755 -16.499985 10.567188 52.772881 33.832539 10.325768
eye -28.238533 -15.083315 11.602345 52.274223 36.002769 10.998796
eye -25.472492 -13.514606 12.598438 50.620445 37.451355 11.391340
eye -22.562523 -11.739343 13.526173 47.612961 37.928387 11.413752
eye -19.451519 -9.703005 14.356251 43.053185 37.183960 10.976377
eye -16.082371 -7.351076 15.059376 36.742523 34.968163 9.989565
eye -12.397971 -4.629037 15.606251 28.482397 31.031096 8.363665
eye -8.569878 -1.603713 15.987110 18.938179 25.701744 6.263158
eye -4.769648 1.658072 16.192188 8.775248 19.309101 3.852527
eye -1.168837 5.089493 16.211720 -1.341020 12.182156 1.296256
eye 2.060997 8.623726 16.035938 -10.745247 4.649900 -1.241174
eye 4.748297 12.193946 15.655079 -18.772055 -2.958675 -3.595280
eye 6.721506 15.733329 15.059376 -24.756067 -10.314580 -5.601578
eye 7.809067 19.175051 14.239063 -28.031906 -17.088823 -7.095586
eye 7.839424 22.452286 13.184376 -27.934195 -22.952415 -7.912821
eye 6.944727 25.585594 11.924610 -24.884626 -28.019186 -8.137880
eye 5.257127 28.595539 10.489063 -19.304893 -32.402969 -7.855361
eye 2.908773 31.502682 8.907032 -11.616693 -36.217590 -7.149858
eye 0.031817 34.327579 7.207813 -2.241718 -39.576889 -6.105968
eye -3.241590 37.090797 5.420704 8.398339 -42.594696 -4.808290
eye -6.779299 39.812889 3.575001 19.881784 -45.384834 -3.341418
eye -10.449158 42.514423 1.700001 31.786922 -48.061146 -1.789949

NOTES from CLR File Formats on the more extended format, NOT currently supported by CLRMosaic but it will be in the future. This includes arbitrary attribute data as defined and used in CLRview and PolyTRIM software.

Raw polygon format consists of a descriptor for each polygonal surface and an optional colour specification for it. A sample polygon file would look like this:

col 0.5 0.5 0.5
poly
v 0 0 0
v 0 12.5 1.5
v 12.5 12.5 1.5
v 12.5 0 0
col 1.0 0.0 0.0
poly
v 0 0 0
v 0 -12.5 -1.5
v 12.5 -12.5 -1.5
v 12.5 0 0

This file contains two polygons, the first one a medium grey polygon, and the second, a red polygon.

col [red] [green] [blue]

is the specifier to change the colour used for any polygons which come AFTER it, until the next colour specifier. If you have three polygons in a row which are all grey, you need not put the col specifier before each, only when it changes.

poly
v [x] [y] [z]
v [x] [y] [z]
etc...

This is a polygon description. The word 'poly' on a newline tells the loader that we are beginning a new polygon. The verticies for that polygon follow it, to a maximum of 256 (a limit of IRIS GL, polygons with more than 256 verticies will be rendered with unknown results).

NOTES:
You must have a 'poly', 'col', or 'v' as the FIRST character on the new line, no spaces are allowed. It is advisable to use only one space between parameters (x,y,z or red,green,blue). Lower case descriptions only are allowed.

Numbers for coordinates should be no more than 7 digits of accuracy (ie. 99,999.99 or 9,999.999 - 99,999,999.0 would be truncated to 99,999,990.0). Please keep this in mind especially if you are working in UTM coordinates. This is due to the fact that IRIS GL (Graphics Language) only transforms in single precision numeric range (even if you pass double-precision)

You may put comments into your polygon files by starting a newline with the sequence

/* Comment here, please leave one space at least after the *

Attribute Extensions:

The Raw Polygon format has been extended to support attributes in the following way:

At the beginning of the file, before ANY geometry, the attributes used for the polygons must be defined as follows

defattrib ATTRIBNAME ATTRIBTYPE

Where ATTRIBNAME is whatever name you wish for the attribute without any spaces, and ATTRIBTYPE is one of CHAR (for strings), INT, and FLOAT. You MUST type these in upper case!

Furthermore, before a polygon's geometry is defined, its attributes must be specified in the exact order they where defined at the beginning of the file, using the following format

attrib "John-Smith" 23 "Southham Blvd." NA NA "blue"

This example assumes that you have used 'defattrib' to define 6 attributes for this file. Values for an attribute can be enclosed in quotes (and must be for strings with spaces), or left without quotes in the case of numbers. The NA attribute value is a special one, indicating that there is no information for that attribute for this polygon. Quotes cannot be used around an NA value.