< Day Day Up > |
Individual S57 data files have an extension of *.000; for example, US1BS02M.000. Data access/connection method
Special notesThe underlying OGR code requires two files from your GDAL/OGR installation when reading S57 data in MapServer: s57objectclasses.csv and s57attributes.csv. These files can be found in the /GDAL/data/ folder. If you receive an error in MapServer such as: msDrawMap(): Image handling error. Failed to draw layer named 's57'. msOGRFileOpen( ): OGR error. GetLayer( 9) failed for OGR connection you may have to point MapServer to these files using the CONFIG parameter in the main section of your map file: CONFIG GDAL_DATA "C:\gdal\data" ogrinfo examplesHere's an example that uses ogrinfo on an S57 file to get the OGR index number: > ogrinfo us1bs02m.000 ERROR 4: S57 Driver doesn't support update. Had to open data source read-only. INFO: Open of 'us1bs02m.000' using driver 'IHO S-57 (ENC)' successful. 1: ADMARE (Polygon) 2: CBLSUB (Line String) 3: CTNARE 4: COALNE (Line String) 5: DEPARE 6: DEPCNT (Line String) 7: LNDARE 8: LNDELV 9: LNDRGN 10: LNDMRK 11: LIGHTS (Point) 12: OBSTRN 13: RDOSTA (Point) 14: SEAARE 15: SBDARE 16: SLCONS 17: SOUNDG (Multi Point) 18: UWTROC (Point) 19: WATTUR 20: WRECKS 21: M_COVR (Polygon) 22: M_NPUB (Polygon) 23: M_NSYS (Polygon) 24: M_QUAL (Polygon) 25: C_ASSO (None) Here's an example that uses ogrinfo to examine the structure of an S57 layer: > ogrinfo us1bs02m.000 DEPARE ERROR 4: S57 Driver doesn't support update. Had to open data source read-only. INFO: Open of 'us1bs02m.000' using driver 'IHO S-57 (ENC)' successful. Layer name: DEPARE Geometry: Unknown (any) Feature Count: 297 Extent: (165.666667, 48.500000) - (180.000000, 60.750000) Layer SRS WKT: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433]] GRUP: Integer (3.0) OBJL: Integer (5.0) RVER: Integer (3.0) AGEN: Integer (2.0) FIDN: Integer (10.0) FIDS: Integer (5.0) LNAM: String (16.0) LNAM_REFS: StringList (16.0) DRVAL1: Real (0.0) DRVAL2: Real (0.0) QUASOU: String (0.0) SOUACC: 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) ... Map file exampleLAYER NAME s57 TYPE POLYGON STATUS DEFAULT CONNECTIONTYPE OGR CONNECTION "./s57/us1bs02m.000, 4" CLASS COLOR 247 237 219 OUTLINECOLOR 120 120 120 END END # Layer |
< Day Day Up > |