class myPythonFactory(object):
def __init__(self):
self.count_features = 0
self.logger = pyfme.FMELogfile()
def input(self,feature):
uwi = str(feature.getAttribute('WELL_ID'))
surf_lat = float(feature.getAttribute('SURF_LAT'))
surf_long = float(feature.getAttribute('SURF_LONG'))
x_offset = float(feature.getAttribute('XOFFSET'))
y_offset = float(feature.getAttribute('YOFFSET'))
z_depth = float(feature.getAttribute('TVD'))
#myCSMan = pyfme.FMECoordSysManager() defined in startup python
fmeParams['PARM1'] = str(surf_long)
fmeParams['ORG_LAT'] = str(surf_lat)
myfmeCS = myCSMan.defineCoordSys(fmeParams, "myfmeCS")
pointF = pyfme.FMEFeature()
pointF.resetCoords()
pointF.setDimension(3)
pointF.addCoordinates([x_offset], [y_offset], [z_depth])
pointF.setGeometryType(pyfme.FME_GEOM_POINT)
pointF.performFunction("@Reproject(" + myfmeCS + ",LL27)")
myCoords = pointF.getCoordinates()
ll = myCoords[0]
long = float(ll[0])
lat = float(ll[1])
z = float(ll[2])
self.logger.log("surf_lat = " + str(surf_lat) + " surf_long = " + str(surf_long) +
" x_offset = " + str(x_offset) + " y_offset = " + str(y_offset) +
" z_depth = " + str(z_depth) + " lat = " + str(lat) +
" long = " + str(long) + " z = " + str(z))
#set lat/long
feature.setAttribute('LATITUDE',str(lat))
feature.setAttribute('LONGITUDE',str(long))
#self.logger.log('Processing uwi: ' + uwi)
self.pyoutput(feature)
def close(self):
self.logger.log('Total features processed: ' + str(self.count_features))
I would expect for this point, the result (long,lat) would be equal to (surf_long,surf_lat). But it is not. The results is
surf_lat = 28.6407318 surf_long = -87.9960175 x_offset = 0.0 y_offset = 0.0 z_depth = 0.0 lat = 28.6404917546 long = -87.9960290212 z = 0.0
which is about 180 feett off what it should be. I also tried LL27-48 et al, the results are the same as LL27.
However, if I change LL27 to LL-WGS84, the resulting (long,lat) will be the exactly the same as (surf_long,surf_lat):
surf_lat = 28.6407318 surf_long = -87.9960175 x_offset = 0.0 y_offset = 0.0 z_depth = 0.0 lat = 28.6407318 long = -87.9960175 z = 0.0.
What I need to do to make LL27 reprojection correct?
Allen Guan
Nexen USA