Howto: SDE attribute domains & getfeatureinfo

Howard Butler hobu.inc at GMAIL.COM
Mon Jan 14 20:45:27 PST 2008


On Jan 14, 2008, at 9:50 AM, Diego Guidi wrote:

> I'm playing with Mapserver 5.0 WMS support, and I'm very happy to look
> at how mapserver is fast reading a lot of data from a SDE/Oracle
> datasource and serving them as WMS server, but... I need to know if
> it's possible to show attribute domains.
> Let me explain: i have a large dataset and a set of sde data sources
> that have attributes mapped to "attribute domains".
> This means that for my road table i have an attribute called TYPES
> that contains values like 01, 02, 03 and more...
> values for this codes are in another table in SDE database that
> contains values like 01 = highway, 02 = simple road, and more...
> When i use getfeatureinfo i need to show the "real" values of my
> attributes (highway, simple road, ecc...) but at this time MapServer
> (and GeoServer too...) shows the codes (10, 02, 03)...
> Any suggestion to resolve this problem? I need to manually query the
> SDE db, or MapServer it's able to do all this work if correctly
> configured?

Neither MapServer no GeoServer will fetch the domain values because  
they are contained in the "GeoDatabase", not in SDE proper.  Or, to  
put it more precisely, the ArcSDE SDK doesn't know anything (or at  
least very little) about table linkages that ArcObjects et. al. use on  
top of the storing the spatial data and attributes in the database.   
This means things like topology and attribute domains are not  
available to the SDKs, and therefore, not available to MapServer or  
GeoServer using the methods that we use to connect to ArcSDE.

Using a parallel connection to the database, say using OCI, you could  
follow the table linkages to get your domain values.  A simple  
approach would be to write a script that connects to Oracle using your  
favorite scripting language and emits mapfile CLASS/LABEL information  
for each of the domain tables that you wish to map.   Then use the  
snazzy INCLUDE syntax to pull in just your definitions for the layers  
(utilizing some sort of naming scheme). Not overly elegant or at all  
dynamic, but one way to do the job.

Howard



More information about the MapServer-users mailing list