Labeling (Database Labeling)

From GeoMedia Smart Client
Jump to: navigation, search
Labeling Database StyleEditor



Contents



Database Labeling means that you are creating an additional feature class representing the label features.

Database Labeling comprises the following 8 steps:


1. Create a new database table for the label feature class. The table holds the following scheme (replace {TABLENAME} by the name of your labeling feature class):


For Oracle
 CREATE TABLE {TABLENAME}_LBL 
 (   
    "ID" VARCHAR2(36 CHAR) NOT NULL ENABLE,
    "GEOMETRY" "MDSYS"."SDO_GEOMETRY" NOT NULL ENABLE,
    "DX"        NUMBER(12,2),
    "DY"        NUMBER(12,2),
    "PARENT_ID" VARCHAR2(36 CHAR) NOT NULL ENABLE,
    "LABEL_ID"  VARCHAR2(36 CHAR) NOT NULL ENABLE
 );
 ALTER TABLE "{TABLENAME}_LBL" ADD CONSTRAINT "PK_{TABLENAME}_LBL" PRIMARY KEY ("ID") ENABLE;


For SQL Server
 CREATE TABLE {TABLENAME}_LBL 
 (      
    "ID" VARCHAR(36) NOT NULL,
    "GEOMETRY" "GEOMETRY" NOT NULL,
    "GEOMETRY_GDO" varbinary(MAX),
    "DX"        FLOAT NULL,
    "DY"        FLOAT,
    "PARENT_ID" VARCHAR(36) NOT NULL,
    "LABEL_ID"  VARCHAR(36) NOT NULL
 );
 ALTER TABLE "{TABLENAME}_LBL" ADD CONSTRAINT "PK_{TABLENAME}_LBL" PRIMARY KEY ("ID");



Blue.png{TABLENAME} has to match exactly the database table name of your labeling feature, because otherwise GMSC Administrator won't recognize it as a label.




Example

test To the top Pfeil new.png

If you want to label feature class which displays streets with a database table called Streets, then the corresponding labeling feature class has to hold the naming convention Streets_LBL:

Labeling1.png


2. Create the spatial index for the newly created table. Please apply 2D coordinate settings as GeoMedia Smart Client only creates 2D labels.

 CREATE INDEX GX_{TABLENAME}_LBL ON {TABLENAME}_LBL (GEOMETRY)
 indextype IS MDSYS.SPATIAL_INDEX parameters
 ('SDO_INDX_DIMS=2 SDO_RTR_PCTFREE=10 SDO_FANOUT=40
 TABLESPACE=USERS INITIAL=64K NEXT=64K MAXEXTENTS=UNLIMITED');



Blue.pngWatch out for the parameter SDO_INDX DIMS. The above mentioned example works for 2 dimensional data.




So for example (projected data) following statement will create the metadata in Oracale:

 INSERT INTO USER_SDO_GEOM_METADATA VALUES ('MYTABLENAME','GEOMETRY', MDSYS.SDO_DIM_ARRAY( 
 MDSYS.SDO_DIM_ELEMENT('X',-2147483648, 2147483648, 0.00005), 
 MDSYS.SDO_DIM_ELEMENT('Y',-2147483648, 2147483648, 0.00005)),NULL);



3. Create the labeling feature class in GeoMedia Smart Client Administrator based on the newly created table. For more information how to create feature classes in GeoMedia Smart Client Administrator visit Features


4. In GeoMedia Smart Client Administrator change the general settings of the labeling feature class as follows:

Labeling2.png


5. Switch to the Label tab of the base feature class (for example Streets):

Start label.PNG

You should now see the newly created labeling feature class.


6. Select the entry and click Apply to link the labeling feature class to the base feature class.


7. Click Add.png to define the labeling settings:

Options label.PNG


Field Description
Label Name Name of the label
Placement Horizontal placement of the label.
Alignment Vertical and horizontal alignment of the label.
Offset (East) Horizontal distance from the feature to the text.
Offset (North) Vertical distance from the feature to the text.
Angle Angle of text.
Pattern The attribute(s) you want to display as a label.
Blue.pngSyntax: {ENTITY.AttributeName}.




Examples:

 {ENTITY.STRNAME}
 {ENTITY.LENGTH}
 LENGTH: {ENTITY.LENGTH} m 
 Diameter: {ENTITY.DIAMETER} m;



8. Click Build button.png to persist the labeling features in the database.



Language: English  • slovenčina