Note: you cannot directly create a database (except from a LorikGISMapper transfer), this operation is usually done by the database administrator. You first have to create a document and then use the "Save as..." function.
LorikSoftware supports Oracle from version 11g and PostgreSQL from version 8.4 / Postgis 1.5.
This functionality is available with the "Pro" option.
All functions of LorikCartographer remain the same and the dataabse storage does not change the program behavior excepted when you open the file.
When you use a database, two geometries are saved: one using the LorikSoftware format and an associated one (DIGEST).
LorikSoftware format is used to display and to edit data with LorikCartographer. For instance linear objects are stored as Bezier curves.
The "DIGEST" format is used to displayed data with other programs which are able to access a database. All attributes are saved in a set of tables which propose a structured organization of data and their attributes. For instance a table stores the curve types list, another one the text types list, etc. Objects are stored using the following scheme:
Opened curves are saved as POLYLINE.
Closed curves,rectangles and ellipses are saved as POLYGON.
Flat texts and symbols are saved as POINT.
Extended attributes can be also directly managed inside the database.
You first need to get the necessary skills to install and use a Oracle database (Spatial option is not required, only Locator is mandatory). Database has to use the character set AL32UTF8.
For CREATE USER syntax, at least the following options have to be used:
CREATE USER User identified by Pw;
GRANT CONNECT, RESOURCE, SELECT ANY TABLE TO User;
ALTER USER User QUOTA UNLIMITED ON TABLESPACE Tablespace;
An Oracle client has to be installed on every computer which accesses the database. You can download it at:
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
In LorikCartographer, we use Oracle C++ Call Interface (OCCI) technology. So you need to install OCCI. You can download it at:
http://www.oracle.com/technetwork/database/occidownloads-083553.html (vs2010 for Windows 64bits or 32bits)
Instant client folder currently contains vc8 and vc9. You have to create vc10 folder and unzip your occi download inside.
Then you must ensure that the corresponding DLL is located in the Windows system path. The following panel displays the path variable content when you use Oracle 11g on x64 system:
LorikSoftware version 5 need to use the DLL located in \instantclient_11_2_x64\vc10, so this value must be displayed first, even if the corresponding DLL also exist in \instantclient_11_2_x64.
If you want to save an existing ".lkc" file, the georeferencing needs to use a projection from the Proj4 library is you want the associated geometry uses kilometric or geographic coordinates. You cannot save a multi-user ".lkc" file.
You first need to get the necessary skills to install and use a PostgreSQL database with the PostGIS option.
You have to create a database. You then need to create both "geometry_columns" and "spatial_ref_sys" tables from the PostGIS package.
If you want to save an existing ".lkc" file, the georeferencing needs to use a projection from the Proj4 library is you want the associated geometry uses kilometric or geographic coordinates. You cannot save a multi-user ".lkc" file.
LorikCartographer uses SQL scripts stored in the "..\Lorik Software\Resources\DB_Readers\Oracle11g\SqlPlus_Cmds" directory or in the "..\Lorik Software\Resources\DB_Readers\PostgreSLQ\SqlPlus_Cmds" directory. These scripts are automatically run by the program. You just have to previously create the database.
1 |
If you want to use a prefix for all tables, edit the "PREFIX_TABLE.SQL" file and enter the name of the prefix between quotes. This enables the creation of several set of tables for one user. If you don't want to use a prefix, do not enter a name. The content of this file is used by all other SQL scripts so you have to store the "PREFIX_TABLE.SQL" file in the same directory as the other scripts. |
|
2 |
Once the file opened, click on the /File/Save as.../ menu. The opposite panel is displayed. Select the "Oracle Database" or "PostgreSQL" option and click [OK] |
|
3 |
Either you have to enter the following information to connect to the database: For Oracle: Database instance : enter the name of the instance User: name of the user Password: password of the user Tables prefix: prefix of the set of tables you want to open. It corresponds to the prefix you entered in the "PREFIX_TABLE.SQL" file. For PostgreSQL: Host name: name of the computer which hosts the database Host IP address: IP address of the computer which hosts the database Port Number: port number used to access the database on the computer where this database is stored.
Or you can directly select a saved connection in the corresponding pop-up menu. If you click [Manage], you open Database connection manager panel (See Database connection manager chapter)
Then click on [OK] |
Oracle: PostgreSQL: |
4 |
The following panel is use to define the coordinates format for the associated geometry. Coordinate system type Three options are available:
The two last options are available only if you have defined a georeferencing using a Proj4 projection.
Flattening tolerance This value corresponds to the maximum authorized gap between the original curve and the resulting polyline (or polygon): This value is entered either in paper coordinates or in ground meter using the selected georeferencing. Click on [OK]
|
|
5 |
The internal storage mode allows to manage and to associate extended attributes directly to the DIGEST tables inside the database. LorikCartographer automatically creates DIGEST tables per family of curve type, text type and symbol type. The name of the table is defined as following: "Family type"_"family ID"_geometry Family type: curve, symbol or text Family ID: corresponds to the family ID used for the database storage (displayed in the extended attributes management panel and in the graphical template panel when extended attributes are displayed in this panel). Geometry: pl for polylines, pg pour polygons and pt for points. The DIGEST tables list is available in the "digest_table" table: Then you can create and manage extended attributes by table. These attributes are visible when you load data in LorikCartographer. For more details please refer to the "Extended Attributes" chapter.
|
|
6 |
Once this operation completed the saving is starting. The saving time depends of the size of the file to be saved and can take several minutes |
|
7 |
Once the file saved, the new name of the document is displayed in the title bar as: ORACLE - user[database instance (prefix)] or POSTGRESQL - user[database instance (prefix)] |
|
8 |
When you quit the document the following panel is displayed:
LorikCartographer unlocks the database or the part of the database it has locked when opening. Once the unlocking done, database is available again.
|
Starting from now all modifications brought to data or parameters of the document are directly saved in the database.
For the final user there is no difference between working on a document stored in a ".lkc" file or in a database.
If you click on the File/Optimize the database menu the program applies a set of operations to improve the database performances.
During this process a progression panel is displayed:
In the "..\Lorik Software\Resources\DB_Readers\PostgreSQL\SqlPlus_Cmds" or "..\Lorik Software\Resources\DB_Readers\Oracle\SqlPlus_Cmds" directory there are three other scripts: DROP_ALL_TABLES.sql, DROP_DIGEST_SPATIAL_INDEXES.sql et DROP_SPATIAL_INDEXES.sql
These scripts are used to delete a complete tables set.