Lightspeed: Displaying dynamic data on a map and timeline

Preview

 

Lightspeed: Lidar visualization

Preview

 

Lightspeed: Decoding multiple format data

Preview

 

Lightspeed: Editing geometric shapes

Preview

 

(no preview)

Encoding GeoJson  samples.encoder.geojson.Main

This is a command-line sample. Click More info for run instructions.

This command-line tool demonstrates how to decode vector data in various formats and export them as a GeoJson file.

Run the sample using the shell script in the samples folder:

encoder.geojson.bat <input_vector_data> <output_geojson>

The input consists of two parameters: (1) the path to the input vector file (for example, in SHP format), and (2), the path of the output GeoJson file.

 


(no preview)

Encoding MIF  samples.encoder.mif.Main

This is a command-line sample. Click More info for run instructions.

This command-line tool demonstrates how to decode vector data in various formats and export them as a MIF file.

Run the sample using the shell script in the samples folder:

encoder.mif.bat <input_vector_data> <output_mif>

The input consists of two parameters: (1) the path to the input vector file (for example, in SHP format), and (2), the path of the output MIF file.

 


(no preview)

Encoding GeoTIFF  samples.encoder.raster.geotiff.Main

This is a command-line sample. Click More info for run instructions.

This command-line tool demonstrates how to decode rasters in various format and encode them in GeoTIFF format, using a TLcdGeoTIFFModelEncoder.

Run the sample using the shell script in the samples folder:

encoder.raster.geotiff.bat [options] <input_raster> [...] <output_geotiff>

The input can be a single raster or a list of rasters that lie on a regular grid. The sample automatically figures out the structure of the grid and creates a composite raster that can be saved. The code may be generally useful for creating such composite rasters. They are more efficient to work with than the original unstructured list of rasters, for instance for analysis or for visualization.

The output GeoTIFFs are tiled and multi-leveled, and optionally compressed with JPEG compression. The default tile size is 256x256 pixels. The default number of levels is 5. The JPEG compression quality is a specified value between 0 and 1.

The supported options are:

-levels   <n>
-tilesize <n>
-jpeg     <f>
-bigtiff

 


Preview

GXY: Balloon  samples.gxy.balloon.MainPanel

This sample demonstrates how to create your own balloons. Just click any of the domain objects to see an example of a balloon in action. Of the 4 domain objects 3 have a balloon attached to them.

Instructions

This sample demonstrates how to create your own balloons. Select a domain object to see an example of a balloon in action. Balloons are only shown when one domain object is selected.

One of the objects contains a balloon with a button that can be used to close itself. Another balloon shows an image, and another one shows a text label. The last domain object doesn't have a balloon attached to it.

You can move around balloons by dragging near their border. Balloons can be rescaled by dragging their lower right corner. The can also be closed by clicking the exit icon in the upper right corner.

   


Preview

Map raster values to colors  samples.gxy.colormap.MainPanel

This sample shows you how to map raster data values to colors using TLcdColorMap, and how to interactively customize such a map using TLcdColorMapCustomizer.

The sample shows elevation data that can be customized using the configuration panel.

Instructions

The color map customizer allows configuring the following:

  • change the altitudes by clicking on them
  • change the colors by clicking on the colored rectangles
  • enable or disable gradient coloring
  • enable or disable the linear scale
  • in linear scale mode, drag the arrows around with the mouse
  • add, remove, or re-initialize levels using the toolbar buttons
You can apply a master transparency, or change the transparency of each individual color.

   


Preview

GXY: Asynchronous layer painting  samples.gxy.concurrent.painting.MainPanel

This sample demonstrates the ability to paint asynchronously. It shows how to instantiate an asynchronously painted layer and a paint queue that handles the actual painting. The layer is then painted in the background, in a separate thread, so the painting no longer blocks the user interface.

It also illustrates how to automatically assign paint queues to the asynchronous layers by using several paint queue managers which can be activated one-by-one:

  • The default paint queue manager, minimizing the number of paint queues.
  • A paint queue manager based on the paint times of the layers. The layers will only share a paint queue if their average painting times are of the same magnitude.
  • A paint queue manager using a fixed number of paint queue instances. The default number of paint queues is determined by the number of CPUs.

The sample shows a number of layers that are painted asynchronously. Layers sharing a paint queue have the same color in the layer control. For illustration purposes, some layers have a fixed paint time, which is indicated in between square brackets.

Instructions

Try panning and zooming with the mouse wheel. New layer contents are added after the operations. The layer control coloring shows which layers use the same paint queue. Switch the paint manager, and notice how the paint queue assignments change. The synchronous layers (in black) and the unmanaged layer stay the same.

The Translucent checkbox to the right on the map renders all content with a translucency of 0.5. This demonstrates how to modify the state of the wrapped layer.

   


Preview

GXY: Contours  samples.gxy.contour.MainPanel

This sample demonstrates how to calculate and visualize terrain contours as polylines and complex polygons.

Instructions

Four different contour layers are available:

  • labeled polyline contours
  • polyline contours with the altitude in the line style
  • polygon contours that contain each other
  • disjoint polygon contours
The contour layers use vector data instead of raster data to render the terrain. The contour layers may look very similar to the original raster layer, to view the difference it may be required to zoom in or make the raster layer invisible.

   


Preview

GXY: Decoding multiple format data  samples.gxy.decoder.MainPanel

This sample demonstrates the ability to load and visualize data from sources in different formats by making use of ILcdModelDecoder and ILcdGXYLayerFactory.

A File and a URL action are configured to load data in almost every available format.

The sample uses a composite ILcdModelDecoder to decode the data into an ILcdModel. After this, a composite ILcdGXYLayerFactory creates a layer that controls how the ILcdModel of the loaded data is displayed. The model decoders and layer factories are retrieved using a service look-up mechanism, and contain both built-in and sample implementations.

The sample supports images that are not georeferenced if the images are described in a small *.rst meta-file (see TLcdRasterModelDecoder). The sample also includes a custom format (see the package samples.decoder.custom1) to show how to implement your own model decoder.

A save action, only available when the sample is run standalone, allows you to save an ILcdModel to its file if an ILcdModelEncoder is set to the ILcdModel. Currently this is only done for the custom format.

Instructions

Open a file or URL by clicking the appropriate toolbar button or by dragging a file or URL onto the map. Load Washington DC spot satellite image ( .rst format ) and Washington DC streets ( .shp format ) and notice how the data overlap. Load mixed.txt, edit the shapes and save the model (only when run standalone).

   


Preview

GXY: Displaying element densities  samples.gxy.density.MainPanel

This sample demonstrates how to display color-coded densities of data, by means of a TLcdGXYDensityLayer.

The applet shows a set of flight trajectories above USA, with colors ranging from blue, for quiet regions, to bright white, for busy regions.

Instructions

Pan and zoom around. Notice that asynchronous painting ensures that the view stays responsive.

   


Preview

GXY: Editing geometric shapes  samples.gxy.editing.MainPanel

This sample demonstrates how to interactively create and edit ILcdShape objects in an ILcdGXYView.

The toolbar contains buttons that create several shapes, by using different instances of the TLcdGXYNewController2 controller. Each controller has its own controller model, defining the type of shape to create, in which ILcdGXYLayer to add it and how to add it.

The layers provide the necessary ILcdGXYPainter and ILcdGXYEditor instances to properly render, create and edit any ILcdShape it contains.

Next to this, the panel at the right has the following configuration options:

  • Rendering can be simplified by using straight lines (a pen setting)
  • The shape outline/fill can be changed (a painter setting)
  • New shapes can be defined in a geodetic (lon lat) reference, or a grid reference. Note that rhumb shapes cannot be defined in a grid reference.
  • The sub-curve type of composite curves can be changed, even while creating the curve.

Instructions

  • Click one of the new shape buttons in the toolbar and click on the map to create a new shape. For composite curves, you can start a new subcurve by selecting a shape in the drop down box.
  • Edit a shape in one of the shape layers by dragging one of its points or segments. Notice how Geodetic shapes stay within their model reference (e.g. the earth) and wrap over the dateline, whereas Grid shapes are not bound by lon-lat coordinates.
  • Using the CTRL (CMD on Mac OS) key, you can reshape objects. For example, for polylines and polygons, it allows you to add or remove points.
  • Right-click on a point, polyline, or polygon and convert them into a buffer.
  • Notice how very long geodetic and rhumb lines are not necessarily straight.

   


Preview

GXY: Editing with multiple modes  samples.gxy.editmodes.MainPanel

This sample shows how to implement a multi-mode edit controller i.e. a controller that changes its state when you click on an already selected object. The controller is used in a painter/editor wrapper to change the painter/editor, allowing different editing behavior.

The controller supports 2 modes:

  • DEFAULT: the default mode indicating the controller's standard behavior.
  • ROTATION: the rotation mode of the controller.

To add the rotation behavior, a support class defines a number of abstract methods that need to be implemented for a specific shape:

  • a method returning an object's current rotation
  • a method returning the rotation center of an object
  • a method that rotates an object

Instructions

The sample shows two polygons that can be rotated in their respective model references. To activate the rotation mode, select an object, and click once more on the object. Rotate the shape by grabbing and dragging one of the rotation handles. Click again on the object to cycle through the available modes. Click on a previously unselected object to reset the editing mode.

   


Preview

GXY: Geoid  samples.gxy.geoid.MainPanel

This sample illustrates support in LuciadLightspeed for geoids. It shows an image containing the geoid heights of the EGM2008 datum (Earth Gravity Model, 2008). Blue colors indicate that the geoid heights are negative (geoid below the ellipsoid of the WGS84 datum). Green colors indicate that the geoid heights are positive (geoid above the ellipsoid).

The geoid heights are also displayed in a label on the toolbar.

Geoid heights are typically used behind the screens, in calculations with references that have geodetic datums based on geoids. They are relevant for elevation data, for instance, which are commonly defined with respect to a few standardized geoid models. For accurate computations, elevations above a geoid can then be transformed to elevations above an ellipsoid.

Instructions

Move the mouse and see how the geoid height changes.

   


Preview

GXY: Grids  samples.gxy.grid.MainPanel

This sample demonstrates how to display grid layers in a GXY view.

The following grid layers are included:

  • Lon Lat: a simple multi-level grid showing longitude and latitude lines. The lines are refined up to the second.
  • Border: a maritime-style lon lat border grid. The coordinates are refined up to the degree.
  • Georef: an alphanumeric multi-level grid based on longitude latitude lines. The lines are refined up to the degree. The labels denote 1-by-1 degree squares.
  • XY: a grid based on an ILcdXYWorldReference. The labels denote meters.
  • OSGR: sample implementation of a multi-level alphanumeric grid system. OSGR is only defined for the United Kingdom, and offers two levels.

Instructions

  • Select a grid type and an appropriate projection
  • Pan and zoom around. Notice how the grid and its labels adapt.

   


Preview

Height  samples.gxy.height.MainPanel

This sample illustrates the use of height providers in LuciadLightspeed. It shows a raster containing height data. The height values of the data under the mouse cursor are displayed in a label on the toolbar.

The sample uses a view height provider to retrieve height values.

Instructions

Move the mouse over the raster and see how the height values change. Moving the mouse outside the raster will indicate that no height data could be found.

   


Preview

GXY: Highlighting domain objects  samples.gxy.highlight.MainPanel

This sample demonstrates how to highlight domain objects. A custom controller looks at the domain objects under the mouse cursor and informs the relevant layer that an object should be highlighted.

Instructions

Hover above the cities and states. The city or state under the mouse will change color.

   


Preview

GXY: A painter/editor implementation  samples.gxy.hippodromePainter.MainPanel

This sample contains an implementation of the ILcdGXYPainter and ILcdGXYEditor interfaces for a new shape, a hippodrome, which consists of two half circles connected by two lines. Instead of using composition this sample demonstrates how to create a painter/editor from scratch.

Note that this is sample code to demonstrate writing painters. If you need to model a hippodrome, please refer to our ILcdGeoBuffer implementations.

The shape is defined by two points and a width. An XY and a lonlat shape is provided both of which can be handled by the painter/editor taking into account some precaution for the geodetic shape.

The painter supports painting in the following modes:

  • painting the object in default and selected mode,
  • painting the object while it is being edited,
  • painting the object while it is being created.
The editor is conceived to support the following operations on the shape:
  • moving one of the defining points which results in a rotation, elongation of the shape,
  • moving the whole shape,
  • changing the width of the shape.

Instructions

This sample is mainly intended as a developer's guide to construct painters and editors from scratch. To create a new hippodrome, click on either of the two buttons in the toolbar. To edit a hippodrome,

  • move one of the points by dragging the mouse starting from a point,
  • move the whole shape by dragging the mouse starting from the outline,
  • change the width of the shape by dragging the mouse starting from the outline with the CTRL (CMD on Mac OS) key down.

   


Preview

GXY: Basic icons  samples.gxy.icons.MainPanel

This sample demonstrates LuciadLightspeed's abilities to display icons. These icons, painted by a TLcdGXYIconPainter can be scaled using a world or pixel scaling mode. They can also return an anchor point, which gives them an offset. The sample also demonstrates oriented icons.

Instructions

You can dynamically change the scale and scale mode by using the controls in the 'Icon scaling options' panel. The pin icons represent cities. Notice how the tip of the pin is anchored to the city. Notice how every airplane has a different rotation: the rotation is automatically retrieved from the domain object.

   


Preview

GXY: Create Labeling Algorithm  samples.gxy.labels.createalgorithm.MainPanel

This sample demonstrates the creation and usage of labeling algorithms and labeling algorithm wrappers. MyLabelingAlgorithm is a labeling algorithm that tries to place all labels on the domain object's anchor point. There are three wrappers that can be combined with this algorithm and each other.

  • RotationAlgorithmWrapper : Rotates all labels
  • MorePositionsAlgorithmWrapper : Creates extra label placements to be tried by offsetting the label by a few pixels in each direction.
  • LabelDetailAlgorithmWrapper : Adjusts the size of the font and amount of information to create more label placement possibilities.

