Changeset 38 for trunk/zoo-services/ogr


Ignore:
Timestamp:
Oct 23, 2010, 4:49:28 PM (14 years ago)
Author:
djay
Message:

Add specific error messages returned to the ZOO Kernel when the service failed. Correct the zcfg file for the Ogr2oOgr service. Use the GDALmake.opt file from the gdal source tree to get the correct flags for compilation.

Location:
trunk/zoo-services/ogr/ogr2ogr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-services/ogr/ogr2ogr/Makefile

    r1 r38  
    1 GDAL_SRC=/var/tmp/portage/sci-libs/gdal-1.6.1/work/gdal-1.6.1/ogr/
    2 CFLAGS=-I$(GDAL_SRC) -I../../../zoo-kernel-svn/ -I./ `xml2-config --cflags` `python-config --cflags` -DLINUX_FREE_ISSUE #-DDEBUG
    3 CC=gcc
     1GDAL_SRC=./gdal_src/
    42
    5 cgi-env/ogr2ogr_service.zo: service.c
    6         g++  -DZOO_SERVICE ${CFLAGS} -shared -fpic -o cgi-env/ogr2ogr_service.zo ./service.c -lgdal
     3include $(GDAL_SRC)GDALmake.opt
     4
     5CPPFLAGS        :=      $(GDAL_INCLUDE) -I$(GDAL_ROOT)/frmts $(CPPFLAGS)
     6DEP_LIBS        =       $(EXE_DEP_LIBS) $(XTRAOBJ)
     7BIN_LIST = cgi-env/ogr2ogr_service.zo
     8
     9default:        $(BIN_LIST)
     10
     11all: default
     12
     13lib-depend:
     14        (cd $(GDAL_SRC)/gcore ; $(MAKE) )
     15        (cd $(GDAL_SRC)/port ; $(MAKE) )
     16
     17CFLAGS=-DZOO_SERVICE -I../../../zoo-kernel/
     18
     19#cgi-env/ogr2ogr_service.zo: service.c
     20#       g++  -DZOO_SERVICE ${CFLAGS} -shared -fpic -o cgi-env/ogr2ogr_service.zo ./service.c -lgdal
     21
     22cgi-env/ogr2ogr_service.zo: service.c $(DEP_LIBS)
     23        g++ $(CFLAGS) $(CPPFLAGS) -shared -fpic $< `gdal-config --libs` -o $@
    724
    825clean:
    9         rm -f cgi-env/*.zo
     26        rm -f cgi-env/*zo
  • trunk/zoo-services/ogr/ogr2ogr/cgi-env/Ogr2Ogr.zcfg

    r1 r38  
    11[Ogr2Ogr]
    2  Title = Convert raster data from one format to another.
    3  Abstract = Converts raster data between different formats.
     2 Title = Convert vector data from one format to another.
     3 Abstract = Converts vector data between different formats.
    44 processVersion = 1
    55 storeSupported = true
     
    77 serviceType = C
    88 serviceProvider = ogr2ogr_service.zo
    9  <MetaData lang="en">
    10    title = My Demo
     9 <MetaData>
     10   Title = My Demo
    1111 </MetaData>
    1212 <DataInputs>
     
    1919    DataType = string
    2020    <Default>
    21      value = AAIGrid
     21     value = ESRI ShapeFile
    2222    </Default>
    2323    <Supported>
    24      value = AAIGrid
    2524    </Supported>
    2625   </LiteralData>
     
    3332    DataType = string
    3433    <Default>
    35      uom = feet
    3634    </Default> 
    3735    <Supported>
    38      value = AAIGrid
    3936    </Supported>
    4037   </LiteralData>
    4138  [OutputDSN]
    4239   Title = The output data source name
    43    Abstract = The output data source name to use as source for convertion.
     40   Abstract = The full path of the output data source name created.
    4441   minOccurs = 1
    4542   maxOccurs = 1
     
    4744    DataType = string
    4845    <Default>
    49      uom = feet
    5046    </Default> 
    5147    <Supported>
    52      value = AAIGrid
    5348    </Supported>
    5449   </LiteralData>
     
    6156    DataType = string
    6257    <Default>
    63      uom = feet
    6458    </Default> 
    6559    <Supported>
    66      value = AAIGrid
    6760    </Supported>
    6861   </LiteralData>
  • trunk/zoo-services/ogr/ogr2ogr/service.c

    r1 r38  
    101101        {
    102102                fprintf(stderr,"Not correct version of the gdal library\n");
     103                setMapInMaps(conf,"lenv","message","Unable to check gdal version for ogr2ogr_service.zo");
    103104                return SERVICE_FAILED;
    104105        }
     
    548549        Usage();
    549550#ifdef ZOO_SERVICE
     551                setMapInMaps(conf,"lenv","message","Wrong parameter");
    550552                return SERVICE_FAILED;
    551553        }
     
    575577        }
    576578#ifdef ZOO_SERVICE
     579                char tmp[1024];
     580                sprintf(tmp,"Unable to open datasource `%s' with the following drivers.",pszDataSource);
     581                setMapInMaps(conf,"lenv","message",tmp);
    577582                return SERVICE_FAILED;
    578583#else
     
    595600                    pszDestDataSource );
    596601#ifdef ZOO_SERVICE
     602                char tmp[1024];
     603                sprintf(tmp,"Unable to open existing output datasource `%s'.",pszDestDataSource);
     604                setMapInMaps(conf,"lenv","message",tmp);
    597605                return SERVICE_FAILED;
    598606#else
     
    637645            }
    638646#ifdef ZOO_SERVICE
     647                        char tmp[1024];
     648                        sprintf(tmp,"Unable to find driver `%s'.",pszFormat);
     649                        setMapInMaps(conf,"lenv","message",tmp);
    639650                        return SERVICE_FAILED;
    640651#else
     
    648659                    pszFormat );
    649660#ifdef ZOO_SERVICE
     661                        char tmp[1024];
     662                        sprintf(tmp,"%s driver does not support data source creation.",pszFormat);
     663                        setMapInMaps(conf,"lenv","message",tmp);
    650664                        return SERVICE_FAILED;
    651665#else
     
    663677                    pszFormat, pszDestDataSource );
    664678#ifdef ZOO_SERVICE
     679                        char tmp[1024];
     680                        sprintf(tmp,"%s driver failed to create %s",pszFormat, pszDestDataSource);
     681                        setMapInMaps(conf,"lenv","message",tmp);
    665682                        return SERVICE_FAILED;
    666683#else
     
    681698                    pszOutputSRSDef );
    682699#ifdef ZOO_SERVICE
     700                        char tmp[1024];
     701                        sprintf(tmp,"Failed to process SRS definition: %s",pszOutputSRSDef);
     702                        setMapInMaps(conf,"lenv","message",tmp);
    683703                        return SERVICE_FAILED;
    684704#else
     
    699719                    pszSourceSRSDef );
    700720#ifdef ZOO_SERVICE
     721                        char tmp[1024];
     722                        sprintf(tmp,"Failed to process SRS definition: %s",pszOutputSRSDef);
     723                        setMapInMaps(conf,"lenv","message",tmp);
    701724                        return SERVICE_FAILED;
    702725#else
     
    752775                    iLayer );
    753776#ifdef ZOO_SERVICE
     777                        char tmp[1024];
     778                        sprintf(tmp,"Couldn't fetch advertised layer %d!",iLayer);
     779                        setMapInMaps(conf,"lenv","message",tmp);
    754780                        return SERVICE_FAILED;
    755781#else
     
    780806
    781807#ifdef ZOO_SERVICE
     808                                char tmp[1024];
     809                                sprintf(tmp,"Terminating translation prematurely after failed of layer %s",poLayer->GetLayerDefn()->GetName() );
     810                                setMapInMaps(conf,"lenv","message",tmp);
    782811                                return SERVICE_FAILED;
    783812#else
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png