Ignore:
Timestamp:
May 7, 2019, 2:17:08 PM (6 years ago)
Author:
djay
Message:

Merge prototype-v0 branch in trunk

Location:
trunk
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/zoo-project/zoo-services/ogr/base-vect-ops-py/cgi-env/ogr_sp.py

    r465 r917  
    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        lyr = ds.GetLayer(0)
     102        feat = lyr.GetNextFeature()
     103        while feat is not None:
     104            geometry+=[feat.Clone()]
     105            feat.Destroy()
     106            feat = lyr.GetNextFeature()
     107        ds.Destroy()
     108        return geometry   
    97109    if obj["mimeType"]=="application/json":
    98110        return createLayerFromJson(conf,obj["value"])
  • trunk/zoo-project/zoo-services/ogr/base-vect-ops/service.c

    r769 r917  
    473473          {
    474474
    475             if( EQUAL(
     475            if(
    476476#if GDAL_VERSION_MAJOR >=2
    477                       poR->GetDriver(iDriver)->GetDescription()
    478 #else
    479                       poR->GetDriver(iDriver)->GetName()
    480 #endif
    481                       ,oDriver1) )
     477                EQUAL(poR->GetDriver(iDriver)->GetDescription(),oDriver1)
     478#else
     479                EQUAL(poR->GetDriver(iDriver)->GetName(),oDriver1)
     480#endif
     481                )
    482482              {
    483483                poDriver = poR->GetDriver(iDriver);
  • trunk/zoo-project/zoo-services/ogr/ogr2ogr/service.c

    r790 r917  
    9696#endif
    9797{
     98    char  *pszDialect = NULL;
    9899    const char  *pszFormat = "ESRI Shapefile";
    99100    const char  *pszDataSource = NULL;
     
    155156      sprintf(serverAddress,"%s",tmpMap->value);
    156157    }
    157    
     158
    158159    tmpMap=NULL;
    159160    char tmpurl[1024];
     
    223224    if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
    224225      pszSQLStatement = tmpMap->value;
     226    }
     227
     228    tmpMap=getMapFromMaps(inputs,"dialect","value");
     229    if(tmpMap!=NULL){
     230      pszDialect=strdup(tmpMap->value);
    225231    }
    226232
     
    360366          dfMaxSegmentLength = atof(tmpMap->value);
    361367    }
    362 
    363     /*tmpMap=NULL;
    364     tmpMap=getMapFromMaps(inputs,"segmentize","value");
    365     if(tmpMap!=NULL){
    366           dfMaxSegmentLength = atof(tmpMap->value);
    367     }*/
    368 
     368   
    369369    tmpMap=NULL;
    370370    tmpMap=getMapFromMaps(inputs,"InputDSN","value");
     
    825825       
    826826        poResultSet = poDS->ExecuteSQL( pszSQLStatement, poSpatialFilter,
    827                                         NULL );
     827                                        pszDialect );
    828828
    829829        if( poResultSet != NULL )
     
    841841            }
    842842            poDS->ReleaseResultSet( poResultSet );
    843         }
    844     }
     843        }else{
     844          setMapInMaps(conf,"lenv","message","There was an error when running yoru SQL query.");
     845          if(pszDialect!=NULL)
     846            free(pszDialect);
     847          return SERVICE_FAILED;
     848        }
     849    }
     850    if(pszDialect!=NULL)
     851      free(pszDialect);
    845852
    846853/* -------------------------------------------------------------------- */
     
    901908
    902909#ifdef ZOO_SERVICE
    903     outputs->content=createMap("value",(char*)pszwebDestData);
     910    setMapInMaps(outputs,"OutputedDataSourceName","value",(char*)pszwebDestData);
     911    //outputs->content=createMap("value",(char*)pszwebDestData);
    904912#endif
    905913
     
    930938    fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    931939
    932     OGRCleanupAll();
     940    //OGRCleanupAll();
    933941    fprintf(stderr,"%s %d\n",__FILE__,__LINE__);
    934942
     
    939947   
    940948#ifdef ZOO_SERVICE
     949    //sleep(10);
    941950    return SERVICE_SUCCEEDED;
    942951#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