Instructions

After starting the sample, it is possible to choose between two labeling algorithms: The sample algorithm SampleLabelingAlgorithm and a default labeling algorithm. Use the check boxes to enable/disable using more possible positions or changing the font size during labeling. Also moving the slider adjusts the rotation of all labels.

   


Preview

GXY: Interactive labels  samples.gxy.labels.interactive.MainPanel

This sample demonstrates how labels can be made interactive. The labels can be edited in the sense that they can be moved to a new location, as well as in the sense that they offer the user an interactive component that can be used to edit information related to the domain objects.

Instructions

Move the mouse over a label of a city. An interactive, editable label will be shown instead of the regular label. You can enter a comment for the labeled city in the text field. To apply the changes, press the Enter key or press the green tick mark at the top of the interactive label. To cancel the outstanding changes, press the red 'cancel' icon at the top of the label or press the Escape key.

The interactive label can be moved by clicking and dragging on the title bar of the interactive label.

   


Preview

GXY: Offset icons  samples.gxy.labels.offset.MainPanel

This sample demonstrates LuciadLightspeed's abilities to display icons at a certain offset. These icons, painted by a regular ILcdGXYPainter, are offset with respect to the domain object. This offset can be dynamically changed using the mouse.

It also shows how the used labeling algorithm can be configured to drop labels together.

Instructions

You can dynamically change the offset of the icon by selecting a city, and then dragging the icon while keeping the 'Control' button pressed.

   


Preview

GXY: Basic Labeling  samples.gxy.labels.placement.MainPanel

This sample demonstrates the asynchronous label placer and the default labeling algorithms.

Labeling algorithms take into account the labels that are already placed to avoid overlap. An ILcdGXYLayer will therefore most likely have less labels painted when it is at the bottom than when it is at the top of the ILcdGXYView.

Instructions

To see the effects of the labeling algorithms select a layer, by clicking it in the layer control and:

  • change the layer's visibility
  • set the layer labeled/not labeled
  • move the layer up/down
Zooming in/out will also have an effect on the labeling as less or more objects can be labeled.

   


Preview

GXY: Street Labeling  samples.gxy.labels.streets.MainPanel

This sample demonstrates LuciadLightspeed's abilities to paint and label streets. Highways are labeled using an icon, while city streets (zoom in on Washington DC) are labeled using text labels.

Instructions

Zoom in and out to see multiple levels of detail on the map. The USA region contains highway data, and the Washington DC region contains streets data.

   


Preview

Magnetic north  samples.gxy.magneticnorth.MainPanel

This sample shows you LuciadLightspeed's capabilities regarding the magnetic north.

The magnetic north does not coincide with the true north. The difference between the magnetic and true north is called magnetic declination and depends on your position in space and time. There are different mathematical models to calculate and predict the magnetic north, each with their own lifespan. LuciadLightspeed comes with the two most popular models: WMM and IGRF.

The sample shows a compass control for the magnetic north, and iso lines of constant magnetic north declination.

Instructions

Click on any place on the map to center on that point and rotate the map so that the top points towards the magnetic north. Notice that the magnetic north compass will point straight up. Right-click to reset the custom rotation again. Zoom in on a magnetic declination line. The readout at the bottom of the map shows the exact declination value for the mouse location. The magnetic value at the center of the map should be the difference between both compasses.

   


Preview

GXY: On Map Navigation Controls  samples.gxy.navigationcontrols.MainPanel

This sample demonstrates how to create, customize, add on map navigation controls over a 2D view.

Instructions

The default controls are in the top right corner when you run the sample. Drag the outer ring of the upper part to rotate the view (you can hold down the CTRL (CMD on Mac OS) button to constrain rotation to multiples of 15 degrees). Click on the North symbol of the outer ring to return the view to the original rotation. Press and hold anywhere in the circle with the hand symbol to pan the view. The lower part allows you to zoom in and out.

On the left you can find a customized configuration. In the alternative configuration, the controls are split and the two sub-components are added in different places. Furthermore, the zoom component is now always emphasized, not only when the mouse is over it and the compass component can be relocated by dragging it with the right mouse button pressed.

   


(no preview)

GXY: Offscreen view  samples.gxy.offscreen.Main

This is a command-line sample. Click More info for run instructions.

This command-line tool demonstrates how to create an off-screen view, display some decoded data in it, and save the result as a GeoTIFF file.

Run the sample using the shell script in the samples folder:

gxy.offscreen.bat <input_file> <output_geotiff>

The input data can be in a variety of formats: SHP, MIF, MAP, GeoTIFF, etc. The output GeoTIFFs are 1024x1024 pixels, tiled (256x256 pixels) and multi-leveled (3 levels), and compressed with a lossless compression scheme. All of these settings can be changed in the sample code.

 


Preview

GXY: Overview map  samples.gxy.overview.MainPanel

This sample demonstrates the use of a TLcdGXYOverviewController and the sharing of layers between multiple ILcdGXYView objects.

It consists of one main ILcdGXYView (TLcdMapJPanel) in the center and an overview map (TLcdMapJPanel) in the top right. The overview map remains focused on the USA and also displays a Rectangle that corresponds as much as possible to the area visible in the main view. Dragging the Rectangle in the overview or creating a new one makes the main view display data that are in the Rectangle. This Rectangle is updated each time the visible area in the main view changes (e.g. when panning or zooming). The overview displays the same ILcdModels using the same ILcdGXYLayers used in the main view.

Since an ILcdGXYView automatically listens to any property change of its ILcdGXYLayer objects, any change of those properties via the layer control will show in both views.

Instructions

Drag the Rectangle in the overview or create a new one. Pan and zoom in the main view: the Rectangle overview will update itself automatically. Remove a layer and notice that it is removed from both views.

   


Preview

GXY: Painter styles  samples.gxy.painterstyles.MainPanel

This sample shows how to paint polylines and polygons with rounded corners and how to change the stroke and fill style.

The functionality to paint a polyline or polygon with rounded corners is provided by TLcdGXYRoundedPointListPainter.

To fill shapes with a solid color, TLcdGXYPainterColorStyle is used. To fill shapes with a hatched pattern, TLcdGXYHatchedFillStyle is used.

To render outlines with a simple, dashed stroke, TLcdStrokeLineStyle is used. To render the shapes with a pattern-based stroke, TLcdGXYComplexStroke is used. This java.awt.Stroke implementation allows to use an AWT Shape array as pattern to render a shape.

The sample also illustrates halo effects. A halo is an outline of constant width and color around shapes or text, which is typically drawn in a contrasting color to ensure that the shapes or text are clearly visible on any background. For shapes, the halo effect is obtained by wrapping an ILcdGXYPainter (in this case, the TLcdGXYRoundedPointListPainter) into a TLcdGXYHaloPainter.

Instructions
  • Select a polyline or polygon to show style properties. The select controller's sensitivity has been increased to improve the selection of lines with thick linestyles.
  • Change the roundness through the slider.
  • Choose a different pattern for the complex stroke, adjust the repeating factor, or adjust the gap between the pattern shapes
  • Change the tolerance. The tolerance defines how large the cut-off error may be when placing the patterns; its effect is most visible in sharp corners. If the error is too high, a fallback stroke is used.
  • Change the 'Allow split' option. When no split is allowed, the stroke should only contain contiguous full pattern sequences (thus, pattern 1 times its repetition factor followed by pattern 2 times its repetition factor). When there is not enough space for a full sequence, a fallback stroke is used.
  • Change the halo color, and increase/decrease the halo width.
  • Add one or more points to an existing polyline by CTRL-clicking on the line
  • Create a new polyline using the button in the toolbar. The polyline will take over the current style.

   


Preview

GXY: Printing  samples.gxy.printing.MainPanel

This sample demonstrates how to print a component containing a view, using the TLcdGXYViewComponentPrintable.

Instructions

The sample creates a page layout containing the view and some decorations. You can preview the page or print it directly using the buttons in the toolbar.

   


Preview

GXY: Rectifying rasters  samples.gxy.rectification.MainPanel

This sample demonstrates the ability to combine parametric rectification - using camera and terrain information - and non-parametric rectification - using user-defined tie-points.

Instructions

The left panel displays a non-modified version of the image currently being processed, together with a set of tie points. The right panel displays several layers, from bottom to top:

  • the world background data
  • the digital elevation map (terrain)
  • the input raster in its unmodified geographical reference (original raster)
  • the result of parametric rectification (orthorectified raster)
  • the result of non-parametric rectification (tie-point corrected raster)
  • the tie points
  • a layer containing data that can be used to verify the accuracy of the rectification

The default data is a simulated satellite photo of the city of Ithaca, NY. Due to the slanted viewing direction, the position of the original picture is distorted by a variable amount compared to the real position. The size of the distortion depends on the local terrain elevation - this can be verified by comparing the position of roads in the original raster with their actual position displayed by layer "109rds".

By taking into account the viewing direction and the variable terrain elevation, the sample creates an initial orthorectified version of the raster, which corrects most of the positioning errors. The user may further correct a copy of this raster by fine-tuning a set of tie points.

An initial set of tie points are shown in the left and in the right panels. Selecting a point in one panel will display the corresponding tie point in the other panel. Tie points in both panels can be dragged to other locations. This will trigger a remapping of the corrected image in the right panel, so that the tie points appear in approximately the same location relative to the raster.

New tie points can be added in the left panel by selecting the "Create new tie point" controller. Every time a new point is added in the left panel, a corresponding tie point is added to the right panel, at approximately the same raster coordinates (a small difference may be observed for highly warped rasters).

Existing tie points can be deleted by right-clicking on them and choosing "Delete" from the context menu. If fewer than 3 points are available, the raster is no longer updated.

By default, the mapping is done using a polynomial function. You may choose a rational function or a projective function instead, by selecting the "Edit raster projection parameters" action. You can also choose the maximum degree of the polynomial(s) used by the selected function. Note that polynomials of higher degree (3 or 4) are highly unstable and may produce strange warping effects. The number of required tie point pairs varies with the degree of the polynomial(s). If an insufficient number of tie points is defined, the function will automatically decrease the degree(s) used.

When you are satisfied with the rectification you may save a re-sampled version of the raster using the reference of the right-panel view using the "Save the raster in view's reference" button.

The sample can open existing single-level referenced GeoTIFF files, or non-referenced images (tif, png, gif, bmp, jpg). If the image is not georeferenced, it is placed at a default location, together with four initial tie points in the corners.

The open and save options are not available when the sample is running in a browser.

   


Preview

GXY: Displaying shapes  samples.gxy.shapes.MainPanel

This sample shows how to programmatically create and display a model. It reveals how to create an ILcdModel, how to populate it with ILcdShape objects, and how to display that data in an ILcdGXYLayer on the ILcdGXYView.

Instructions

The sample shows a polyline, a polygon, and a point visualized by an icon. Try selecting and editing the shapes.

   


Preview

GXY: Painter, shape composition  samples.gxy.shortestDistancePainter.MainPanel

This sample demonstrates how to create a composite ILcd2DEditableShape and a suitable ILcdGXYPainter and ILcdGXYEditor for that ILcd2DEditableShape.

The class ShortestDistanceShape is a composition of a TLcdLonLatPolyline and a TLcdLonLatPoint around this polyline. The class ShortestDistanceShape knows how to calculate the ILcdPoint on the geodesic TLcdLonLatPolyline that is the closest to the TLcdLonLatPoint.

The class ShortestDistancePainter implements ILcdGXYPainter and ILcdGXYEditor and is used for painting and editing ShortestDistanceShape objects. Existing painters for the composed shape object are used for painting, TLcdGXYIconPainter for the TLcdLonLatPoint and TLcdGXYPointListPainter for the TLcdLonLatPolyline. For painting the shortest distance path of the TLcdLonLatPoint to the TLcdLonLatPolyline the utility ILcdGXYPen is used.

Instructions

The painter-editor allows to move the TLcdLonLatPoint or a point of the TLcdLonLatPolyline of the ShortestDistanceShape object to any location while constantly showing the shortest distance path of the TLcdLonLatPoint to the TLcdLonLatPolyline.

   


Preview

GXY: Visualizing statistical information  samples.gxy.statisticalPainter.MainPanel

This sample shows how to visualize shapes based on their domain object properties. A custom painter provider displays counties as polygons that are colored according to population density. Icon-based labels show different size rectangles depending on the population change.

Instructions

You can verify the visualization by double-clicking on a shape to examine its properties.

   


Preview

Model in a table  samples.gxy.swingTable.MainPanel

This is a sample for displaying an ILcdModel's elements in a JTable. All the domain objects implement ILcdDataObject, which means they have a data type with a set of properties associated to each of them.

We load several ILcdModel which are displayed/represented in both the TLcdMapJPanel and the JTabbedPane (i.e. each ILcdModel is represented in 2 different views). For each ILcdModel, there is a corresponding ILcdGXYLayer in the map and a JTable in the JTabbedPane. The column names of each JTable correspond to the attributes names, the rows correspond to the attribute values. A mediator is used to synchronize the map and table selections.

Instructions
  • Select one or more rows in one of the tables. Notice how the domain objects are made visible and selected in the map.
  • Select one or more objects on the map. Notice how the corresponding table rows are selected as well.

   


Preview

GXY: Tooltips on the map  samples.gxy.tooltip.MainPanel

This sample contains a custom implementation of ILcdGXYController, which displays tooltips for objects under the cursor. The text of the tooltips is obtained via the ILcdDataObject interface. The applyOnInteract2DBounds() method of ILcd2DBoundsIndexedModel is used to locate the object under the mouse cursor.

