Perforce JViews Maps Sample: Using the Map Builder as a Starting Point
Description
The Map Builder is a map preparation tool designed to define the maps in use by your application. However, it can also be used as a starting point when designing your final application. It is delivered as source code and provides many of the features that users want in a mapping application and so serves as an ideal foundation. |
The Map Builder is a standalone application that provides users with the features of JViews Maps. Using the Map Builder you can:
|
How to Use the Sample
-
Understanding the Map Builder Main Window
The Map Builder main window is composed of:-
A Menu bar
This gives access to file input/output and demonstration options. -
The Overview pane
This gives pan and zoom control on the map main view. -
The options and styling pane
By default this pane provides tabs that change the appearance of the map by changing layer styles, units, or projection. -
The main map toolbar
This gives access to interactive tools activated by using the mouse in the main map view. - The main map view
-
A Status bar
This bar displays information about the current map, the mouse location, and the background tasks that are running.
-
A Menu bar
-
Constructing Maps from Vector and Raster Sources.
When you start the Map Builder, a Vector data of the world is imported by default. You can import other data sources using the Import menu item.
-
For detailed instructions, see "Using the Map Builder" in the main documentation section.
-
JVM parameters:
When launching the Map Builder, use of the following flags is recommended:sun.java2d.noddraw=true
This setting usually improves the graphical performance of typical map displays.
It also solves some issues with some Video Card drivers when using a 3D View (JViews Maps for Defense).Xmx1024m
The maps loaded using the Map Builder may total gigabytes of memory. Allocating more maximum memory to Java improves the performance.
-
Importing DB2 and Informix within Map Builder
The IBM relational database products DB2 and Informix both have features that provide the ability to create a database table with a geospatial type such as point, line, or polygon. The values in a spatial column can be created by importing from a source, such as the ESRI shapefile de-facto standard, or by populating the database with an SQL constructor function that uses numeric values, geometric shapes, well-known text, or well-known binary representations. A set of spatial SQL functions and predicates that implement the Open Geospatial Consortium (OGC) specification allow you to create SQL queries including operations like "distance", "within", and "intersects between" spatial values. For more information about these capabilities, refer to the DB2 or Informix online documentation and the IBM Spatial web site . -
Importing Oracle layers within Map Builder
To be able to import Oracle Spatial layers, you must have access to an Oracle Server with the Spatial Option. You also need certain privileges that allow you to write to your Oracle database and retrieve data and an Oracle account with read/write access to the SDO packages.
In addition, an Oracle driver for Java is required (you can find the free thin driver at the Oracle site: here ).
For more information, contact your Oracle DB administrator (who can help you define the correct connection parameters).
This sample uses theilog.views.maps.format.oracle
package for relational implementation, available since Oracle 7.3, andilog.views.maps.format.oracle.objectmodel
that is based on the object implementation of Oracle Spatial, available since Oracle 8.0.
It has been run on Oracle version 7.3 to 10.2 databases using the 'thin' driver. This driver requires no particular Oracle Client on the client machine.You will then need to do the following:
-
Edit the
<installdir>/samples/mapbuilder/build.xml
file, in order to specify the jar library containing the Oracle driver for JDBC. Check that the driver you want to use is compatible with your database, then add the driver jar filename to the 'jviews.manifest.classpath' entry in the<installdir>/samples/ibmdb/build.xml
file. For example for Windows:<property name='jviews.sample.manifest.classpath' value='file:///d:/oracle/java/ojdbc-14.jar'/>
For example for Linux and Unix:<property name='jviews.sample.manifest.classpath' value='file://opt/oracle/java/ojdbc-14.jar'/>
-
To be able to retrieve raster data from your database, you need the oracle xdb.jar and xmlparserv2.jar
libraries.
They are part of Oracle XDK 10g installation, that is available here.
Copy these 2 jar files from your Oracle XDK 10g installation (in the /lib folder) into the<JVIEWS_INSTALL_DIR>/jviews-maps900/lib/external/
folder. Jar names must be xdb-10.2.0.1.0.jar and xmlparserv2-10.2.0.1.0.jar.
If your Oracle XDK 10g installation contains newer versions of these libraries, you must edit thebuild.xml
file of this sample to specify their names instead. - Clean and rebuild the sample by calling clean.bat followed by build.bat
-
Edit the
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
jviews-mapbuilder.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
- Load Perforce JViews Maps files.
- Save Perforce JViews Maps files.
- Import Map Data.
- Export Map Data.
Detailed Description
See "Using the Map Builder" in the main documentation section.
Installation Directory
The Using the Map Builder as a Starting Point sample is installed here.
Classes Involved
- ilog.views.maps.IlvAltitudeDataSource
- ilog.views.maps.IlvAttributeInfoProperty
- ilog.views.maps.IlvAttributeProperty
- ilog.views.maps.IlvCoordinate
- ilog.views.maps.IlvCoordinateSystemProperty
- ilog.views.maps.IlvDisplayPreferences
- ilog.views.maps.IlvDisplayPreferencesProperty
- ilog.views.maps.IlvMapLayerTreeProperty
- ilog.views.maps.IlvMapScaleLimiter
- ilog.views.maps.IlvMapUtil
- ilog.views.maps.beans.IlvDataSourcePanel
- ilog.views.maps.beans.IlvJAdvancedZoomControl
- ilog.views.maps.beans.IlvJAreaOfInterestPanel
- ilog.views.maps.beans.IlvJAutomaticScaleBar
- ilog.views.maps.beans.IlvJCoordinateSystemEditorPanel
- ilog.views.maps.beans.IlvJDisplayPreferencesEditorPanel
- ilog.views.maps.beans.IlvJMapLegend
- ilog.views.maps.beans.IlvJMapScaleControl
- ilog.views.maps.beans.IlvJMouseCoordinateViewer
- ilog.views.maps.beans.IlvLayerTreePanel
- ilog.views.maps.beans.IlvMapLayer
- ilog.views.maps.beans.IlvMapLayerTreeModel
- ilog.views.maps.beans.IlvMapLegendPanel
- ilog.views.maps.datasource.IlvMapDataSourceModel
- ilog.views.maps.datasource.IlvMapDataSourceProperty
- ilog.views.maps.datasource.IlvShapeDataSource
- ilog.views.maps.graphic.IlvMapSelectionFactory
- ilog.views.maps.graphic.style.IlvMapCompositeStyle
- ilog.views.maps.interactor.IlvManagerViewRotateInteractor
- ilog.views.maps.interactor.IlvMapPanInteractor
- ilog.views.maps.interactor.IlvMapZoomInteractor
- ilog.views.maps.measures.IlvMakeMeasureInteractor
- ilog.views.maps.projection.IlvProjectionUtil
- ilog.views.maps.raster.IlvRasterTemporaryFileManager
- ilog.views.maps.srs.coordsys.IlvCoordinateSystem
- ilog.views.maps.srs.coordsys.IlvGeographicCoordinateSystem
- ilog.views.maps.srs.coordsys.IlvProjectedCoordinateSystem
- ilog.views.maps.srs.coordtrans.IlvCoordinateTransformation
- ilog.views.maps.srs.coordtrans.IlvCoordinateTransformationException
Source Files
- shared/BaseDemo
- shared/MapBuilder
- plugins/ASRPLoadAction
- plugins/BasicImageLoadAction
- plugins/CADRGLoadAction
- plugins/DefaultLoadAction
- plugins/DTEDLoadAction
- plugins/GeotiffLoadAction
- plugins/GTopo30LoadAction
- plugins/ImportAction
- plugins/ImportManager
- plugins/LoadDataRunnable
- plugins/MIDMIFLoadAction
- plugins/ShapeLoadAction
- plugins/TigerLoadAction
- plugins/S57LoadAction
- plugins/USRPLoadAction
- plugins/VMAPLoadAction
- utils/IvlFileManager
- utils/CoordinateSystemDictionaryManager