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.

Location:
branches/prototype-v0/zoo-project/zoo-services
Files:
3 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    {
  • branches/prototype-v0/zoo-project/zoo-services/ogr/base-vect-ops-py/cgi-env/ogr_sp.py

    r465 r863  
    9595
    9696def extractInputs(conf,obj):
     97    if obj.keys().count("cache_file"):
     98        print >> sys.stderr,obj
     99        geometry=[]
     100        ds = osgeo.ogr.Open(obj["cache_file"])
     101        if sql is not None:
     102            if sql.count("from")==0:
     103                layerName=ds.GetLayerByIndex(0).GetName()
     104                sql+=" from "+layerName
     105            lyr=ds.ExecuteSQL( sql, None, None )
     106        else:
     107            lyr = ds.GetLayer(0)
     108        feat = lyr.GetNextFeature()
     109        while feat is not None:
     110            geometry+=[feat.Clone()]
     111            feat.Destroy()
     112            feat = lyr.GetNextFeature()
     113        ds.Destroy()
     114        return geometry   
    97115    if obj["mimeType"]=="application/json":
    98116        return createLayerFromJson(conf,obj["value"])
  • branches/prototype-v0/zoo-project/zoo-services/ogr/ogr2ogr/service.c

    r862 r863  
    366366          dfMaxSegmentLength = atof(tmpMap->value);
    367367    }
    368 
    369     /*tmpMap=NULL;
    370     tmpMap=getMapFromMaps(inputs,"segmentize","value");
    371     if(tmpMap!=NULL){
    372           dfMaxSegmentLength = atof(tmpMap->value);
    373     }*/
    374 
    375368   
    376369    tmpMap=NULL;
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