Instructions

Hover over a city or state and a tooltip will pop up after a short while.

   


Preview

GXY: Touch controller  samples.gxy.touch.basic.MainPanel

This sample demonstrates the touch-based navigation, selection and ruler controllers in a GXY view. The controllers are shown in the toolbar at the top. The leftmost controller is a context sensitive selection and navigation controller.

The second controller only deals with navigation. It features one finger panning, and two finger panning, zooming and rotating (at the same time).

The third is a ruler controller. It works similar to the mouse based ruler controller, creating a polyline on the map that will display the length of each segment as well as the total length.

This sample features large buttons to allow easy manipulation with fingers instead of a mouse as input device.

Instructions

Using the select controller, you can touch objects to select them, pan around by dragging the map, or zoom and pan by dragging two fingers. A number of modifier buttons are available to change the selection behavior:

  • The first button enables multi-object selection by dragging a rectangle around objects. By default, dragging pans the map.
  • The second button toggles what happens when you touch selectable objects: select them (and deselect all other objects), add them to the selection, or remove them from the selection.
  • The third button enables showing a pop-up with the objects under your finger. The pop-up allows you to choose the object to select.

For the pan controller, drag one finger to pan, and two fingers to simultaneously pan, zoom and rotate the map.

To add points to the ruler controller's measurement, touch and lift your finger. Here as well a number of buttons are added to the map:

  • The blue arrows undo/redo a step.
  • The green V commits the created polyline. This switches the ruler controller to edit mode.
  • The red cross clears the polyline and allows you to start again.

   


Preview

GXY: Create and edit shapes with a touch device  samples.gxy.touch.editing.MainPanel

This sample demonstrates how to create new ILcdShape objects and edit existing ILcdShape objects in an ILcdGXYView using a touch device.

The functionality available here is very similar to the functionality demonstrated by the editing sample. The main difference is that the controllers now interpret touch input instead of mouse input. This allows you for instance to translate an object using the edit controller with one finger and pan the view with another finger at the same time. The same goes for the controllers creating objects. Another issue is the lack of modifier buttons (on keyboard and mouse). To compensate the touch controllers have been extended with some on-map buttons. The edit controller has:

  • the same buttons as the select controller (see the touch.basic sample)
  • a button that toggles between translate and reshape behaviour when editing.
The new controllers have:
  • two buttons (blue arrows) to perform an undo respectively a redo operation. An undo will remove a previously placed point, while a redo will place a removed point again.
  • a (green) button to commit a shape under construction. This is only relevant for polylines and polygons. Other shapes will be committed when the necessary amount of points is placed.
  • a (red cross) button to cancel the current shape under construction, removing all points.
When a shape is committed the edit controller will automatically be activated.

Instructions

  • Touch or click on one of the new shape buttons in the toolbar and touch the map to create a new shape. The point will only be placed when you release the touch. When you have placed of number of points (how many depends on the shape), an object will be added to the drawing layer, and the edit controller will be activated. For composite curves, you can start a new subcurve by selecting a shape in the drop down box.
  • Edit a shape in the user layer by dragging one of its points or segments

   


Preview

GXY: Generating touch events  samples.gxy.touch.touchEvents.MainPanel

This sample demonstrates how TLcdTouchEvents can be created from hardware events. The sample simulates touch hardware generating hardware events. These events are intercepted and converted into touch events that can be used by LuciadLightspeed. After that they are dispatched.

Instructions

After opening the sample, touch events will be generated automatically. They pan, zoom and rotate the view.

   


Preview

Grid systems  samples.gxy.transformation.geodeticToGrid.MainPanel

This sample demonstrates the ability to display a geodetic location which can be expressed based on different ILcdGeodeticDatum and express its coordinates in some commonly used grid reference systems and some lon lat formats.

Instructions

Move the displayed icon and see how its coordinates change.

There are two text fields which contain the geodetic latitude and longitude respectively. The latitude and the longitude are represented in a certain format which can be changed. Values have to be entered in this format too. The geodetic coordinate is with respect to a certain geodetic datum which can be altered. In the grid coordinates panel are the (x,y) grid coordinates of this geodetic LatLon coordinate according to some commonly used grid coordinate systems.

Changing the geodetic datum or the UTM zone will affect only the geodetic coordinate or the UTM coordinate. Since the geodetic datum of the projection in the map component is kept the same as the geodetic datum of the grid calculator, the icon will move slightly too.

   


Preview

GXY: Model-world and world-view transformations  samples.gxy.transformation.mouseToGeodetic.MainPanel

This sample contains a custom implementation of ILcdGXYController, which transforms a rectangle dragged by the user (in view coordinates) into model coordinates. The mouse location is also converted into an arbitrary model reference (a grid reference with a polar projection for the north pole).

Instructions

Drag a rectangle on the map, and see the coordinates of its counter part in model coordinates, below the map. The last mouse drag or mouse click location is also expressed in another model reference.

   


Preview

GXY: Undo capabilities of LuciadLightspeed  samples.gxy.undo.MainPanel

This sample demonstrates the undo support of LuciadLightspeed. It is based on the "shapes" sample and makes it possible to undo changes made to the domain objects.

Instructions

To witness the undo support, perform the following steps:

  • Activate the edit controller using the leftmost button in the toolbar.
  • Make some changes by dragging the polyline or one of its handles.
  • Create one or more new polylines using the new polyline controller in the toolbar.
  • Click the undo button in the toolbar and the changes you made will be reverted.

   


Preview

GXY: Vertical view  samples.gxy.vertical.MainPanel

This sample demonstrates the use of the vertical view package. The 2D view in the upper part contains two layers: a background layer with a map of the world countries and a layer that contains two flights. Each flight is modeled as a list of 3D points. The 2D view only uses the first two coordinates(X,Y) of each of the points.

The vertical view in the lower part is used to display the vertical profile of the flight that is selected in the 2D view. Apart from this profile, a number of sub-profiles associated to it can be shown in a vertical view. In this case, only one sub-profile is associated to the view: the air route. FlightVVModel, an implementation of ILcdVVModel holds the main-profile points and the information about the sub-profile.

Instructions

Select a flight. A vertical marker is shown in both views. Change the height of the flight by dragging its points up or down. You can zoom the X and Y axes by using the sliders to the right and at the bottom. You can disregard flight points at the left or right of the flight using the sliders at the top. Finally, the panel at the right allows you to select the altitude unit.

   


Preview

Preprocessing 3D terrain  samples.earth.preprocessor.MainPanel

This sample demonstrates the use of TLcdEarthTileRepositoryPreprocessor. This sample provides a simple user interface for creating, loading and saving 3D terrain metadata and preprocessing it to an Earth tile repository.

Instructions

To preprocess data as a 3D terrain to an Earth tile repository you need to:

  • Define the terrain metadata
  • Configure the preprocessor

The terrain metadata consists of a number of assets (that is source data files) and a geographic reference. Add some assets to the metadata by using the button at the bottom of the panel. You can either select individual files that need to be preprocessed or a directory that contains the files that need to be preprocessed. Once the assets are loaded they will appear in the metadata panel and their bounding box will appear on the map. For image assets you can also optionally set a clipping shape to limit the preprocessed part. This can for example be used avoid preprocessing a border that is present in the asset. You can save the terrain metadata (for example for using with the Earth On-the-fly sample) using the button below the map. Finally you can change the geographic reference of the terrain using the combo box at the top of the metadata panel. Typically this geographic reference is the one that will most often be used when visualizing the terrain repository.

The repository where the assets should be preprocessed to must be configured before the preprocessor can be started. You can optionally also change the data type that must be preprocessed and enable texture transparency. After pressing the start button the preprocessing progress can be tracked in the progress panel and on the map. The preprocessor can be stopped at any time and resumed again using the buttons in the progress panel.

   


Preview

Filtering data using the OGC Filter API  samples.ogc.filter.model.MainPanel

This applet demonstrates the ability to filter data using the OGC Filter API. A layer showing earthquakes is added to the view on which a filter is configured. The layer filter is created from an OGC filter, which is created from a combination of three OGC conditions: 'a less than' for the magnitude, a temporal for the time period and a bounding box condition of a country.

The OGC conditions are expressed programmatically using the OGC Filter API. The creation of the OGC conditions is done in EarthQuakeFilterModel#createCombinedCondition. If there is a change in one of the parameters for the OGC conditions, a new OGC filter is created and converted to an ILcdFiltered by means of a filter evaluator. This conversion code can be found in MainPanel#addData.

Instructions

Use the controls in the filter configuration panel to adjust the different parameters of the filter.

   


Preview

Filtering data using the OGC Filter XML Decoding facilities  samples.ogc.filter.xml.MainPanel

This applet demonstrates the ability to filter GML data using the OGC Filter XML decoding and evaluation facilities.

It displays all the countries of the world and the same data, with a filter applied in another layer.

Instructions

Enter a filter manually in the text area at the bottom or click the load button to load a predefined filter from the list.

Click the apply button to apply the filter to the countries layer. The filtered layer will display all countries that pass the filter.

Double-click on a country in order to view its related features and compare them to the filter.

   


(no preview)

Command-line sample Tiling Engine  samples.fusion.engine.Fuser

This is a command-line sample. Click More info for run instructions.

This command-line sample demonstrates how to fuse a single coverage from one or more input data sources. It illustrates both basic and advanced usage of the fusion engine. It has extension points that allow subclasses to customize it further. It can be used as a stand-alone command-line fusion tool in scripts. Because of 32-bit VM restrictions, it uses a default maximum heap of 768 MB (-Xmx768m), which may be too limited to fuse large data sets such as the NOAA ENCs. For a 64-bit VM, you may want set this to higher value in the sample's startup script, for example -Xmx1500m.

Run the sample using the shell script in the samples folder:

fusion.engine.bat -s:<source> -t:<target-tile-store>
Instructions

For a detailed list of command-line options, run the sample without arguments.

The minimal arguments are the input data source(s) and the target Tile Store URI:

  • "-s:<source>" The input data source(s), which may be a single file or a directory.
  • "-t:<target-tile-store>" The target Tile Store, which may be a local directory ("file:" URI) or a remote Tile Store ("http:" URI).

For example, "fusion.engine.sh -s:/my/input/data/sources -t:http://my.server:8081/LuciadFusion/lts" will create a coverage using all the input data found in /my/input/data/sources. The coverage and assets will have a generated UUID as ID, and no name.

Typically, you want to specify some options for assets and coverage. Options for assets start with "-a:", options for the coverage start with "-c:". For example, "fusion.engine.sh -s[0]:/my/input/data/background.tif" -s[1]:/my/input/data/california.jp2 -a[0]:id:background.tif -a[1]:id:california.jp2 -c:id:california will create a coverage "california" from two input data sources. The indexes determine the order: "california.jp2" will be on top of "background.tif".

When you use this sample in a script, for example to regularly re-fuse a specific coverage, you may want to consider the "-overwrite" option. Without it, fusion would resume from checkpoint if a previous fusion was unfinished, or do nothing if a previous fusion was finished.

 


(no preview)

Command-line sample Tiling Engine with custom ArcInfo ASCII Grid format  samples.fusion.engine.format.Fuser

This is a command-line sample. Click More info for run instructions.

This command-line sample demonstrates how to plug in a custom raster format into the fusion engine. It illustrates how support for ArcInfo ASCII Grid can be added by extending the fusion.engine sample.

Run the sample using the shell script in the samples folder:

fusion.engine.format.bat -s:<source> -t:<target-tile-store>
Instructions

For a detailed list of command-line options, run the sample without arguments. See also the fusion.engine sample for detailed instructions.

The minimal arguments are the input data source(s) and the target Tile Store URI:

  • "-s:<source>" The input data source(s), which may be a single file or a directory.
  • "-t:<target-tile-store>" The target Tile Store, which may be a local directory ("file:" URI) or a remote Tile Store ("http:" URI).

For example, "fusion.engine.sh -s:/my/input/data/sources.asc -t:http://my.server:8081/LuciadFusion/lts" will create a coverage using all the input data found in /my/input/data/sources. The coverage and assets will have a generated UUID as ID, and no name.

 


(no preview)

Command-line sample Point Cloud Pre-processor  samples.fusion.pointcloud.PointCloudPreprocessorTool

This is a command-line sample. Click More info for run instructions.

This command-line sample demonstrates how to pre-process one or more input files into a single point cloud. It illustrates both basic usage of the pre-processor. It can be used as a stand-alone command-line tool in scripts. Because of 32-bit VM restrictions, it uses a default maximum heap of 768 MB (-Xmx768m), which may be too limited to process large data sets. For a 64-bit VM, you may want set this to higher value in the sample's startup script, for example -Xmx2g.

Run the sample using the shell script in the samples folder:

fusion.pointcloud.bat --input=<source> --output=<target-directory>
Instructions

For a detailed list of command-line options, run the sample without arguments.

The minimal arguments are the input data source(s) and the target path:

  • "--input=<source>" The input source, which may be a single file or a directory.
  • "--output=<target>" The target directory, which will be created if necessary.

For example, "fusion.pointcloud.sh --input=/my/input/data/sources --target=/my/output/pointcloud" will create a point cloud store using all the input data found in /my/input/data/sources.

The output of this process can be imported into LuciadFusion Studio by adding the entire output directory as a "Data Root". Once the data root is crawled, you should be able to see a new data entry that represents the preprocesed dataset in your "Data" tab. To serve it, create a new Service using this dataset, and set the service type to "OGC 3D Tiles".

The preprocessed output can also be opened directly in a Lightspeed-based client such as Lucy. To do this, open the "tileset.json" found in the root of the output directory.

When you use this sample in a script, for example to regularly re-fuse a specific coverage, you may want to consider removing the target directory first. Without this, the preprocessor would add data from the input sources to the existing point cloud, or do nothing if all of the input sources were already to the point cloud previously.

 


