[gdal-dev] OGR, Oracle Spatial and styleitem auto.

Jelmer Baas Baas at speerit.nl
Mon May 25 10:08:43 EDT 2009


> > I'm using OGR and MapServer to retreive and draw data from Oracle
> > Spatial. I'm using the styleitem auto tag in my mapfile, so that OGR
> > figures out the style automaticly.
> 
> Jelmer,
> 
> The existing Oracle OCI driver does not return style information for
> features from Oracle, so generally speaking styleitem auto in 
> MapServer
> will not do anything useful against Oracle.
> 
> > My test data is a number of polylines. I can change the color of the
> > line by setting PEN(c:#00ff00), but changing the line width 
> doesn't seem
> > to work. When I try PEN(c:#00FF00,w:10px), nothing happens. 
> I tried this
> > with px, pt, cm, big numbers, low numbers, nothing works. 
> > 
> > Am I doing something wrong, here? 
> 
> I'm not sure how you are trying to associate styles with 
> features, so it
> is hard to comment.
> 
> > Also, I couldn't find anything in the documentation about multiple
> > styles per object. In MapInfo it's possible to have a 2px 
> red line with
> > a black border, or a red dashed line with a blue background, for
> > example. Is that also possible in the OGR style?
> 
> Style tools can be concatenated with a semicolon seperator.
> 
> My suggestion would be that you do mapserver styling using mapserver
> class/style primatives rather than trying to use OGR styling 
> and styleitem
> auto.  Styleitem auto is most useful with formats like dgn, 
> and mapinfo that
> have extensive styling information intrinsic in the source data.

Frank,

Thank you for your reply. I posted the original question (about OGR and
styleitem auto) in the MapServer mailing list, and got my answer there
from Tamas. Quote: "If you are using OGR to access the Oracle Spatial
data source, you could specify a valid OGR style string in the table by
adding field with name: 'OGR_STYLE'. In this case OGR will extract the
feature style automatically when using the STYLEITEM "AUTO" option with
this OGR layer."

This works like a charm. I also posted my question about linewidth
there, and Daniel answered a few minutes ago that I need to add a
"default-circle" symbol in my symbol file. This also works perfectly.
Before that, Tamas suggested that I posted this question in the gdal
mailing list.

I apologize for the mailing list spam. I did learn something new though,
about the ;-operator in the style tool.

Thanks for taking the time to respond.

Regards,
Jelmer Baas



More information about the gdal-dev mailing list