OLD Spatial Data Modelling Language


The SDML is currently only an extension of our common file format (documentation coming online soon). This 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. The CLRview software provides translators from many GIS and CAD sources into the basic SDML format. Currently URL extensions must be added manually but the attribute mechanisms in the next CLRview release will directly support them.

Sample:

/* Created by: CLRview v1.50
/* Created on: July 5, 1994
/* any comments can be included on lines beginning with '/*'
title This is the Document Title

col 1 1 1
/* col is the specifier for COLOUR, as red green and blue, each with
/* values between 0.0 and 1.0 (1 1 1 is white, 0 0 0 is black)

url http://xxx
/* url is the specifier for the URL that the NEXT (and ONLY NEXT)
/* polygon will be able to activate.  You MUST include it BEFORE
/* each poly definition in a complex object

poly
/* poly indicates the start of a polygon description
/* it will inherit all of the specs laid out before it (col, url)
/* v indicates a vertex with the X, Y, and Z coming afterwards

v -1 -1 0
v -1 1 0
v 1 1 0
v 1 -1 0

eye 480.51 212.106 131.7 383.48 212.106 107.508
/* the starting viewer and lookat position vx,vy,vz and lx,ly,lz
/* these numbers are in whatever units the model is in

NEW ADDITIONS FROM v1.00a2

/* sets the starting display setting for this model
display off
display wire
display solid
display outline

/* sets the starting clipping planes for this model
/* these numbers are in whatever units the model is in
clip near 1.0
clip far 5000.0

/* sets the starting movement increments for this model
/* when you move or turn around 
/* these numbers are in whatever units the model is in

/* horizontal - forwards, backwards, left, right
speed horiz 10.0

/* vertical - up, down
speed vert 5.0

/* rotation - turn left, turn right
speed rot 5.0

/* tilt - tilt up, tilt down
speed tilt 2.0

NEW ADDITIONS FROM v1.00a3

/* Field-of-view Cone angle
fov 60.0

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 decription. 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.