(no preview)

Exporting data to GML31  samples.encoder.gml3.Main

This is a command-line sample. Click More info for run instructions.

This sample illustrates how to data in SHP, MIF or MAP formats can be transformed and exported as GML31 data.

Run the sample using the shell script in the samples folder:

encoder.gml3.bat [-gmlschema gmlSchema] [-xmlschema xmlSchema] [-namespace namespace] vectorFile resultFile

These are the parameters to pass:

  • gmlSchema: the location of the GML schema to be encoded in the xsi:schemaLocations attribute
  • xmlSchema: the location of the XML-SCHEMA schema to be encoded in the xsi:schemaLocations attribute
  • namespace: the target namespace, if none is available.
  • vectorFile: the name of a vector file that is to be converted
  • resultFile: the name of the output file

 


(no preview)

Transforming data to and from GML  samples.transformation.gml.GMLTransformationDemo

This is a command-line sample. Click More info for run instructions.

This sample uses the FlightPlan data model from the LuciadLightspeed fundamentals as source model. It shows how this data model can be transformed into a GML data model. It shows how the GML application schema can be generated. It then encodes a model containing flight plans as a GML document. Then this document is decoded back into a model containing flight plans.

Run the sample using the shell script in the samples folder:

transformation.gml.bat 

 


(no preview)

Encoding JPEG2000  samples.encoder.raster.jpeg2000.Main

This is a command-line sample. Click More info for run instructions.

This command-line tool demonstrates how to decode rasters in various formats and encode them in JPEG2000 format, using a TLcdJPEG2000ModelEncoder.

Run the sample using the shell script in the samples folder:

encoder.raster.jpeg2000.bat [options] <input_raster> <output_jpeg2000>

The supported options are:

-levels   <n>
-layers   <n>
-quality  <f>
-lossless
-tilesize <width> <height>

 


Preview

GXY: displaying KML data  samples.decoder.kml22.gxy.MainPanel

This sample demonstrates how to load and display KML data on a map.

Instructions

The sample will automatically load a basic KML file containing most KML features, and fit the map on the data.

The model content tree next to the map is a tree-based structure showing the contents of all KML files that are currently displayed on the map.

Objects can be selected either via the map or via the model content tree. When an object is selected a balloon will pop-up, displaying additional information on the object.

The sample will automatically resolve network links in KML files, and refresh the model contents if a refresh mode is specified in the link.

When KML files containing time information (timestamp, timespan) are loaded, a time toolbar will become visible, showing the time interval for which data is available. The time slider can be used to control which data should be shown on the map.

   


Preview

Lightspeed: displaying KML data  samples.decoder.kml22.lightspeed.MainPanel

This sample demonstrates how to load and display KML data on a map.

Instructions

The sample will automatically load two KML files:

  • a file containing Collada data, representing the town hall of Leuven.
  • a basic KML file containing most KML features.
The sample will fit on the basic dataset on startup.

The model content tree next to the map is a tree-based structure showing the contents of all KML files that are currently displayed on the map.

Objects can be selected either via the map or via the model content tree. When an object is selected a balloon will pop-up, displaying additional information on the object.

The sample will automatically resolve network links in KML files, and refresh the model contents if a refresh mode is specified in the link.

When KML files containing time information (timestamp, timespan) are loaded, a time toolbar will become visible, showing the time interval for which data is available. The time slider can be used to control which data should be shown on the map.

   


(no preview)

Convert models into KML models and save them into KML files  samples.encoder.kml22.KMLConverter

This is a command-line sample. Click More info for run instructions.

This sample demonstrates how to convert models into KML. The KML format is particularly useful for sharing a situational map with a broader set of stakeholders, who do not necessarily have access to LuciadLightspeed, but can open KML data in other map visualization tools. LuciadLightspeed allows you to convert map data into KML. This sample illustrates one way to convert vector data into KML and customize the conversion. It gives you full control of the style and the geometry information that will be converted in the KML model. The model encoder TLcdKML22ModelEncoder can then export the KML model.

Run the sample using the shell script in the samples folder:

encoder.kml22.bat 

Run the sample to convert the files and the in-memory model into KML. The three new KML files are located in the Kml directory inside the data resources folder for the samples. You can visualize the KML files in the general decoder samples, the KML decoder samples, or any KML visualization tool.

First, the KML encoding sample decodes a SHP file representing tracks, and converts a subset of the tracks into a KML model. The KML model is then encoded in a file. Another SHP file representing the USA states is also decoded, and some states are encoded in KML. Next, the sample creates an in-memory model of airspaces. Each airspace is an extruded shape with a circle or a polygon as its base shape. The airspace model is also converted into KML and encoded.

 


Preview

Lightspeed: Lidar visualization  samples.lightspeed.lidar.MainPanel

This sample illustrates how Lidar data from .las files can be visualized in a Lightspeed view.

With this sample, you can open one or more .las files and apply different styling.

The following styling options are available if at least one layer supports it:

  • Color: uses the color information available in the file.
  • Height: shows a color gradient over the combined height range of all layers.
  • Classification: shows a different color per class.
  • Intensity: shows greyscale gradient based on the intensity available in the file.
  • Infrared: shows a color gradient based on the infrared information available in the file.

Additionally, a shading technique to enhance depth perception is enabled by default. Using the controls in the panel, the settings can be changed:

  • Enhance: the checkbox enables or disables the shading technique
  • The thickness slider alters the thickness of the applied shade
  • The strength slider alters the strength of the applied shade
  • The color chooser changes the color of the applied shade
Instructions

Open .las files using the "Open File" icon, or by dragging files onto the sample.

Change the styling and filtering using the panel on the right. The styling will be applied to the layers that support it. Layers that don't support it use Height styling.

Change the depth perception settings using the panel on the right. The settings will be applied to all layers.

   


Preview

GXY: Clustering  samples.gxy.clustering.MainPanel

This sample demonstrates how to introduce clustering in a GXY application using TLcdTransformingModelFactory and TLcdClusteringTransformer.

The sample contains a large number of recorded humanitarian events in Africa. When a number of events are close together (in view-space), they become hard to distinguish. Therefore a cluster is shown instead of the individual events.

This sample uses two different clustering strategies:

  • When zoomed in, only events happening in the same country will be clustered together (if needed). Clusters will never contain events happening in different countries. This is achieved by specifying an ILcdClassifier on the transformer.
  • When zoomed out, all events are considered for clustering, even when they happened in different countries.

This scale-dependent clustering behavior is created by calling the TLcdClusteringTransformer.createScaleDependent method.

Instructions

Navigate around the map and see the clusters update when necessary.

   


Preview

Lightspeed: Balloon  samples.lightspeed.balloon.MainPanel

This sample demonstrates how to display balloons in an ILspView using TLspBalloonManager.

The sample generates four icons, each of which contains a balloon. A balloon is made visible when a single object is selected. The balloon contains an icon and an editable text field containing the position of the icon in geodetic coordinates.

For a more extensive description of the balloon manager API see the developers' guide.

Instructions

Select one of the icons. A balloon will appear. Editing the coordinate panel in the balloon and hitting return will change the location of the icon. The balloon arrow also gets relocated with this operation. Balloons are only shown when one domain object is selected.

   


Preview

Lightspeed: Clustering  samples.lightspeed.clustering.MainPanel

This sample demonstrates how to introduce clustering in a Lightspeed application using TLcdTransformingModelFactory and TLcdClusteringTransformer.

The sample contains a large number of recorded humanitarian events in Africa. When a number of events are close together (in view-space), they become hard to distinguish. Therefore a cluster is shown instead of the individual events. Selecting a cluster also selects and displays its contained elements.

This sample uses two different clustering strategies:

  • When zoomed in, only events happening in the same country will be clustered together (if needed). Clusters will never contain events happening in different countries. This is achieved by specifying an ILcdClassifier on the transformer.
  • When zoomed out, all events are considered for clustering, even when they happened in different countries.

This scale-dependent clustering behavior is created by calling the TLcdClusteringTransformer.createScaleDependent method.

Instructions

Navigate around the map and see the clusters update when necessary. A cluster's contained elements can be displayed by selecting it. Moving a cluster also moves the contained elements.

   


Preview

Lightspeed: Custom Controller  samples.lightspeed.customization.controller.MainPanel

This sample demonstrates how to implement and use a custom controller. The first controller (active by default) shows an information panel when hovering over an object. The second controller allows you to navigate using arrow and other keys.

Instructions

When using the first controller, use the mouse to hover over some of the counties in the USA and an information panel will pop-up with some information about the county. When using the second controller, the following keys can be used:

  • arrow keys: pan the view left, up, right and down.
  • Home and End: zoom in and out.
  • Insert and Delete: rotate yaw left and right.
  • Page Up and Page Down: rotate pitch forward and backward (only 3D).
  • F: toggle full screen mode.
You can also double click on the view to toggle fullscreen mode, or click on a county or city while pressing the CTRL (CMD on Mac OS) key to trigger a fly-to animation.

   


Preview

Lightspeed: Hippodrome  samples.lightspeed.customization.hippodrome.MainPanel

This sample demonstrates how to add support for painting and editing a custom shape: the hippodrome. The hippodrome consists of two 180 degrees arcs and two lines connecting these arcs and at a given distance from the line between the center points (width).

Please refer to the documented sample code and the developer's guide for more information.

Instructions
  • Select a hippodrome to start editing it.
  • Move one of the hippodrome points by dragging the mouse starting from a point.
  • Move the whole hippodrome by dragging the mouse starting from the shape itself.
  • Change the width of the hippodrome by dragging the mouse starting from the outline of the shape.
  • Create a new geodetic- or grid hippodrome by selecting the corresponding create controller in the toolbar and by clicking three times for a regular hippodrome and four times for creating an extruded hippodrome in 3D. The first two clicks define the start and end points. The third click defines the width. The optional fourth click defines the maximal altitude of the extruded hippodrome.

   


Preview

Lightspeed: Using custom paint representations  samples.lightspeed.customization.paintrepresentation.MainPanel

This sample is an adaptation of the Editing sample (which illustrates the editing and creation capabilities of the editors that are available in the Lightspeed API).

The Shapes layer in this sample has a regular shape painter (TLspShapePainter) to paint the shapes' bodies. In addition, this sample adds another shape painter with a different styler that is identified by a custom paint representation. This special styler provides the painter with the bounds of the shape as opposed to the shape itself. Hence, each shape is painted twice: once using its own geometry and once using the bounds geometry.

For more detailed information on how to create an application which uses custom paint representations, see the developer's guide or the documented source code of this sample.

Instructions

Try editing and creating new shapes and notice how both paint representations (the shape itself and its bounds) are painted and updated.

   


Preview

Lightspeed: Animated style  samples.lightspeed.customization.style.animated.MainPanel

This sample demostrates how LuciadLightspeed's animation framework can be used to animate the style of an object. The animation is implemented in AnimatedAreaStyler, a custom ILspStyler implementation which uses an ILcdAnimation to update style properties and fire style change events when needed.

Instructions

When the sample is started, the style of one of the countries should automatically be animated.

   


Preview

Lightspeed: Styling editing handles  samples.lightspeed.customization.style.handles.MainPanel

This sample illustrates how to customize the visualization of editing handles using some custom stylers. This sample uses two stylers to:

  • Show the length of line-based handles
  • Paint a dotted line on line-based handles

Instructions

Select an ellipse in the sample. This should activate editing on that shape, and you should see the following customizations:

  • Each line handle contains a label with its length in metres

   


Preview

Lightspeed: Highlighting  samples.lightspeed.customization.style.highlighting.MainPanel

This sample demonstrates how LuciadLightspeed's animation and style frameworks can be used to highlight and show custom animations for the object under the cursor.

The sample consists of a layer containing shapes for each country. When the mouse is moved over a country, a pie chart appears showing the demographic distribution in that country.

This layer has two stylers:

  • An AnimatedHighlightAreaShapeStyler which takes care of the styling of the countries/pie charts themselves ( fill/line colors )
  • An AnimatedHighlightAreaLabelStyler which takes care of the styling of the labels of the countries/pie charts
Both stylers use the animation framework by means of a ALcdAnimationManager and ALcdAnimation in combination with a mouse adapter to progressively adjust the styles of each object.

The pie charts are created and styled by passing their style and geometry to a ALspStyleCollector along with the object to which they belong.

Instructions

Move your cursor over the different countries of the world. When the cursor is on top of a country, a pie chart will gradually rise and display population statistics specific of that country. When the cursor moves away from the highlighted country, the pie chart for that country will gradually vanish.

   


Preview

Lightspeed: Thematic mapping  samples.lightspeed.customization.style.thematic.MainPanel

This sample demonstrates how to implement "thematic mapping", i.e. to adjust the style of an object to that object's attributes.

The sample consists of a layer of country shapes on which custom colors are being styled. The colors for the countries are linearly interpolated between a minimum color and a maximum color chosen by the user, with the population of each country as a weight for the interpolation. More populated areas will therefore tend towards the maximum color, while less populated areas will tend towards the minimum color. This styling is accomplished by using a custom styler implementation, namely a samples.lightspeed.customization.style.thematic.CountryStyler

Instructions

Click on either the left or right gradient button on the toolbar to set the lowest or highest population color respectively. You will notice that the color of the countries is an interpolated value between those two colors, based on their population.

   


Preview

Data Model Tree Sample  samples.lightspeed.datamodel.MainPanel

This sample adds functionality to view the TLcdDataModel of an ILcdModel that has an ILcdDataModelDescriptor as a model descriptor.

The 'Data Model Tree' is visible on start-up, showing the data model tree for the currently selected layer.

The data model tree contains all declared TLcdDataType instances of the TLcdDataModel. Each TLcdDataType contains a series of properties and TLcdDataProperties.

