Fellow Listers,
This is for people who write custom reader/writers using fmeobjects and
C++;
I have developed a custom formatter for an internal format. The problem
- there are 2 attributes which do not appear when using workbench
(2006GB build 2651). The attributes work fine in the Viewer. Following
are snippets of code from the read method and readschema method. The 2
attributes are XCoord and YCoord.
readSchema:
feature.setFeatureType("SURFACE");
feature.setAttribute("wcs_type", "char(30)");
feature.setAttribute("API Number", "char(14)");
feature.setAttribute("OperatorName","char(32)");
feature.setAttribute("LeaseName","char(32)");
feature.setAttribute("WellNumber","char(16)");
feature.setAttribute("FieldName","char(32)");
feature.setAttribute("Updatedate","char(12)");
feature.setAttribute("Survey","char(26)");
feature.setAttribute("Completiondate","char(10)");
feature.setAttribute("Depth","char(10)");
feature.setAttribute("Finalstatus","char(5)");
feature.setAttribute("Documentsource","char(2)");
feature.setAttribute("Metacode","char(2)");
feature.setAttribute("Elevation","char(10)");
feature.setAttribute("XCoord","integer");
feature.setAttribute("YCoord","integer");
feature.setAttribute("TobinGrid","char(10)");
feature.setAttribute("StatePlaneZone","char(3)");
read:
FME_Int32 statePlane_X;
strncpy(tempBuff,hdr0+165,10);
tempBuff[10] = '\0';
statePlane_X = atoi(tempBuff);
FME_Int32 statePlane_Y;
strncpy(tempBuff,hdr0+175,10);
tempBuff[10] = '\0';
statePlane_Y = atoi(tempBuff);
feature.setFeatureType("SURFACE");
feature.setAttribute("fme_color","1,0,0");
feature.setAttribute("wcs_type","wcs_point");
feature.setAttribute("fme_type","fme_point");
feature.setAttribute("API Number", api);
feature.setAttribute("OperatorName",operatorName);
feature.setAttribute("LeaseName",leaseName);
feature.setAttribute("WellNumber",wellNumber);
feature.setAttribute("FieldName",fieldName);
feature.setAttribute("Updatedate",updateDate);
feature.setAttribute("Survey",survey);
feature.setAttribute("Completiondate",compDate);
feature.setAttribute("Depth",totalDepth);
feature.setAttribute("Finalstatus",wellFinalStatus);
feature.setAttribute("Documentsource",documentCode);
feature.setAttribute("Metacode",metaCode);
feature.setAttribute("XCoord",statePlane_X);
feature.setAttribute("YCoord",statePlane_Y);
feature.setAttribute("TobinGrid",tobinGrid);
feature.setAttribute("StatePlaneZone",statePlaneZone);
feature.setAttribute("Elevation",elevation);
feature.addCoordinate(coordX[0],coordY[0]);
feature.setGeometryType(FME_GEOM_POINT);
endOfFile = FME_FALSE;
Sorry for the cross post but I'm at a total loss for the source of the
problem.
TIA
Bob
-----------
L. Robert Rice
P2 Energy Solutions
216 16th Street Suite 1700
Denver CO 80202
720-493-6663
The information contained in this communication is confidential and is
intended only for the use of the addressee. It is the property of P2
Energy Solutions. Any unauthorized use, disclosure or copying of this
communication or any part thereof is strictly prohibited and may be
unlawful. If you have received this communication in error, please
notify us immediately and destroy this communication and all copies
thereof, including all attachments.