[mapserver-users] OGR Attributes
Jeff McKenna
jmckenna at gatewaygeomatics.com
Tue Mar 21 11:54:27 PDT 2017
Hi Flavio!
The section you are referring to is specially for accessing label styles
through MapScript
(http://mapserver.org/input/vector/ogr.html#accessing-ogr-styleitemauto-label-styles-through-mapscript).
So I have now tested and confirmed that with MapServer 7.0.4 (MS4W
3.2.1) I can access the "OGR:LabelText" style, on a MapInfo .TAB file,
through PHP MapScript as follows:
// open map
$oMap = ms_newMapObj( "D:/ms4w/apps/ogr-demos/nfld_demo/test.map" );
//get layer
$oLayer = $oMap->getLayerByName("Map_Labels");
//get styles
$status = $oLayer->open();
$status = $oLayer->whichShapes($oMap->extent);
while ($oShape = $oLayer->nextShape())
{
//echo $oShape->index ."<br>\n";
echo $oShape->getValue($oLayer,"OGR:LabelText");
echo "\n";
}
$oLayer->close();
My mapfile layer is as follows:
LAYER
NAME "Map_Labels"
TYPE POINT
STATUS ON
CONNECTIONTYPE OGR
CONNECTION "data/nfld/Map_Labels.TAB"
STYLEITEM "AUTO"
CLASS
NAME "Map_Labels"
END
PROCESSING "GETSHAPE_STYLE_ITEMS=all"
END # Layer
-jeff
--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/
On 2017-03-18 2:53 AM, Flavio Hendry wrote:
> Hello all
>
> As it seems a whole bunch of Label Attributes are read and can be used
> in a MapFile, such as OGR:LabelText, OGR:LabelAngle. However, OGR
> attributes such as BRUSH.id, BRUSH.fc etc. are not accessible, even if
> there is a long section mentioning a ton of them:
> http://www.mapserver.org/input/vector/ogr.html
>
> the directive PROCESSING "GETSHAPE_STYLE_ITEMS=all" does no help either ...
>
> I would like i.e. to use an expression such as:
> EXPRESSION ([OGR:BRUSH.id] = ".....")
>
> Anyone an idea?
>
>
More information about the MapServer-users
mailing list