All TLcdDataTypes that are also model element TLcdDataType instances are highlighted in a special color.

Note that TLcdDataModel instances can define data types that are cyclical. There is no explicit check for this issue in the sample code, as it was not needed for this special case.

Instructions

Open some random files and see how the data model tree gets updated each time you select a new layer which has an ILcdModelDescriptor as model descriptor on its model.

   


Preview

Lightspeed: Day/night Map  samples.lightspeed.daynight.MainPanel

This sample shows how to create a day/night map in a Lightspeed view. The areas in civil/nautical/astronomical twilight and night are drawn in progressively darker shades. An icon on the map indicates the point where the sun is directly overhead. The day/night map animates in fast time over a period of 1 year.

The day/night map is constructed as follows:

  1. Find the point on the Earth where the sun is directly overhead.
  2. On the opposite side of the globe, construct a set of concentric circles to represent the night and twilight areas.
  3. Fill these circles with a dark translucent color.

Instructions

The sample automatically shows an animated day/night map. A label on the top edge of the map shows the current date and time of the map.

   


Preview

Lightspeed: Hardware capability report  samples.lightspeed.debug.report.MainPanel

The hardware capability report sample generates a detailed list of the hardware related capabilities of the device running the sample. The sample generates a hardware report with the OpenGL and OpenCL capabilities of the system using the com.luciad.view.lightspeed.util.TLspPlatformInfo utility class. Reported capabilities include:

  • OS information
  • OpenGL basic information (vendor, renderer, version)
  • OpenGL available extensions
  • OpenGL state variables
  • OpenCL basic information (vendor, version, ...)
  • OpenCL available extensions
  • OpenCL device info

Instructions

When contacting Luciad support about any Lightspeed-related problems, it is always appreciated if you include the report generated by this sample.

   


Preview

Lightspeed: Decoding multiple format data  samples.lightspeed.decoder.MainPanel

This sample demonstrates the ability to load and visualize data from sources in different formats on a Lightspeed map using ILcdModelDecoder and ILspLayerFactory.

A File and a URL action are configured to load data in almost every available format.

The sample uses a composite ILcdModelDecoder to decode the data into anILcdModel. After this, a composite ILspLayerFactory creates a layer that controls how the model of the loaded data is displayed. The model decoders and layer factories are retrieved using a service look-up mechanism, and contain both built-in and sample implementations.

The toolbar includes several controllers to visually compare layers.

Instructions

Add new data by pressing the appropriate toolbar button or by dragging and dropping files or URLs on the map. Not all styled LuciadLightspeed formats have a dedicated Lightspeed layer factory (an example of this is DGN), in which case a fallback layer factory is used. As a result, the visualization of some data might not be correctly styled. The data shown in the highlighted sample screenshot is an OGC 3D Tiles mesh data set for Marseille, located at https://sampleservices.luciad.com/ogc/3dtiles/marseille-mesh/tileset.json.

The toolbar allows selecting the following visual inspection controllers:

  • The swipe controller: Select two sets of layers. Drag the swipe line horizontally or vertically to inspect differences between the two sets along the line.
  • The flicker controller: Select two layers. Quickly click the mouse to toggle between the two layers.
  • The porthole controller: Select two sets of layers and move your mouse over the map. The first set of layers is visible by default. The second set is shown in a rectangular area around the mouse location. Holding down the shift key and moving the mouse wheel resizes the porthole.
  • The magnifier controller: a square area around the mouse location shows a zoomed in view of the visible layers. In the magnifier overlay, view-sized items still have the same size while world-sized items are scaled to respect the zoom-factor of the magnifier. Holding down the shift key and moving the mouse wheel changes the zoom factor of the magnifier. Holding down the control key and moving the mouse wheel resizes the magnifier overlay.

   


Preview

Lightspeed: Editing geometric shapes  samples.lightspeed.editing.MainPanel

This sample illustrates the editing and creation capabilities of the editors that are available in the Lightspeed API. The sample contains one shape layer for both editing and creation. Shape creation is performed using TLspCreateController. Shape editing is performed using TLspEditController.

Consult the developer's guide or the documented source code of this sample for detailed information on how to create an application that uses Lightspeed editors.

Instructions

To edit one of the shapes, click on the shape and interact with one of its edit handles. Please refer to the javadoc of the different editor classes in the com.luciad.view.lightspeed.editor package to see what functionality is provided by each of the handles.

To create a new shape, activate one of the create controllers in the toolbar. Most of the controllers also have an extruded creation variant. This variant creates an extruded shape with the base shape that is created by the normal editor. For instance, the ellipse create controller creates an extruded ellipse when extrusion is activated. Extrusion can be activated by the extrusion button in the creation toolbar.

For most shapes creation is simply performed by a sequence of mouse clicks or taps. Some additional instructions for special cases:

  • Polylines and polygons: End creation by right or double clicking.
  • Complex polygons: Advance to the next polygon by right clicking. Finalize the creation process by double clicking.
  • Complex rings and curves: Advance to the next shape by right clicking. Change the shape type using one of the buttons that appear in the view.
  • Extruded polylines and polygons: End creation of the base shape by right clicking.

When creating or editing shapes you can disable snapping by pressing the control key (cmd on macOS). Insert or remove a point from a polyline or polygon by holding down the control key (cmd on macOS) while pressing. Select multiple shapes by holding the shift while pressing. Use the delete key to remove selected shapes.

   


Preview

Lightspeed: Geoid  samples.lightspeed.geoid.MainPanel

This sample visualizes the EGM2008 geoid in 3D. The geoid heights are exaggerated; they actually vary between -110m and +90m. Blue colors indicate that the geoid heights are negative (geoid below the ellipsoid of the WGS84 datum). Green colors indicate that the geoid heights are positive (geoid above the ellipsoid).

Geoid heights are typically used behind the screens, in calculations with references that have geodetic datums based on geoids. They are relevant for elevation data, for instance, which are commonly defined with respect to a few standardized geoid models. For accurate computations, elevations above a geoid can then be transformed to elevations above an ellipsoid.

The geoid heights are retrieved from the geodetic datum that is created by the TLcdGeoidGeodeticDatumFactory.

Instructions

   


Preview

Lightspeed: Grids  samples.lightspeed.grid.MainPanel

This sample demonstrates how to display grid layers in a Lightspeed view.

The following grid layers are included:

  • Lon Lat: a simple multi-level grid showing longitude and latitude lines. The lines are refined up to the second.
  • Georef: an alphanumeric multi-level grid based on longitude latitude lines. The lines are refined up to the degree. The labels denote 1-by-1 degree squares.
  • XY: a grid based on an ILcdXYWorldReference. The labels denote meters.

In addition, the sample shows how to change text and line styles and other grid styling properties.

Instructions

  • Select a grid type and an appropriate projection
  • Pan and zoom around. Notice how the grid and its labels adapt.
  • Change some styling options. The results are shown instantly.

   


Preview

Lightspeed: 3D icons  samples.lightspeed.icons3d.MainPanel

This sample demonstrates how to visualize point data using 3D icons. Icons can be loaded from files in either Collada, OpenFlight or WaveFront OBJ format.

Instructions

The sample shows animated 3D points. At startup, they are displayed using an airplane icon. Use the "open" button on the toolbar to load a .DAE, .OBJ or .FLT file. Doing so will replace the airplane model.

   


Preview

Lightspeed: Image Projection  samples.lightspeed.imageprojection.MainPanel

This sample demonstrates how to project images on terrain.

Instructions

The sample shows an image being projected on terrain by an animated plane. Notice how the projected image deforms when projected on the terrain. The white lines indicate the projection frustum. This frustum can be toggled on or off in the layer pane.

   


Preview

Lightspeed: Multispectral image visualization  samples.lightspeed.imaging.multispectral.MainPanel

This sample illustrates how multispectral raster imagery can be visualized and analyzed in an ILspView.

The sample starts with pre-loaded satellite image files covering the region of Las Vegas. The images are obtained from the LandSat7 USGS archive. They are multi-spectral GeoTIFF files that consist of 7 bands. The sample also allows you to load other GeoTIFF files from disk.

The panel below the layer controls demonstrates the LuciadLightspeed imaging operators and filters, and allows you to configure how the image in the selected layer is displayed. You can adjust brightness, contrast, opacity, and apply a sharpening filter using the sliders.

You can also choose which of the 7 image bands are displayed, and to which color channel they are mapped. To display the pre-loaded images in the the LandSat7 natural color preset for instance, select the bands 3, 2 and 1 in the Red, Green and Blue drop-down menus respectively. Other interesting band combinations that highlight specific aspects of the image data are 4-3-2, to display the near infrared (NIR) data, and 7-4-2 to display short-wavelength infrared (SWIR) data. The band combination 7-4-2 displays vegetation in bright shades of green, for instance.

The Curves panel displays the data distribution of the displayed image bands in a histogram. You can adjust the dynamic range for the bands in each color channel by manipulating the line displayed on top of the histogram into a curve. You can also enhance the image contrast automatically by applying the Equalization function on the Luminance tab.

The toolbar allows selecting a swipe and flicker controller to visually compare layers.The swipe controller displays a swipe line that can be dragged horizontally or vertically, displaying only half of the first set of layers on the left or top side, and half of the other set of layers on the other side. The flicker controller allows to quickly toggle between multiple layer sets by clicking the mouse. See the documentation of TLspSwipeController and TLspFlickerController for more info.

The sample makes use of TLspImageFilterStyle and the ALcdImageOperator API to perform the band selection and dynamic range adjustments.

Instructions

Load additional files with drag and drop, or by clicking the Open button on the toolbar. When you select the resulting layer in the layer control panel, three additional panels appear below the layer controls.

In the General panel, you can apply several image filters to the selected raster layer. Use the sliders to adapt the image contrast, brightness, opacity and sharpness.Click Reset to return to the default filter settings.

The Visible bands panel allows you to choose which image bands are made visible, and in which color. The drop-down menus next to the Red, Green and Blue color channels contain a list of the image bands present in the selected raster layer. To map an image band to a particular color channel, select the band number from the drop-down menu next to the preferred color.
To see just one band in grayscale, click the grayscale icon and select a band from the drop-down menu.

The Curves panel consists of four tabs. The Red, Green and Blue tabs displays a histogram and a tone curve for the color-mapped bands of the loaded image. To see the histogram and tone curve for a particular band, select the tab with the color to which you mapped the band. To change the tone curve in a particular color channel, select the line on the histogram, and drag its control points until it forms a curve, and your image displays the required color balance. You can add or delete points on the selected curve by ctrl-clicking. The Luminance tab displays a histogram and curve for the brightness of the image. You can manipulate the tone curve to improve the contrast in the image. To enhance image contrast automatically, click Equalize. As a result, the contrast will be stretched automatically, and the curve will change.
To reset curves to their original settings, click Reset.

To visually compare layers, select the swipe controller from the toolbar. Compare for example the Las Vegas image from 2000 and 2003. By dragging the swipe line you should be able to easily see the differences between the two image files. Enable the flicker controller from the toolbar and select the two Las Vegas image files. Quickly click the mouse to toggle between the two layers.

   


Preview

Lightspeed (JavaFX): Balloon  samples.lightspeed.javafx.balloon.Main

This sample demonstrates how to display balloons in a TLspFXView using TLspFXBalloonManager.
This sample requires JavaFX. Depending on the JDK you are using, you may need to install it separately. Refer to the technical notes in the documentation for more information.

The sample shows two points on the map, each of which is tied to a balloon. A balloon is made visible when a single object is selected. The balloon contains an editable text field containing the position of the icon in geodetic coordinates.

For a more extensive description of the balloon manager API see the developers' guide.

Instructions

Select one of the icons. A balloon will appear. Editing the coordinate panel in the balloon and hitting return will change the location of the icon. The balloon arrow also gets relocated with this operation. Balloons are only shown when one domain object is selected.

   


Preview

Lightspeed (JavaFX): Decoding multiple format data  samples.lightspeed.javafx.decoder.Main

This sample demonstrates the ability to load, visualize and print data from sources in different formats on a Lightspeed JavaFX map using ILcdModelDecoder and ILspLayerFactory.
This sample requires JavaFX. Depending on the JDK you are using, you may need to install it separately. Refer to the technical notes in the documentation for more information.

A file and a URL action are configured to load data in almost every available format.

The sample uses a composite ILcdModelDecoder to decode the data into anILcdModel. After this, a composite ILspLayerFactory creates a layer that controls how the model of the loaded data is displayed. The model decoders and layer factories are retrieved using a service look-up mechanism, and contain both built-in and sample implementations.

Instructions

Add new data by pressing the appropriate toolbar button or by dragging and dropping files or URLs on the map. Not all styled LuciadLightspeed formats have a dedicated Lightspeed layer factory (an example of this is DGN), in which case a fallback layer factory is used. As a result, the visualization of some data might not be correctly styled.

Use the print button on the toolbar to preview and print the current contents of the map.

   


Preview

Lightspeed (JavaFX): Editing geometric shapes  samples.lightspeed.javafx.editing.Main

This sample illustrates the editing and creation capabilities of the editors that are available in the Lightspeed API.
This sample requires JavaFX. Depending on the JDK you are using, you may need to install it separately. Refer to the technical notes in the documentation for more information.

The sample contains one shape layer for both editing and creation. Shape creation is performed using TLspCreateController. Shape editing is performed using TLspEditController.

Consult the developer's guide or the documented source code of this sample for detailed information on how to create an application that uses Lightspeed editors.

Instructions

To edit one of the shapes, click on the shape and interact with one of its edit handles. Please refer to the javadoc of the different editor classes in the com.luciad.view.lightspeed.editor package to see what functionality is provided by each of the handles.

