Ignore:
Timestamp:
Feb 5, 2018, 1:19:13 PM (6 years ago)
Author:
djay
Message:

Change the default ZOO-Kernel behavior, if an input has been passed by reference, the ZOO-Service will receive a cache_file map rather than the value field which was usually returned, same for array value apply. To use the previous behavior, one can add "memory=load" to the main section of the main.cfg file. Update ZOO-Services for using this new field if available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-services/cgal/cgal_service.c

    r862 r863  
    2626int parseInput(maps* conf,maps* inputs, std::vector<Pointz>* points,char* filename){
    2727  map* tmpm=NULL;
    28   tmpm=getMapFromMaps(inputs,"InputPoints","value");
    29   VSILFILE *ifile=VSIFileFromMemBuffer(filename,(GByte*)tmpm->value,strlen(tmpm->value),FALSE);
    30   VSIFCloseL(ifile);
     28  tmpm=getMapFromMaps(inputs,"InputPoints","cache_file");
    3129#if GDAL_VERSION_MAJOR >= 2
    32   GDALDataset *ipoDS =
    33     (GDALDataset*) GDALOpenEx( filename,
    34                                GDAL_OF_READONLY | GDAL_OF_VECTOR,
    35                                NULL, NULL, NULL );
     30  GDALDataset *ipoDS;
    3631#else
    37   OGRDataSource* ipoDS = OGRSFDriverRegistrar::Open(filename,FALSE);
     32  OGRDataSource* ipoDS;
    3833#endif
     34  if(tmpm==NULL){
     35    tmpm=getMapFromMaps(inputs,"InputPoints","value");
     36    VSILFILE *ifile=VSIFileFromMemBuffer(filename,(GByte*)tmpm->value,strlen(tmpm->value),FALSE);
     37    VSIFCloseL(ifile);
     38#if GDAL_VERSION_MAJOR >= 2
     39  ipoDS = (GDALDataset*) GDALOpenEx( filename,
     40                                     GDAL_OF_READONLY | GDAL_OF_VECTOR,
     41                                     NULL, NULL, NULL );
     42#else
     43  ipoDS = OGRSFDriverRegistrar::Open(filename,FALSE);
     44#endif
     45  }else
     46#if GDAL_VERSION_MAJOR >= 2
     47    ipoDS = (GDALDataset*) GDALOpenEx( tmpm->value,
     48                                       GDAL_OF_READONLY | GDAL_OF_VECTOR,
     49                                       NULL, NULL, NULL );
     50#else
     51    ipoDS = OGRSFDriverRegistrar::Open(tmpm->value,FALSE);
     52#endif
     53   
    3954  if( ipoDS == NULL )
    4055    {
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