答复: [gdal-dev] Why cannot I get all fields from s57 files with method GetFieldAsString?

Randy randyqiuxy at hotmail.com
Sun Sep 27 09:21:35 EDT 2009


Mr Chaitanya and list,
   You are so kind and help me again and again. Thanks for your help very much!
Now, I can get more fields of a feature like ORNT、USAG after setting environment variable OGR_S57_OPTIONS =
"RETURN_LINKAGES=ON,RETURN_PRIMITIVE=ON,RETURN_REFS=ON".
However, I don’t think I've got the feature's attribute field. For instance, I got a point symbol and its OBJL=159 which means it was a Wreck symbol and I thought I should get some info like CATWRK=.. QUASOU=...if I can get its attribute field.
Then can you tell me whether I can do something else for this?
Thanks a lot!

Best Regards,
Randy


-----邮件原件-----
发件人: Chaitanya kumar CH [mailto:chaitanya.ch at gmail.com] 
发送时间: 2009年9月26日 20:51
收件人: Randy
抄送: GDAL/OGR mailing list
主题: Re: [gdal-dev] Why cannot I get all fields from s57 files with method GetFieldAsString?

Randy,

You need to set the environment variable OGR_S57_OPTIONS =
"RETURN_LINKAGES=ON" for the driver to return the FSPT group
attributes.
It is described in http://www.gdal.org/ogr/drv_s57.html

2009/9/26 Randy <randyqiuxy at hotmail.com>:
> Hi list,
>
> Under Mr Frank and Mr Chaitanya’s guidance, I try to get every feature’s
> field(including its name and value). But I find that I cannot get all
> fields. The following is my code snippet(in MFC):
>
>                     CString strEnd=”\r\n”;
>
>                        int nFieldCount=0;
>
>
> for(nFieldCount=0;nFieldCount<poFeature->GetFieldCount();nFieldCount++)
>
>                        {
>
>
> poFieldDefn=poFeature->GetFieldDefnRef(nFieldCount);
>
>                            fieldName=poFieldDefn->GetNameRef();
>
>
> fileFieldAttr.Write(fieldName,strlen(fieldName));
>
>
>     outputFieldAttr=poFeature->GetFieldAsString(nFieldCount);
>
>
> fileFieldAttr.Write(outputFieldAttr+strEnd,strlen(outputFieldAttr)+2);
>
>                        }
>
> Then, what I got was as follows:
>
> RCID3
>
> PRIM1
>
> GRUP2
>
> OBJL9
>
> RVER1
>
> AGEN550
>
> FIDN344289455
>
> FIDS2233
>
> LNAM0226148570AF08B9
>
> LNAM_REFS(2:02261485702E08B9,02261485703208B9)
>
> FFPT_RIND(2:2,2)
>
> RCID4
>
> PRIM1
>
> GRUP2
>
> OBJL39
>
> …………
>
>
>
> It means that I didn’t get the feature’s attribute field(ATTF) like
> ATTL、ATVL and feature’s FSPT field(Feature Record to Spatial Record Pointer)
> like ORNT、USAG、MASK.
>
> Then who can tell me what’s wrong with my code?
>
> Thanks a lot!!!
>
>
>
> Best Regards,
>
> Randy.
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.



More information about the gdal-dev mailing list