[Gdal-dev] OGR to access s57 file
Frank Warmerdam
warmerdam at pobox.com
Mon Aug 28 18:22:39 EDT 2006
kiruba nantham wrote:
> Dear sir,
>
> i am trying to make one ENC file reader using c++ language. i
> just want to know how to diffentiate objects are in the ENC file using
> OGR library? for example there are many wreaks in the ENC file how to
> sepate them as a ship wreak, dangerous wreak etc.. which OGR funtions i
> should use? if it is possible please give some example program.
Kiruba,
My suggestion is that you review the S-57 documentation carefully to see
if there are attributes that allow you to meaningfully differentiate
different kinds of wrecks. Once you know how it is indicated in the S-57
data model it shouldn't be too hard to get the information out of OGR.
When I dump the WRECKS layer in an S-57 dataset the features look like:
OGRFeature(WRECKS):2163
RCID (Integer) = 2164
PRIM (Integer) = 1
GRUP (Integer) = 2
OBJL (Integer) = 159
RVER (Integer) = 1
AGEN (Integer) = 540
FIDN (Integer) = 2135161787
FIDS (Integer) = 688
LNAM (String) = 021C7F43FBBB02B0
LNAM_REFS (StringList) = (null)
FFPT_RIND (IntegerList) = (null)
CATWRK (Integer) = 1
CONRAD (Integer) = (null)
CONVIS (Integer) = (null)
EXPSOU (Integer) = (null)
HEIGHT (Real) = (null)
NOBJNM (String) = (null)
OBJNAM (String) = (null)
QUASOU (String) = 2
SOUACC (Real) = (null)
STATUS (String) = (null)
TECSOU (String) = (null)
VALSOU (Real) = (null)
VERACC (Real) = (null)
VERDAT (Integer) = (null)
VERLEN (Real) = (null)
WATLEV (Integer) = 3
INFORM (String) = (null)
NINFOM (String) = (null)
NTXTDS (String) = (null)
SCAMAX (Integer) = (null)
SCAMIN (Integer) = (null)
TXTDSC (String) = (null)
RECDAT (String) = (null)
RECIND (String) = (null)
SORDAT (String) = (null)
SORIND (String) = (null)
POINT (61.1031909 -32.4450159)
Hmm, looking in the gdal/data/s57expectedinput.csv file I see that
the CATWRK field can have the following values:
71,1,non-dangerous wreck
71,2,dangerous wreck
71,3,distributed remains of wreck
71,4,wreck showing mast/masts
71,5,wreck showing any portion of hull or superstructure
So, I think what you need to do is fetch the CATWRK feature attribute
from WRECKS, and compare the value to the range above (1-5). So
looking at the s57expectedinput.csv file will help you identify what
integer values for some fields correspond with what textual strings.
But generally speaking the best reference is the S-57 specification.
Best regards,
--
---------------------------------------+--------------------------------------
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 | President OSGeo, http://osgeo.org
More information about the Gdal-dev
mailing list