To create a new shape, activate one of the create controllers in the toolbar. Most of the controllers also have an extruded creation variant. This variant creates an extruded shape with the base shape that is created by the normal editor. For instance, the ellipse create controller creates an extruded ellipse when extrusion is activated. Extrusion can be activated by the extrusion button in the creation toolbar.

For most shapes creation is simply performed by a sequence of mouse clicks or taps. Some additional instructions for special cases:

  • Polylines and polygons: End creation by right or double clicking.
  • Complex polygons: Advance to the next polygon by right clicking. Finalize the creation process by double clicking.
  • Complex rings and curves: Advance to the next shape by right clicking. Change the shape type using one of the buttons that appear in the view.
  • Extruded polylines and polygons: End creation of the base shape by right clicking.

When creating or editing shapes you can disable snapping by pressing the control key (cmd on macOS). Insert or remove a point from a polyline or polygon by holding down the control key (cmd on macOS) while pressing. Select multiple shapes by holding the shift while pressing. Use the delete key to remove selected shapes.

   


Preview

Lightspeed: JavaFX touch editing  samples.lightspeed.javafx.touch.Main

This sample demonstrates how to add touch support into a JavaFX application.
This sample requires JavaFX. Depending on the JDK you are using, you may need to install it separately. Refer to the technical notes in the documentation for more information.

The sample features large buttons to allow easy manipulation with fingers instead of a mouse as input device.

Instructions

Use one finger to pan around and to select or edit objects. Use two fingers to zoom or rotate.

To edit one of the shapes, you just have to touch the shape and interact with one of its editing handles. Please refer to the javadoc of the different editor classes in the API to see what functionality is provided by each of the handles.

To create a new shape, activate one of the create controllers in the toolbar. Note that most of the controllers also have an extruded creation variant. This variant creates an extruded shape with the base shape that is created by the normal editor. For instance, the ellipse create controller creates an extruded ellipse when extrusion is activated. Extrusion can be activated by the extrusion button in the creation toolbar (third button).

Some shapes like polylines, polygons, and complex polygons have different (dynamic) creation steps that can be ended by pressing the Commit button. For example, to create a complex polygon containing two triangular shapes, the sequence of interactions should be: tap-tap-tap, commit (to end first polygon), tap-tap-tap, commit (to end second polygon), commit (to end complex polygon creation).

   


Preview

Lightspeed: Interactive labels  samples.lightspeed.labels.interactive.MainPanel

This sample demonstrates how labels can be made editable. The labels are editable in the sense that they can be moved to a new location, as well as in the sense that they offer the user an interactive component that can be used to edit information related to the domain objects.

Instructions

Move the mouse over a label of a city. An interactive, editable label will be shown instead of the regular label. You can enter a comment for the labeled city in the text field. To apply the changes, press the Enter key or press the green tick mark at the top of the interactive label. To cancel the outstanding changes, press the red 'cancel' icon at the top of the label or press the Escape key.

The interactive label can be moved by clicking and dragging on the title bar of the interactive label.

   


Preview

Lightspeed: Label placement  samples.lightspeed.labels.placement.MainPanel

This sample demonstrates various labeling algorithms:

  • TLspLabelingAlgorithm, for labeling cities
  • TLspInPathLabelingAlgorithm, for labeling states
  • TLspCurvedPathLabelingAlgorithm, for labeling rivers
This sample also demonstrates how to override a label's anchor point. This is used to add labels for the rivers that point to their spring. Or for city text labels that point to their icon label.

Note that the river's springs are determined as the first point of the first polyline, which may not correspond to reality.

Instructions

To see the effects of the labeling algorithms select a layer, by clicking it in the layer control and:

  • change the layer's visibility
  • set the layer labeled/not labeled
  • move the layer up/down: labeling is started from the topmost layer
Zooming in/out will also have an effect on the labeling as less or more objects can be labeled.

To modify the label styling, drag the opacity slider, or change the font using the Font combobox.

   


Preview

Lightspeed: Lightweight views  samples.lightspeed.lightweight.MainPanel

This sample demonstrates how Swing components can be overlaid on an ILspView. Specifically, the sample shows a JInternalFrame which contains a secondary map view, alongside with navigation controls for the main view.

To avoid issues with the mixing of lightweight and heavyweight components, the sample uses TLspSwingView rather than TLspAWTView. A JLayeredPane is added to the main view. Within this layered pane, one layer is a JDesktopPane containing the internal frame with the second view. Another layer contains the standard navigation controls and scale indicator for the main view (as can also be seen in other samples).

Instructions

Move, resize, minimize and maximize the internal frame. Observe how it sits between the main view and its overlaid navigation controls.

   


Preview

Lightspeed: Constrained navigation  samples.lightspeed.limitnavigation.MainPanel

This sample demonstrates how the view-world transformation can be customized in order to constrain the navigation freedom. This behavior can be enabled or disabled using a checkbox in the toolbar.

Instructions

Take note of the checkbox labeled "Limit Navigation" in the upper right corner of the screen, by default it is checked. As long as this checkbox is checked your navigational options are constrained:

  • Rotate the view, notice how this has no effect. The view is automatically rotated to keep the north at the top of the screen.
  • Zoom in and out, notice how you can only zoom out to a certain degree and how you can only zoom in to a certain degree and only to a certain area marked by the red rectangle.
  • Pan and navigate around the view, notice how you can only pan to the boundaries of the area marked by the red rectangle.

Uncheck the "Limit Navigation" checkbox and retry panning, zooming and rotating the view and notice the difference with the constrained version of these behaviors.

   


Preview

Lightspeed: Map Overview  samples.lightspeed.mapoverview.MainPanel

This sample shows to add a map overview for an ILspView. The map overview is overlaid on the main view. It shows the bounds of the area of the world that is visible in the main view.

The map overview is itself a TLspSwingView, which is added to the main view's overlay panel. The visible map area is obtained using ALspViewXYZWorldTransformation.getGeodeticVisibleArea(). The map overview continuously fits to this polygon.

Instructions

Navigate in the main view. Switch between 3D and the various 2D projections. Observe how the map overview updates continuously and how the polygon in the map overview corresponds to the area of the world that can be seen in the main view.

   


Preview

Lightspeed: Encode shape as JSON mesh  samples.lightspeed.meshencoder.MainPanel

This sample demonstrates how 3D shapes in LuciadLightspeed can be discretized and saved as 3D meshes in a custom file format.

The intent of this sample is to show you how to export 3D shapes from LuciadLightspeed as 3D meshes for re-use in a LuciadRIA client. The produced JSON file can easily be parsed by the LuciadRIA MeshFactory.

Instructions

To save a 3D shape as a JSON mesh-file, select a shape in the view, and press the save button in the toolbar.

   


Preview

Lightspeed: Navigation controls  samples.lightspeed.navigationcontrols.MainPanel

This sample demonstrates how to use TLspNavigationControlsFactory to create Swing-based controls for view navigation and overlay these controls on a view.

The default navigation controls are as usual visible in the top right corner. A secondary set of controls is added to the left side of the view. The distinct components are the same but they are separated and added in different corners and they always appear active. The compass navigation control on the left side points towards the magnetic north instead of the real north.

Instructions

Use the secondary set of navigation controls to pan, zoom and rotate the view.

   


Preview

Lightspeed: Painting data that is not geographically referenced  samples.lightspeed.nongeoreferenced.MainPanel

This sample contains three layers:

  • Raster data: a GIF file of Washington DC.
  • Vector data: a number of vector shapes drawn on top of the raster.
  • XY Grid: an xy grid, including labels.
Instructions

Navigate the map. Notice how the mouse location at the bottom indicates the pixel coordinates in the image.

Select one of the shapes and edit it or create a new shape.

Open an image file.

   


Preview

Lightspeed: Painting in view coordinates  samples.lightspeed.paintinview.MainPanel

This sample contains two layers:

  • Screen data: a point, polygon and ellipse defined in screen coordinates. This is achieved by using a model reference that is not an ILcdGeoReference.
  • Georeferenced data: three lon-lat ellipses. For each ellipse, a pencil icon is drawn in screen coordinates, as well as a mini version of the ellipse. This is achieved by using an ALspStyleTargetProvider that returns null as its target geo reference.

Instructions

Navigate the map. Notice how the shapes at the top of the screen remain at the same position at any time.

Select one of the green shapes and edit it.

Select one of the blue ellipses. One of the icons and mini-ellipses is automatically selected as well.

Select one of the pencil icons or mini-ellipse. The corresponding ellipse is selected as well.

Edit one of the blue ellipses. The corresponding mini-ellipse is edited as well.

   


Preview

Lightspeed: Plot painting  samples.lightspeed.plots.MainPanel

The sample loads 500.000 aircraft positions around New York.

The plots are painted with a plot layer (TLspPlotLayerBuilder).

At a certain scale, heading arrows are displayed, and labels that are de-cluttered using the continuous de-cluttering algorithm.

Filtering can be done through the properties of the data model.

  • Ranged properties (such as time, speed) can be filtered using the sliders
  • For properties with limited values (such as class) you can select one value from the drop-down boxes

Styling is also based on the properties of the data model.

  • For ranged properties (such as time, speed) the icon color is interpolated between red and green based on the filter sliders
  • For properties with limited values (such as class) a color or icon is automatically assigned to each possible value

Instructions

Change the filtering through the sliders and drop-down boxes. The filter is immediately effective.

Change the color and icons through the drop-down boxes. The change is immediately effective.

Enable and disable density plots through the checkbox. The change is immediately effective.

   


Preview

Lightspeed: Printing  samples.lightspeed.printing.MainPanel

This sample demonstrates how to print a component containing a view, using the TLspViewComponentPrintable.

Instructions

The sample creates a page layout containing the view and some decorations. You can preview the page or print it directly using the buttons in the toolbar.

   


Preview

Lightspeed: Measurement Controller  samples.lightspeed.ruler.MainPanel

This sample demonstrates how to configure the measurement controller and change different properties of it dynamically at runtime.

Instructions

It is possible to modify the following ruler settings:

  • Measure mode: Geodetic, Rhumbline or Cartesian. The latter measures cartesian distances between points in world coordinates, which is useful e.g. to measure the height of a 3D shape.
  • Color style: the color of the measurement polylines.
  • Font style: the font of the labels.
  • Distance unit: Meters, Kilometers, Feet or US Miles.
  • Display azimuth: the azimuth of the measurement segments.
  • Display Equal Distance Circles: visual aid during editing of measurements. Only supported in the Geodetic measure mode.
  • Keep Measurements: Don't delete the old measurement when starting the creation of a new one.
There is also undo/redo support for editing measurements.

   


Preview

Lightspeed: Displaying shapes  samples.lightspeed.shapes.MainPanel

This sample shows how to programmatically create and display a model. It reveals how to create an ILcdModel, how to populate it with ILcdShape objects, and how to display that data in an ILspLayer on a Lightspeed view.

For a more extensive description of each of these steps see the developers' guide.

Instructions

The sample shows a polyline, a polygon, and a point visualized by an icon. Try interacting with the shapes.

   


Preview

Lightspeed: Editing the style of objects  samples.lightspeed.style.editable.MainPanel

This sample is intended to illustrate the process of editing an object's style at runtime. It creates a setup in which a TLspEditableStyler is used to edit the styles of all the objects. To tweak the values of the provider at runtime, a widget was implemented which provides a GUI for editing the most prominent style properties (see StyleEditor andStyleEditorModel).

Note that for simplicity, this sample focuses on editing line- and fill styles, but the concepts used in this sample can be applied to editing other styles as well.

Instructions
  1. Select an object in the view.
  2. Press the edit style button in the toolbar.
  3. In the style dialog that appears, change the desired settings.
  4. Press "OK" to apply the new settings and close the dialog (if you just want to apply the settings and keep the dialog open, press "Apply").
  • Line Width: use the spinner widget to change the line width.
  • Line Color: click on the color label to choose a different color.
  • Line Pattern: choose a different line pattern from the drop down.
  • Fill Color: click on the color label to choose a different color.
  • Fill Pattern: choose a different fill pattern from the drop down.

   


Preview

Lightspeed: Expression-based styling of objects  samples.lightspeed.style.expressions.MainPanel

This sample demonstrates expression based-styling in a Lightspeed view using TLspParameterizedLineStyle, TLspParameterizedFillStyle and TLspParameterizedIconStyle

Instructions

Use the layer selection panel on the right to select different layers, demonstrating different kinds parameterized styles, ILcdExpression and shapes.

The first layer shows Flightradar tracks styled with a TLspParameterizedLineStyle. Only the segment of a track that is within a specified time interval is visible.

The second layer shows European countries styled with a TLspParameterizedFillStyle. The fill color of the countries is derived from the population property of each country.

The last layer visualizes cities using a TLspParameterizedIconStyle. An icon for a city is scaled based on the population property and the distance to the mouse cursor.

   


Preview

Lightspeed: Fill style  samples.lightspeed.style.fillstyle.MainPanel

This sample demonstrates the capabilities of TLspFillStyle. It shows various layers with shapes with different fill styles:

  • Solid: the area is filled with one color, possibly transparent.
  • Stippled: the area is filled with a repeating pattern. A stipple pattern is created by using a TLspFillStyle.StipplePattern with convenience methods to draw lines or filled/outlined rectangles, ovals or polygons.
  • Textured: the area is filled based on an texture. This can be aBufferedImage, and can be scaled, rotated or translated. Additionally, the texture can be set to be applied relative to the bounds of the object or relative to the bounds of the world.
It also shows two layers with extruded shapes.

Instructions

The sample has various layers containing shapes with different fill styles.

Move around in 2D and 3D to see the effect.

Edit the shapes to see how the different fill styles adapt.

   


Preview

Lightspeed: Icon style  samples.lightspeed.style.icon.MainPanel

