BlueSpray - Help
© SchoonerTurtles, Inc. 2012-2015

Introduction
Contents
Getting Started
Download
Navigating
Tutorials
Scripting
Advanced
About

Packages

BlueSpray is divided up into a set of packages with related code in each package. When you open the scripting dialog BlueSpray inserts JavaScript code to load the packages that are commonly used. This web page contains an overview of the packages and the functions you will probably need the most.

Base

  • Base - this is the core framework of BlueSpray and almost all other classes are extensions of the classes found in this package.

Input and Output

  • Database - Allows access to SELECT, UPDATE, INSERT, and DELETE data in a database
  • File - provides the ability to load and save to files

Project Data

  • Project - The overall project classes including "Scenes", "Documents", "Tables", and "Scripts"
  • Scene - Handles organizing layers into scenes and includes classes for managing attributes of layers
  • Document - Provides classes to create and manage "documents" electronic versions of paper maps.
  • Table - Classes for working with tables both independently from layers and as attributes of layers
  • Script - Includes classes for editing and running scripts.

Data Handling and Processing

  • Symbol - Symbology for rendering including styles and patterns.
  • Vector - Vector data handling and processing.
  • Raster - Raster data handling and processing

Other Packages You May Want to Use

  • RefSystem - Coordinate reference system support including projections and datums
  • Chart - Package for creating various types of charts and graphs
  • Item
  • ThreeD
  • Utility - Utility classes for various system functions and mathematical operations.

Packages You Will Probably Never Need

  • App - Classes required to create an application within BlueSpray (not needed)
  • BlueSpray - Classes that create the user inteface for the BlueSpray application and it's applets.

Package: Base

Below are two of the main classes for other classes in BlueSpray. You will never need to create an object from one of these classes but you will probably create classes that inherit functions from them and you may wish to look at their available functions in more detail.

Class: Base

Base class for all BlueSpray objects and handles loading and saving objects from STX (SchoonTurtles XML) files.

Class: Content

Manages the project tree within BlueSpray to allow "child" objects to be added to most objects.

Package: Database

Class: SQL

If you are not famailiar with using a relational database we recommend you review our Introduction to Relational and Spatial Databases before continuing.

ODBC Functions - these functions provide

Static Function: ODBCQuery()

	boolean Abort=SQL.Execute(String Source,String Login,String Password,String Query,
			int XColumn,int YColumn,Layer TheLayer);

This function queries data into an existing layer object. The Source is the name of the ODBC "data source" with the login being the login to the data source (typically the administrative or user password used to access the database), and the password matches the login. The Query is a standard SQL SELECT, UPDATE, INSERT, or DELETE command. The XColumn and YColumn specify which field in the query will contain the X and Y elements of a point. These parameters are not used for lines and polygons.

	SQL TheConnection=new SQL();


	var TheConnection=new SQL();
	TheConnection.Open(...);
	var Abort=TheConnection.ODBCQuery(String Source,String Login,String Password,String Query);
	var TheGeometry=TheConnection.FectchGeometry();
	TheConnection.Close();

Note: add function to query a single geometry?

-

Package: File

Class: FileManager

The file manager provides individual static functions that make it easy to load and save data to most GIS, and typical PC, file formats.

Function: LoadFromFile();

boolean Abort=FileManager.LoadFromFile(String FilePath,Base TheObject,boolean RunAsynchronously);

The FilePath is a partial or complete file path to the location of the file. TheObject is the object you want to save and will usually be a Layer but can be of almost any class of object available in BlueSpray. BlueSpray allows processes that can take a long time, such as loading large raster images, to be run in the background. If you set the RunAsynchronously to "true" the SaveToFile() function will return right away and the file will be loaded asynchronously to the rest of your code. This is usually not desired as the data from the file will not be available until the file is completely loaded. For this reason, you'll typically want to specified RunAsynchronously as "false".

Function: SaveToFile();

boolean Abort=FileManager.SaveToFile(String FilePath,Base TheObject,boolean RunAsynchronously);

The FilePath is a partial or complete file path to the location of the file. TheObject is the object you want to save and will usually be a Layer but can be of almost any class of object available in BlueSpray.

Package: Scene

Class: Scene -

Class: Layer - base layer for all other layers

Class: LayerPoint -

var TheLayer=new LayerPoint();

 

Class: LayerVector -

Class: LayerGeometry -

Class: LayerRaster

Package: Document

Class: Document

Package: Table

Class: Table

Table Processes:

Class: Sort

Class: Calculate

 

Package: Script

Package: Raster

Class: Raster

The class for raster objects. These are the objects inside a LayerRaster. They can rpresent the contents of a TIFF, JPEG, GIF, or PNG file. The can be a regular photo, an aerial photo, or a satellite photo.

Raster Processes

Class: Crop

- Cut a raster out of raster

 Raster TheOutput=Crop.Crop(Raster TheInput,int X,int Y,int Width,int Height); 


LayerRaster TheOutput=Crop.Crop(LayerRaster TheInput,int X,int Y,int Width,int Height);
Raster TheInput=FileManager.LoadFromFile(...); 
 Raster TheOutput=Crop.Crop( TheInput,100,100,500,500);

 

Class: Pad

Add data to the top, bottom, and/or sides of a raster

Class: Tile

Cut a raster up into a grid of smaller tiles (perfect for creating tiles for web serving in web sites like GoogleMaps).

Class: DataType

Changes the type if samples in a raster from byte, to integers, to doubles.

Class: Histogram

Class: Paste

Class: Calculate - Mathematical operations

Package: Vector

Vector

Vector Processes

Geometry TheInput=Database query thing

Geoemetry TheOutput=Buffer.Buffer(TheInput,1);

 

LayerGeometry TheInput=Database query thing

LayerGeometry TheOutput=Buffer.Buffer(TheInput,1);

 

Package: Symbol