publishing Oracle view in Geoserver

Beside tables that are default you can also publish views. To publish Oracle database view in geoserver
you must add metadata in MDSYS schem.
You also must know that when you publish view on geoserver you can not use WFS-T(insert, update) on that feature.

So first:
1. create view
2. insert metadata (reference to select Table)
INSERT    INTO MDSYS.SDO_GEOM_METADATA_TABLE
    (SDO_OWNER, SDO_TABLE_NAME, SDO_COLUMN_NAME, SDO_DIMINFO, SDO_SRID)
    SELECT SDO_OWNER,  'MY_GEOM_VIEW', SDO_COLUMN_NAME, SDO_DIMINFO, SDO_SRID
        FROM MDSYS.SDO_GEOM_METADATA_TABLE WHERE SDO_TABLE_NAME = 'MY_GEOM_TABLE';
3. publish on geoserver.

So you see it's not complicated. :]

Comments

Popular Posts