The icon style sample demonstrates the icon styling functionality of TLspShapeLayerBuilder, i.e.: rotation and transparency of icons, drawing icons with a vertical line and drawing icons either with a size in world coordinates or in view coordinates. All this is accomplished using TLspIconStyle.

The sample contains three layers with icons, all located around San Francisco:

  • View sized icons: the icon size remains constant in view coordinates (i.e. pixels), regardless of the scale of the view.
  • World sized icons: the size of the icons remains constant in world coordinates (typically meters).
  • Rotatable icons: these icons use a custom styler (see RotatableIconStyler). They can be rotated using the slider in the upper left corner of the view. They also change color depending on the scale of the view. Finally, the icons use a third scaling mode which is a hybrid of view and world sized: the size of the icons is defined in world coordinates, but their size on screen will never exceed their native size in pixels.

Instructions

Zoom in on San Francisco and see how each icon layer resizes its icons differently. Also notice how the rotatable icons layer changes the color of its icons based on the scale of the view. Use the rotation slider to change the orientation of the rotatable icons.

   


Preview

Lightspeed: Raster style  samples.lightspeed.style.raster.MainPanel

The Raster Style sample illustrates how the style of a raster can be changed on the fly:

  • Change the outline and fill of the raster's bounds.
  • Change brightness, contrast and opacity.
  • Set and change a custom filter (interactive raster layers only).
  • Change the color model for elevation layers.

The sample starts with a raster style with 100% brightness, 100% contrast, 100% opacity and no custom filter. For more detailed information on how to use raster styles and providers, see the developer's guide or the documented source code of this sample.

The sample shows 3 types of layers:

  • Interactive raster layers: the style of these layers can be changed interactively. They are marked with a [I] prefix.
  • Background raster layers: the style of these layers can be changed but not as smoothly as interactive layers. However they generally require less processing and memory for painting. These layers are marked with a [B] prefix.
  • Terrain layer: this layer is a proxy for the view's terrain. The view's terrain contains all background layers at the bottom of the view, hence changing its style will affect all those layers. Its style can be changed interactively.

Instructions

Select a raster layer in the layer control and change its style using the panel on the left.

   


Preview

Lightspeed: Stroked line styles  samples.lightspeed.style.strokedline.MainPanel

This sample demonstrates how line data can be visualized using complex strokes. This is achieved by using TLspComplexStrokedLineStyle.

Instructions

The sample shows a number of shapes with different strokes. Use the layer selection panel on the right to select different layers, demonstrating different kinds of strokes. Select and edit the shapes to see how the stroke pattern adjusts itself. Switch to a 3D view to see how stroked lines appear when they are draped over the terrain.

   


Preview

Lightspeed: Touch Basic  samples.lightspeed.touch.basic.MainPanel

This applet demonstrates the use of the touch-based ILspControllers. It features a single controller chain to navigate around the map, and select and edit objects.

The sample features large buttons to allow easy manipulation with fingers instead of a mouse as input device.

Instructions

Use one finger to pan around and to select or edit objects. Use two fingers to zoom.

   


Preview

Lightspeed: Custom touch controller  samples.lightspeed.touch.customcontroller.MainPanel

This sample demonstrates how ALspController can be extended to implement a custom touch controller.

The first custom controller displays a tooltip for objects that are touched.

The second custom controller fits the view to the bounds of an object if a touch-and-hold action is performed on that object.

Instructions

Activate the first custom controller ("information panels"). While you touch an object on the map (e.g. a county), a tooltip will pop up showing some of that object's attributes.

Activate the second custom controller ("fit to object"). Touch and hold an object until a red circle visually notifies you that the touch-and-hold time has been reached. If you now release your finger, the view will fit to the bounds of that object.

   


Preview

Lightspeed: Touch Editing  samples.lightspeed.touch.editing.MainPanel

This applet demonstrates the use of the touch-based ILspControllers for editing purposes.

Instructions

Navigate, select and edit objects. You can make a layer selectable by first tapping on its name in the layer list, and then tapping on the "Toggle layer selectable" button.

To edit one of the shapes, you just have to touch the shape and interact with one of its editing handles. Please refer to the javadoc of the different editor classes in the API to see what functionality is provided by each of the handles.

To create a new shape, activate one of the create controllers in the toolbar. Note that most of the controllers also have an extruded creation variant. This variant creates an extruded shape with the base shape that is created by the normal editor. For instance, the ellipse create controller creates an extruded ellipse when extrusion is activated. Extrusion can be activated by the extrusion button in the creation toolbar (right most button).

Some shapes like polylines, polygons, and complex polygons have different (dynamic) creation steps that can be ended by pressing the Commit button. For example, to create a complex polygon containing two triangular shapes, the sequence of interactions should be: tap-tap-tap, commit (to end first polygon), tap-tap-tap, commit (to end second polygon), commit (to end complex polygon creation).

   


Preview

Lightspeed: Simulation of touch events  samples.lightspeed.touch.touchEvents.MainPanel

This sample demonstrates the effect of touch events on a touch enabled Lightspeed view. It contains a setup that simulates touch events and passes them to the Lightspeed view. The touch controller set on the view is a navigation controller by default and will interpret the incoming events by panning and zooming the view.

The simulation can be started by clicking the "Simulate touch events" button in the toolbar.

Instructions

Start a simulation of how touch events are handled in a Lightspeed view by clicking the button in the toolbar.

   


Preview

Lightspeed: Tracking camera  samples.lightspeed.trackingcamera.MainPanel

This sample shows how different constraints can be added to the view's camera to automatically follow one or more moving objects.

The sample shows a model with three airplanes. Their position is constantly updated. The sample attaches a tracking constraint to the camera so the airplanes are always in view.

The different possible tracking constraints are:

  • TLspLookFromTrackingCameraConstraint3D: used to fix the camera at a certain position. Panning and zooming are not possible, but rotating still is. Optionally, the direction of the camera can be fixed as well, so rotating is also impossible.
  • TLspLookAtTrackingCameraConstraint3D: used to fix the camera in a certain direction. Panning is not possible, but zooming and rotating still is.
  • TLspLookAtTrackingCameraConstraint2D: same as above for 2D views.

Instructions

The combobox on the right shows the available tracking modes. It changes the world reference, view's camera, and the tracking mode.

Supported tracking modes for a 3D view are:

  • Look at target: the camera is always oriented towards the tracked objects. Panning is not possible, but zooming and rotating is.
  • Look from target: the camera is always positioned on the tracked objects, looking away from them. Panning and zooming are not possible, but rotating is.
  • Oriented like target: the camera is always positioned on the tracked objects, oriented like the objects (based on ILcdOriented). Panning, zooming and rotating is impossible.
Supported tracking modes for a 2D view are:
  • Follow location: the camera is always oriented towards the tracked objects. Panning is not possible, but zooming and rotating is.
  • Follow location and orientation: the camera is always positioned on the tracked objects, oriented like the objects. Only zooming is possible.

   


Preview

Lightspeed: Vertical view  samples.lightspeed.vertical.MainPanel

This sample demonstrates the use of the vertical view package. The 2D view in the upper part contains a flight layer with two flight routes. Each flight route is modeled as a list of 3D points.

The vertical view in the lower part is used to display the vertical profile of the flight that is selected in the 2D view. Apart from this profile, a number of sub-profiles associated to it can be shown in a vertical view. In this case, two sub-profiles are associated to the view: the terrain and the air route. FlightVVModel, an implementation of ILcdVVModel holds the main-profile points and the information about the sub-profile.

Instructions

Select a flight. A vertical marker is shown in both views. Change the height of the flight by dragging its points up or down. You can zoom the X and Y axes by using the sliders to the right and at the bottom. You can disregard flight points at the left or right of the flight using the sliders at the top. Finally, the panel at the right allows you to select the altitude unit.

   


Preview

Lightspeed: style layers using Symbology Encoding (SLD)  samples.ogc.sld.lightspeed.MainPanel

The OGC Symbology Encoding (Styled Layer Descriptor) standard describes an XML format to describe the style of a layer. This sample demonstrates how to decode such a style from a file and how to apply it to a Lightspeed layer.

The application displays a number of layers and a set of styles. The styles can be applied to the layers. Some of the styles are specific for a particular layer, while others can be applied to any layer.

The text area at the right displays the description of the style as it is defined in the SLD file.

Instructions

Select a layer in the layer control and a style in the dropdown list. Selecting the style will automatically apply it to the selected layer.

   


Preview

Decoding ISO19139 metadata  samples.metadata.MainPanel

This sample demonstrates the ability to load metadata encoded following the ISO 19139 standard schema.

Instructions

Click the open button and select a file from the LuciadLightspeed/samples/resources/Data/metadata folder. The central frame will display the metadata as encoded in the file.

   


Preview

Metadata gazetteer  samples.metadata.gazetteer.MainPanel

This sample demonstrates a simple gazetteer functionality.

Some metadata files are loaded and the geographic extent of the data they describe is extracted from the metadata and displayed on the map as bounds.

Instructions

Double click on the bounds to display all metadata linked to the bounds.

Right click with the mouse to load the data which is described in the metadata. The location(s) of the file to load is extracted from the metadata.

   


Preview

GXY: Displaying dynamic data  samples.realtime.gxy.tracksimulator.MainPanel

This sample shows how to visualize dynamic tracks in a GXY map.

The sample shows several random parabolic trajectories and animates 2000 dynamic tracks moving along these trajectories. The dynamic tracks layer is simulated using a TLcdSimulator with a custom ALcdSimulatorModel.

Each track has a label that displays its identifier, and the grounded state of the track.

Instructions

Press the "Play" button to start or the simulation. The tracks start moving across their individual trajectories.

As the tracks move around, the labels are gently repositioned to avoid overlap. If you hover the mouse over a label of a moving track, it stops moving. In the rare event labels get mixed up, you drag them to a new location. Labels move back automatically.

A time slider allows to see your progression in the simulation. When the simulation is not running, the slider also allows you to change the "simulation time" with your mouse.

You can adjust the replay speed factor using the "speed up" slider.

   


Preview

Lightspeed: Displaying dynamic data on a map and timeline  samples.realtime.lightspeed.tracksimulator.MainPanel

This sample shows how to visualize dynamic tracks in a Lightspeed map and timeline.

The sample shows 2000 random parabolic trajectories and animates 2000 dynamic tracks moving along these trajectories. The dynamic tracks layer is simulated using a TLcdSimulator with a custom ALcdSimulatorModel.

Tracks are visualized with airplane icons. In 3D projections, a line connects each icon with its zero-elevation point. Each track also has a trail of grey dots indicating previous positions. The trail is added to the icons by using a custom ILspStyler. The track labels are decluttered using the TLspContinuousLabelingAlgorithm, a specialized algorithm for moving objects in a Lightspeed view.

The time line at the bottom is a non geo-referenced Lightspeed view that you can pan and zoom.

Instructions

Press the "Play" button to start the simulation. The tracks start moving across their individual trajectories. The time view is also updated. If you pan the time view, the simulation is also updated. You can adjust the replay speed by zooming in or out on the time line.

Select a plane in the main view. Its altitude over time is displayed in the time view along with the name of its landing and take-off city.

Zoom in and pan around the world to see how the labels of the dynamic tracks are automatically decluttered depending on the current situation. You can also select and move all of the track labels.

   


Preview

GXY: style layers using SymbologyEncoding (SLD)  samples.ogc.sld.gxy.MainPanel

The OGC Styled Layer Descriptor standard describes an XML format to describe the style of a layer. This sample demonstrates how to decode such a style from a file and how to apply it to a layer.

The application displays a number of layers and a set of styles. The styles can be applied to the layers. Some of the styles are specific for a particular layer, while others can be applied to any layer.

The text area at the right displays the description of the style as it is defined in the SLD file.

Instructions

Select a layer in the layer control and a style in the dropdown list. Clicking the apply button will attempt to apply the style to the selected layer. Selecting 'Default' in the list resets the style of the layer.

   


(no preview)

GeoPackage Encoder Sample  samples.encoder.sqlite.geopackage.Main

This is a command-line sample. Click More info for run instructions.

This application demonstrates how to encode spatial data to a GeoPackage file, using TLcdGeoPackageModelEncoder.

Run the sample using the shell script in the samples folder:

encoder.sqlite.geopackage.bat source_file destination_gpkg_file

Pass two arguments to this sample: an input file and a (new or existing) .gpkg file.

 


Preview

Using WCS data in a 2D GXY view  samples.ogc.wcs.client.MainPanel

This sample demonstrates how to use an OGC Web Coverage Service (WCS) in a client application equipped with a 2D GXY view, using the Luciad WCS client API.

Using the client API, applications can create a "proxy" ILcdModel that transparently obtains coverage data from the WCS.

When a connection is made with a WCS service, the combo box in the upper right of the sample is populated with the list of coverages offered by this WCS. These coverages can be selected and visualized on the map.

Instructions

