[Mapserver-users] RE: Oracle Spatial Support
Frank Warmerdam
warmerdam at pobox.com
Wed Apr 16 23:14:23 PDT 2003
Timothy.Mackey at ga.gov.au wrote:
> Hi Frank,
>
> I'm using the native Oracle Spatial support in mapserver and have found limitations in it in terms of labelling and querying not being supported.
>
> Does OGR have the same limitations? If not, I will try using OGR for my Oracle Spatial data.
>
> I'm not sure what syntax to put in my map file to tell mapserver to use Oracle Spatial via OGR (and not try for the native support). Can you post an example LAYER block to this list or the Wiki?
Tim,
The syntax is the typical OGR syntax, but the "datasource" name in OGR-speak
would be something of the form "OCI:<userid>/<password>@<machine>". In the
mapfile this would look something like:
LAYER
NAME poly
TYPE polygon
CONNECTIONTYPE OGR
CONNECTION "OCI:warmerda/password at gdal800.dreadfest.com,poly"
STATUS default
...
In this case the table to be access is "poly", and it is assumed there
is only one geometry column.
I would suggest you first download and build OGR with Oracle support, and
verify that you are getting proper responses from "ogrinfo" against
Oracle Spatial, and then try using it in MapServer.
Note, in MapServer 3.7 the preferred OGR syntax is now:
CONNECTION "<datasource_name>"
DATA "<layer_definition>"
The layer definition can be a layer name, number or an SQL query (even
when the datastore is not an RDBMS ... though with limitations).
For instance, the test suite uses this to test OGR join support in a mapfile:
LAYER
NAME shppoly
TYPE polygon
CONNECTIONTYPE OGR
CONNECTION "data/shppoly.shp"
DATA "SELECT eas_id, idlink.Name FROM poly LEFT JOIN idlink ON poly.eas_id = idlink.eas_id"
STATUS default
CLASSITEM "idlink.Name"
CLASS
NAME "selected"
COLOR 0 0 255
OUTLINECOLOR 255 0 0
EXPRESSION "_158_"
END
CLASS
NAME "normal"
COLOR 0 255 0
OUTLINECOLOR 255 0 0
END
END
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the MapServer-users
mailing list