[MS4W-Users] Problem using a feature attribute from an OGR file
Gillis, Allan
Allan.Gillis at drdc-rddc.gc.ca
Thu Mar 16 13:55:13 EDT 2017
Hi all,
I'm using the latest version of MS4W (download a couple days ago). I am using an S57 file, which is supported by OGR, and I'm having a problem. Basically, I want mapserver to draw the depth contours (DEPCNT layer of the file) with the depth written on them. While I have been able to draw any text I want along the contour line, and I'm happy with how it looks, I cannot get the depth attribute (VALDCO) to render.
I've also posted this question here: http://gis.stackexchange.com/questions/232198/using-the-value-of-a-field-in-an-s57-file-with-mapserver-7
Here's what my layer definition looks like:
----------------------------
LAYER
NAME "DEPCNT_CA276241"
TYPE LINE
DUMP true
TEMPLATE fooOnlyForWMSGetFeatureInfo
EXTENT -66.1660611 44.6667528 -63.6660696 46.0000945
DATA "DEPCNT"
METADATA
'ows_title' 'DEPCNT_CA276241'
"gml_include_items" "VALDCO"
"gml_VALDCO_type" "Real"
"gml_VALDCO_precision" "2"
END #metadata"
STATUS ON
CONNECTIONTYPE OGR
CONNECTION "./s57/CA276241.000"
TRANSPARENCY 100
PROJECTION
'proj=longlat'
'datum=WGS84'
'no_defs'
END #projection
LABELITEM 'VALDCO' #doesn't work
CLASS
NAME 'DEPCNT'
STYLE
WIDTH 0.91
COLOR 0 170 255
END #style
LABEL
#TEXT "Hello world" #draws the text Hello world just fine on the contour line
#TEXT ([VALDCO]) #causes 500 error in Apache
#TEXT "[VALDCO]" #nothing is drawn
#TEXT [VALDCO] #getSymbol(): Symbol definition error. Parsing error near (VALDCO):(line 398)
#TEXT VALDCO #draws the string VALDCO on the contour line
SIZE 10
COLOR 255 0 0
ANGLE FOLLOW
POSITION AUTO
FORCE TRUE
ANTIALIAS TRUE
END #label
END #class
END #layer DEPCNT_CA276241
-----------------------------
I admit to flailing around a bit trying various things.... But I can't seem to figure this out. Any suggestions?
I have used ogrinfo to ensure the attribute exists and the value is there and sensible for the features. Here's a sample of the ogrinfo output...
Feature Count: 191
Extent: (-65.250170, 39.416667) - (-41.000061, 53.999982)
Layer SRS WKT:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]
RCID: Integer (10.0)
PRIM: Integer (3.0)
GRUP: Integer (3.0)
OBJL: Integer (5.0)
RVER: Integer (3.0)
AGEN: Integer (5.0)
FIDN: Integer (10.0)
FIDS: Integer (5.0)
LNAM: String (16.0)
LNAM_REFS: StringList (16.0)
FFPT_RIND: IntegerList (1.0)
VALDCO: Real (0.0)
VERDAT: Integer (0.0)
INFORM: String (0.0)
NINFOM: String (0.0)
NTXTDS: String (0.0)
SCAMAX: Integer (0.0)
SCAMIN: Integer (0.0)
TXTDSC: String (0.0)
RECDAT: String (0.0)
RECIND: String (0.0)
SORDAT: String (0.0)
SORIND: String (0.0)
OGRFeature(DEPCNT):1189
RCID (Integer) = 1190
PRIM (Integer) = 2
GRUP (Integer) = 2
OBJL (Integer) = 43
RVER (Integer) = 1
AGEN (Integer) = 50
FIDN (Integer) = 144460
FIDS (Integer) = 30000
LNAM (String) = 00320002344C7530
LNAM_REFS (StringList) = (null)
FFPT_RIND (IntegerList) = (null)
VALDCO (Real) = 200
VERDAT (Integer) = (null)
INFORM (String) = (null)
NINFOM (String) = (null)
NTXTDS (String) = (null)
SCAMAX (Integer) = (null)
SCAMIN (Integer) = 2187500
TXTDSC (String) = (null)
RECDAT (String) = (null)
RECIND (String) = (null)
SORDAT (String) = (null)
SORIND (String) = (null)
LINESTRING (-45.2687992 47.2238193,-45.2670712 47.2386494,-45.2649977
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ms4w.com/mailman/private/ms4w-users/attachments/20170316/43a86698/attachment.html>
More information about the MS4W-Users
mailing list