During startup, the sample will try to connect to one of two default OGC WCS services:

  • a Luciad OGC WCS service sample running on localhost at port 8080 (http://localhost:8080/LuciadOGCServices/wcs). If the OGC Web Services Suite is available, this service can be started by running the samples.ogc.server.Main sample.
  • a public Luciad OGC WCS service (http://sampleservices.luciad.com/wcs).
Additionally, you can connect to other WCS services through the URL panel below the map.

Querying the list of available coverages: fill in a URL in the text field below the map and press the "Query WCS service" button. This will send a GetCapabilities request to the service and parse the list of available coverages. When successful, the coverages will be listed in the combo box in the upper right corner of the sample.

Retrieving and visualizing a coverage: select a coverage in the combo box in the upper right of the sample. Click the "Get coverage" button to send a GetCoverage request to the service and visualize the requested data on the map.

   


Preview

Using WFS data in a 2D GXY view  samples.ogc.wfs.client.gxy.MainPanel

This sample demonstrates how to use an OGC Web Feature Service (WFS) in a client application equipped with a 2D GXY view, using the Luciad WFS client API.

Using the client API, applications can create a "proxy" ILcdModel that transparently obtains feature data from a WFS. This WFS proxy model can optionally be configured with an OGC Filter to be applied to the data and, as is done in the sample, a "maxfeatures" parameter to limit the number of features that are retrieved from the service.

When a connection is made with a WFS service, the combo box in the upper right of the sample is populated with the list of features types offered by this WFS. Selecting a feature types from the list retrieves and visualize the feature data on the map. You can also connect to other WFS services through the URL panel below the map.

Instructions

During startup, the sample will try to connect to one of two default OGC WFS services:

  • a Luciad OGC WFS service sample running on localhost at port 8080 (http://localhost:8080/LuciadOGCServices/wfs). If the OGC Web Services Suite is available, this service can be started by running the samples.ogc.server.Main sample.
  • a public Luciad OGC WFS service (http://sampleservices.luciad.com/wfs).
Additionally, you can connect to other WFS services through the URL panel below the map.

To query the list of available feature types, fill in a server and press the "Query" button. This will send a GetCapabilities request to the service and parse the list of available features types. When successful, the feature types will be listed in the combo box in the upper right corner of the sample.

To visualize a feature type, just select it from the combo box. This will send a GetFeature request to the service for the selected feature type, and create a layer to visualize the retrieved feature data.

   


Preview

Using WFS data in a 2D / 3D Lightspeed view  samples.ogc.wfs.client.lightspeed.MainPanel

This sample demonstrates how to use an OGC Web Feature Service (WFS) in a client application equipped with a 2D / 3D Lightspeed view, using the Luciad WFS client API.

Using the client API, applications can create a "proxy" ILcdModel that transparently obtains feature data from a WFS. This WFS proxy model can optionally be configured By default, this results in a map loaded with:

  • the states and the rivers of the USA,
  • the roads and a raster background of Washington DC,
  • a blue polygon partially covering Canada.

When a connection is made with a WFS service, the combo box in the upper right of the sample is populated with the list of features types offered by this WFS. Selecting a feature types from the list retrieves and visualize the feature data on the map. You can also connect to other WFS services through the URL panel below the map.

Instructions

During startup, the sample will try to connect to one of two default OGC WFS services:

  • a Luciad OGC WFS service sample running on localhost at port 8080 (http://localhost:8080/LuciadOGCServices/wfs). If the OGC Web Services Suite is available, this service can be started by running the samples.ogc.server.Main sample.
  • a public Luciad OGC WFS service (http://sampleservices.luciad.com/wfs).
Additionally, you can connect to other WFS services through the URL panel below the map.

To query the list of available feature types, fill in a server and press the "Query" button. This will send a GetCapabilities request to the service and parse the list of available features types. When successful, the feature types will be listed in the combo box in the upper right corner of the sample.

To visualize a feature type, just select it from the combo box. This will send a GetFeature request to the service for the selected feature type, and create a layer to visualize the retrieved feature data.

   


Preview

Using ECDIS data from a LuciadFusion WMS in a 2D GXY view  samples.wms.client.ecdis.gxy.MainPanel

This sample demonstrates how to query ECDIS data from a LuciadFusion OGC Web Map Service (WMS) in a WMS client application, taking into account S-52 display settings.

This sample requires a LuciadFusion WMS service supporting SLD-based S-52 styling.

You can use the S-52 customizer panel on the right side of the map to tweak the display settings for the ECDIS WMS layers. The WMS client will encode the S-52 display settings into an S-52 SLD extension, and embed this SLD in the GetMap request that is sent to the server. The Fusion WMS server will return the ECDIS image, rendered with the settings from the SLD.

Instructions

During startup, the sample will try to connect to a public LuciadFusion OGC WMS service (http://sampleservices.luciad.com/wms). Additionally, you can connect to other LuciadFusion WMS services through the URL panel.

Map interaction: the toolbar offers a set of actions to navigate on and interact with the map. This includes the ability to pan and zoom, to measure distances and to switch the projection. When the selection projection does not match the available projects in the WMS service, the data is automatically reprojected, fully transparent for the user.

S-52 display settings: The S-52 display settings customizer panel right of the map allows to modify the S-52 display settings. Any change to the settings will immediately trigger a new query to the WMS server with updated S-52 SLD styling parameters, and update the client view accordingly.

   


Preview

Using ECDIS data from a LuciadFusion WMS in a Lightspeed view  samples.wms.client.ecdis.lightspeed.MainPanel

This sample demonstrates how to query ECDIS data from a LuciadFusion OGC Web Map Service (WMS) in a WMS client application, taking into account S-52 display settings.

This sample requires a LuciadFusion WMS service supporting SLD-based S-52 styling.

You can use the S-52 customizer panel on the right side of the map to tweak the display settings for the ECDIS WMS layers. The WMS client will encode the S-52 display settings into an S-52 SLD extension, and embed this SLD in the GetMap request that is sent to the server. The Fusion WMS server will return the ECDIS image, rendered with the settings from the SLD.

Instructions

During startup, the sample will try to connect to a public LuciadFusion OGC WMS service (http://sampleservices.luciad.com/wms). Additionally, you can connect to other LuciadFusion WMS services through the URL panel.

Map interaction: the toolbar offers a set of actions to navigate on and interact with the map. This includes the ability to pan and zoom, to measure distances and to switch the projection. When the selection projection does not match the available projects in the WMS service, the data is automatically reprojected, fully transparent for the user.

S-52 display settings: The S-52 display settings customizer panel right of the map allows to modify the S-52 display settings. Any change to the settings will immediately trigger a new query to the WMS server with updated S-52 SLD styling parameters, and update the client view accordingly.

   


Preview

Using WMS data in a 2D GXY view  samples.wms.client.gxy.MainPanel

This sample demonstrates how map data from an OGC Web Map Service (WMS) can be retrieved and visualized in a GXY (2D) view.

Using the client API, applications can create a "proxy" ILcdModel that transparently obtains map data from the WMS.

When a connection is made with a WMS service, the layer list in the upper right of the sample is populated with the list of layers offered by this WMS. These layers can be selected and visualized on the map.

You can switch between a tiled and a non-tiled painting strategy. Tiled painting typically offers better performance while non-tiled painting allows pixel-perfect results in a 2D view.

The sample also demonstrates the use of WMS feature info requests. If the WMS advertises GetFeatureInfo support, you can click on the map. This requests additional feature information for that location from the service. If feature information is available, it will be painted as an overlay label on the map at the clicked location.

The sample demonstrates making use of multi-dimensional data when selecting WMS layers for which the WMS server advertises them.

The check box "Auto-update WMS" is enabled by default, which means that the sample will check at each pan/zoom action whether the capabilities at the server have been updated. Any changes in the available layers are applied automatically; if there are any new layers defined at the server, they will be added. Layers that are not available anymore at the server will be removed automatically.

Instructions

During startup, the sample will try to connect to one of two default OGC WMS services:

  • a Luciad OGC WMS service sample running on localhost at port 8080 (http://localhost:8080/LuciadOGCServices/wms). If the OGC Web Services Suite is available, this service can be started by running the samples.ogc.server.Main sample.
  • a public Luciad OGC WMS service (http://sampleservices.luciad.com/wms).
Additionally, you can connect to other WMS services through the URL panel. N

WMS layer selection: the list in the upper right of the samples shows the available WMS layers. Selecting and deselecting layers triggers a map refresh, taking into account the current WMS layer selection.

Map interaction: the toolbar offers a set of actions to navigate on and interact with the map. This includes the ability to pan and zoom, to measure distances and to switch the projection. When the selection projection does not match the available projects in the WMS service, the data is automatically reprojected, fully transparent for the user.

Painting settings: disable the tiled checkbox in the panel. The update latency will increase but the results are now pixel-perfect when the view is using a 2D reference that is supported by the WMS server.

Feature info: click on the crosshair button in the toolbar to activate the feature info controller. Clicking on the cities or rivers of the USA or on the streets of Washington DC shows a label with the feature information next to the clicked point, if available.

Enable the check box "Auto-update WMS" to let the application check for new/removed WMS layers at each pan or zoom action. When used with the sample Luciad WMS service, one can add data in the samples/resources/Data/dynamic folder to try this feature. The following data formats are supported: SHP, MIF, CADRG, DMED, DEM, GeoTIFF, raster (.rst), ETOPO and a custom format (.txt). This folder is monitored each 10 seconds. When new data is found or when data is removed, the advertised layers in the WMS capabilities are automatically updated, and the client sample will automatically pick up the changes. Newly added data should therefore soon become visible at the client, after a pan or zoom action.

   


Preview

Using WMS data in a 2D / 3D Lightspeed view  samples.wms.client.lightspeed.MainPanel

This sample demonstrates how map data from an OGC Web Map Service (WMS) can be retrieved and visualized in a Lightspeed view.

Using the client API, applications can create a "proxy" ILcdModel that transparently obtains map data from the WMS.

When a connection is made with a WMS service, the layer list in the upper right of the sample is populated with the list of layers offered by this WMS. These layers can be selected and visualized on the map.

You can switch between a tiled and a non-tiled painting strategy. Tiled painting typically offers better performance while non-tiled painting allows pixel-perfect results in a 2D view.

The sample also demonstrates the use of WMS feature info requests. If the WMS advertises GetFeatureInfo support, you can click on the map. This requests additional feature information for that location from the service. If feature information is available, it will be painted as an overlay label on the map at the clicked location.

The sample demonstrates making use of multi-dimensional data when selecting WMS layers for which the WMS server advertises them.

Instructions

During startup, the sample will try to connect to one of two default OGC WMS services:

  • a Luciad OGC WMS service sample running on localhost at port 8080 (http://localhost:8080/LuciadOGCServices/wms). If the OGC Web Services Suite is available, this service can be started by running the samples.ogc.server.Main sample.
  • a public Luciad OGC WMS service (http://sampleservices.luciad.com/wms).
Additionally, you can connect to other WMS services through the URL panel.

WMS layer selection: the list in the upper right of the samples shows the available WMS layers. Selecting and deselecting layers triggers a map refresh, taking into account the current WMS layer selection.

Map interaction: the toolbar offers a set of actions to navigate on and interact with the map. This includes the ability to pan and zoom, to measure distances and to switch the projection. When the selection projection does not match the available projects in the WMS service, the data is automatically reprojected, fully transparent for the user.

Painting settings: disable the tiled checkbox in the panel. The update latency will increase but the results are now pixel-perfect when the view is using a 2D reference that is supported by the WMS server.

Feature info: click on the crosshair button in the toolbar to activate the feature info controller. Clicking on the cities or rivers of the USA or on the streets of Washington DC shows a label with the feature information next to the clicked point, if available.

   


Preview

WMS Server Configuration Editor  samples.wms.server.config.editor.MainPanel

This sample is a configuration editor for a Luciad Web Map Server.

Instructions

   


(no preview)

OGC services  samples.ogc.server.Main

This sample starts the OGC web services sample on localhost port 8080, giving access to an OGC Web Map Service (WMS), a Web Feature Service (WFS), and a Web Coverage Service (WCS).
LuciadFusion also adds a Web Catalogue Service (CSW) to this sample.

Instructions

The services can be accessed through a set of client samples delivered with LuciadLightspeed, or through the service's administrative page available at the following URL: http://localhost:8080/LuciadOGCServices This administrative page is built using HTML / JavaScript and is delivered with the services sample. It provides a graphical front-end to the OGC services and gives access to their capabilities.

You can run one of the client samples delivered with LuciadLightspeed to connect with the OGC services:

  • Using WMS data in a 2D GXY view
  • Using WMS data in a 2D / 3D Lightspeed view
  • Using WFS data in a 2D GXY view
  • Using WFS data in a 2D / 3D Lightspeed view
  • Using WCS data in a 2D GXY view

   


(no preview)

Adding custom profiles to differentiate between deployment environments for the Fusion Platform  samples.fusion.platform.profiles.CustomProfilesFusionPlatformApplication

This sample demonstrates how to create your own Spring profiles. This is a useful feature that can be used to have different configurations in different environments without changing anything in your application.

For the sake of simplicity, the sample application activates the custom staging profile programmatically. The preferred way of setting the active profile is to use program arguments, vm parameters or JNDI attributes. See the deployment guide for more information about Spring profiles.

   


(no preview)

Using Spring Security to perform database authentication  samples.fusion.platform.security.authentication.CustomAuthenticationFusionPlatformApplication

This sample demonstrates how to create your own authentication logic. This implementation intends to replace the default built-in LuciadFusion Platform security authentication logic. This is useful in scenarios where users intend to implement their own user authentication logic. For the sake of simplicity, this sample uses user authentication via a database, but the concept can be extended to implement more complex authentication logic.

 


(no preview)

Using Spring Security to perform user authorization in order to restrict access to HTTP resources  samples.fusion.platform.security.http.CustomHttpSecurityFusionPlatformApplication

This sample demonstrates how to create your own authorization logic. This implementation intends to replace the default built-in LuciadFusion Platform HTTP security configuration. This is useful in scenarios where users intend to implement their own security and authorization logic.

 


(no preview)

Extending LuciadFusion Platform with a custom Spring endpoint  samples.fusion.platform.service.CustomServiceFusionPlatformApplication

Example Fusion application to create an extra Spring endpoint. In this case a simple "Hello World" service, that exposes the "/hello" and "/hello/{name}" endpoints.

 


Preview

Adding a custom service type to LuciadFusion (SHP Quiz)  samples.fusion.platform.shpquiz.FusionServerSampleShpQuiz

Custom service type example.

This sample shows how to add a custom service type that can be used within LuciadFusion Studio. A SHP Quiz service type is added that creates quizzes from SHP files published in the services of this type.