DbShell

OpenSource database toolkit using XAML for describing jobs

User Tools

Site Tools


Sidebar

DbShell

DbMouse

DbMouse is database GUI, which has support for DbShell. It could be used as DbShell console.

gps_visualisation

GeoSQL

GeoSQL is syntax, how to write SQL, which can be shown in map.

Columns Reference

Following columns of result-set are recognized:

  • Latitude - latitude of point
  • Longitude - longitude of point
  • Type - type of geometry object (one of Points, Linestring, Polygon)
  • Object - object ID. Rows with the same [Object] value are grouped together into one geometric object
  • Foreground - foreground color (use HTML syntax, eg' Red', 'Blue', '#FFCC00')
  • Background - background color (use HTML syntax, eg' Red', 'Blue', '#FFCC00')
  • Geopraphy - WKT geography data (usualy in column with SQL type Geography)
  • ForegroundKey - key of foreground color. Objects with the some ForegroundKey foreground will have the some foreground.
  • BackgroundKey - key of background color. Objects with the some ForegroundKey foreground will have the
  • Marker - marker, which will be used to visualise points. One of Circle, Square, Diamond, Triangle, Cross, Plus, Star
  • LineStyle - the style of the stroke.. One of Solid, Dash, Dot, DashDot. Or custom value like 3,3 for dash, 1,1 for dot (see below)
  • LineWidth - width of the stroke in pixels
  • MarkerSize - size of the marker in pixels

LineStyle custom values

Each number in the collection specifies the length of a dash or gap relative to the Thickness of the pen. For example, a value of 1 creates a dash or gap that has the same length as the thickness of the pen (a square).

The first item in the collection, which is located at index 0, specifies the length of a dash; the second item, which is located at index 1, specifies the length of a gap.

Objects with an even index value specify dashes; objects with an odd index value specify gaps.

Options Reference

You can also set option for all following SQL commands. The meaning of values is the some as in columsn reference. Following options can be set:

  • SetType
  • SetMarker
  • SetLineStyle
  • SetObject
  • SetForeground
  • SetBackground
  • SetLineWidth
  • SetMarkerSize

There are special options for setting colors available to ForegroundKey and BackgroundKey columns.

  • SetForegrounds
  • SetBackgrounds

Examples

Show point at coordinates <50,15>:

SELECT 50 AS Latitude, 15 AS Longitude, 'Middle' AS Description

Change style of point, using setting default values

SELECT 'green' AS SetBackground
SELECT 'triangle' AS SetMarker
SELECT 50 AS Latitude, 15 AS Longitude

Change style of point, using columns

SELECT 50 AS Latitude, 15 AS Longitude, 10 AS MarkerSize

Draws polygon with points

DECLARE @tbl TABLE (Latitude FLOAT, Longitude FLOAT, NUMBER INT);
INSERT INTO @tbl (Latitude, Longitude, NUMBER) VALUES (50, 15, 0);
INSERT INTO @tbl (Latitude, Longitude, NUMBER) VALUES (50.5, 15, 1);
INSERT INTO @tbl (Latitude, Longitude, NUMBER) VALUES (50.5, 16, 2);
 
-- draw polygon
SELECT 'polygon' AS SetType
SELECT * FROM @tbl ORDER BY NUMBER;
 
-- draw points
SELECT 'points' AS SetType
SELECT *, 'star' AS Marker  FROM @tbl ORDER BY NUMBER;

Draw two lines using Object and ForegroundKey features

DECLARE @tbl TABLE (Latitude FLOAT, Longitude FLOAT, NUMBER INT, Shape VARCHAR(100));
INSERT INTO @tbl (Latitude, Longitude, NUMBER, Shape) VALUES (50, 15, 0, 'line1');
INSERT INTO @tbl (Latitude, Longitude, NUMBER, Shape) VALUES (50.1, 15, 1, 'line1');
INSERT INTO @tbl (Latitude, Longitude, NUMBER, Shape) VALUES (50.2, 15.1, 2, 'line1');
INSERT INTO @tbl (Latitude, Longitude, NUMBER, Shape) VALUES (50, 15.2, 0, 'line2');
INSERT INTO @tbl (Latitude, Longitude, NUMBER, Shape) VALUES (50.1, 15.2, 1, 'line2');
INSERT INTO @tbl (Latitude, Longitude, NUMBER, Shape) VALUES (50.2, 15.3, 2, 'line2');
 
-- draw stroke
SELECT 'linestring' AS SetType
SELECT 
    Latitude, 
    Longitude, 
    Shape AS Object, 
    Shape AS ForegroundKey, 
    3 AS LineWidth  
FROM @tbl ORDER BY NUMBER;

gps_visualisation.txt · Last modified: 2014/09/20 10:53 by admin