Ignore:
Timestamp:
Jul 16, 2011, 12:58:47 PM (13 years ago)
Author:
djay
Message:

Merge branch-1.2 to current rev. 267. Tag release-1.2.0-rc2.

Location:
branches/branch-1.2
Files:
7 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/branch-1.2

  • branches/branch-1.2/zoo-services/ogr/base-vect-ops-py/cgi-env/SymDifferencePy.zcfg

    r106 r268  
    6666   Abstract = The symmetric difference between the two geometries.
    6767   <MetaData>
    68     Title = Symmetric Difference 
     68    title = Symmetric Difference 
    6969   </MetaData>   
    7070    <ComplexData>
  • branches/branch-1.2/zoo-services/ogr/base-vect-ops-py/cgi-env/ogr_sp.py

    r107 r268  
     1from osgeo import *
    12import osgeo.ogr
     3import osgeo.gdal
    24import libxml2
    35import os
    46import sys
    57
    6 def createGeometryFromWFS(my_wfs_response):
    7     doc=libxml2.parseMemory(my_wfs_response,len(my_wfs_response))
    8     ctxt = doc.xpathNewContext()
    9     res=ctxt.xpathEval("/*/*/*/*/*[local-name()='Polygon' or local-name()='MultiPolygon' or local-name()='Point' or local-name()='MultiPoint' or local-name()='MultiLineString' or local-name()='LineString' ]")
     8def createGeometryFromWFS(conf,my_wfs_response):
    109    geometry=[]
    1110    try:
    12         for node in res:
    13             geometry_as_string=node.serialize()
    14             geometry+=[osgeo.ogr.CreateGeometryFromGML(geometry_as_string)]
     11        # Create virtual file or parse XML file depending on the GDAL Version
     12        gV=int(osgeo.gdal.VersionInfo())
     13        if gV >= 1800:
     14            osgeo.gdal.FileFromMemBuffer('/vsimem//temp', my_wfs_response)
     15            ds = osgeo.ogr.Open('/vsimem//temp')
     16            lyr = ds.GetLayer(0)
     17            feat = lyr.GetNextFeature()
     18            while feat is not None:
     19                geometry+=[feat.GetGeometryRef().Clone()]
     20                feat.Destroy()
     21                feat = lyr.GetNextFeature()
     22            ds.Destroy()
     23            osgeo.gdal.Unlink('/vsimem//temp')
     24        else:
     25            doc=libxml2.parseMemory(my_wfs_response,len(my_wfs_response))
     26            ctxt = doc.xpathNewContext()
     27            res=ctxt.xpathEval("/*/*/*/*/*[local-name()='Polygon' or local-name()='MultiPolygon' or local-name()='Point' or local-name()='MultiPoint' or local-name()='MultiLineString' or local-name()='LineString' ]")
     28            for node in res:
     29                geometry_as_string=node.serialize()
     30                geometry+=[osgeo.ogr.CreateGeometryFromGML(geometry_as_string)]
    1531    except:
    16         print >> sys.stderr,"Error"
     32        print >> sys.stderr,"Unable to load file from mem buffer\n\n\n"
    1733    return geometry
    1834
    19 def extractInputs(obj):
     35def extractInputs(conf,obj):
    2036    if obj["mimeType"]=="application/json":
    2137        return [osgeo.ogr.CreateGeometryFromJson(obj["value"])]
    2238    else:
    2339        try:
    24                 return createGeometryFromWFS(obj["value"])
     40                return createGeometryFromWFS(conf,obj["value"])
    2541        except:
    2642                return [osgeo.ogr.CreateGeometryFromJson(obj["value"])]
     
    3450        extension = [ ".js" ]
    3551    drv = osgeo.ogr.GetDriverByName( driverName )
    36     ds = drv.CreateDataSource( conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0] )
     52    # Create virtual file or real one depending on the GDAL Version
     53    gV=int(osgeo.gdal.VersionInfo())
     54    if gV >= 1800:
     55        ds = drv.CreateDataSource( "/vsimem/store"+conf["lenv"]["sid"]+extension[0] )
     56    else:
     57        ds = drv.CreateDataSource( conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0] )
    3758    lyr = ds.CreateLayer( "Result", None, osgeo.ogr.wkbUnknown )
    3859    field_defn = osgeo.ogr.FieldDefn( "Name", osgeo.ogr.OFTString )
     
    4970        i+=1
    5071    ds.Destroy()
    51     obj["value"]=open(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0],"r").read()
    52     os.unlink(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0])
    53     if len(extension)>1:
    54         os.unlink(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[1])
     72    if gV >= 1800:
     73        vsiFile=osgeo.gdal.VSIFOpenL("/vsimem/store"+conf["lenv"]["sid"]+extension[0],"r")
     74        i=0
     75        while osgeo.gdal.VSIFSeekL(vsiFile,0,os.SEEK_END)>0:
     76            i+=1
     77        fileSize=osgeo.gdal.VSIFTellL(vsiFile)
     78        osgeo.gdal.VSIFSeekL(vsiFile,0,os.SEEK_SET)
     79        obj["value"]=osgeo.gdal.VSIFReadL(fileSize,1,vsiFile)
     80        osgeo.gdal.Unlink("/vsimem/store"+conf["lenv"]["sid"]+extension[0])
     81    else:
     82        obj["value"]=open(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0],"r").read()
     83        os.unlink(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0])
     84        if len(extension)>1:
     85            os.unlink(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[1])
     86   
    5587
    5688def BoundaryPy(conf,inputs,outputs):
    57     geometry=extractInputs(inputs["InputPolygon"])
     89    geometry=extractInputs(conf,inputs["InputPolygon"])
    5890    i=0
    5991    rgeometries=[]
     
    6698
    6799def CentroidPy(conf,inputs,outputs):
    68     geometry=extractInputs(inputs["InputPolygon"])
     100    geometry=extractInputs(conf,inputs["InputPolygon"])
    69101    i=0
    70102    rgeometries=[]
     
    79111
    80112def ConvexHullPy(conf,inputs,outputs):
    81     geometry=extractInputs(inputs["InputPolygon"])
     113    geometry=extractInputs(conf,inputs["InputPolygon"])
    82114    i=0
    83115    rgeometries=[]
     
    94126    except:
    95127        bdist=10
    96     geometry=extractInputs(inputs["InputPolygon"])
     128    geometry=extractInputs(conf,inputs["InputPolygon"])
    97129    i=0
    98130    rgeometries=[]
     
    106138
    107139def UnionPy(conf,inputs,outputs):
    108     geometry1=extractInputs(inputs["InputEntity1"])
    109     geometry2=extractInputs(inputs["InputEntity2"])
     140    geometry1=extractInputs(conf,inputs["InputEntity1"])
     141    geometry2=extractInputs(conf,inputs["InputEntity2"])
    110142    rgeometries=[]
    111143    i=0
     
    127159
    128160def IntersectionPy(conf,inputs,outputs):
    129     geometry1=extractInputs(inputs["InputEntity1"])
    130     geometry2=extractInputs(inputs["InputEntity2"])
     161    geometry1=extractInputs(conf,inputs["InputEntity1"])
     162    geometry2=extractInputs(conf,inputs["InputEntity2"])
    131163    rgeometries=[]
    132164    i=0
     
    148180
    149181def DifferencePy(conf,inputs,outputs):
    150     geometry1=extractInputs(inputs["InputEntity1"])
    151     geometry2=extractInputs(inputs["InputEntity2"])
     182    geometry1=extractInputs(conf,inputs["InputEntity1"])
     183    geometry2=extractInputs(conf,inputs["InputEntity2"])
    152184    rgeometries=[]
    153185    i=0
     
    169201
    170202def SymDifferencePy(conf,inputs,outputs):
    171     geometry1=extractInputs(inputs["InputEntity1"])
    172     geometry2=extractInputs(inputs["InputEntity2"])
     203    geometry1=extractInputs(conf,inputs["InputEntity1"])
     204    geometry2=extractInputs(conf,inputs["InputEntity2"])
    173205    rgeometries=[]
    174206    i=0
  • branches/branch-1.2/zoo-services/ogr/ogr2ogr/cgi-env/Ogr2Ogr.zcfg

    r48 r268  
    88 serviceProvider = ogr2ogr_service.zo
    99 <MetaData>
    10    Title = My Demo
     10   title = My Demo
    1111 </MetaData>
    1212 <DataInputs>
  • branches/branch-1.2/zoo-services/ogr/ogr2ogr/service.c

    r49 r268  
    9595    const char  *pszSQLStatement = NULL;
    9696    int         eGType = -2;
    97     double       dfMaxSegmentLength = 0;
     97    double      dfMaxSegmentLength = 0;
    9898
    9999    /* Check strict compilation and runtime library version as we use C++ API */
     
    178178    }
    179179
    180     tmpMap=NULL;
    181     tmpMap=getMapFromMaps(inputs,"overwrite","value");
    182     if(tmpMap!=NULL){
    183           bOverwrite = TRUE;
    184     }
    185 
     180    /* if exist, overwrite the data with the same name */
     181    bOverwrite = TRUE;
     182   
    186183    tmpMap=NULL;
    187184    tmpMap=getMapFromMaps(inputs,"update","value");
     
    826823   
    827824#ifdef ZOO_SERVICE
    828         outputs=(maps*)malloc(sizeof(maps*));
    829     outputs->name="GeneratedFile";
    830825    outputs->content=createMap("value",(char*)pszwebDestData);
    831     addMapToMap(&outputs->content,createMap("dataType","string"));
    832     outputs->next=NULL;
    833826    return SERVICE_SUCCEEDED;
    834827#else
  • branches/branch-1.2/zoo-services/utils/status/Makefile

    r51 r268  
    1 CFLAGS=-I../../../zoo-kernel/ -I./ `xslt-config --cflags` `xml2-config --cflags` -DLINUX_FREE_ISSUE #-DDEBUG
     1CFLAGS=-I../../../thirds/cgic206/ -I../../../zoo-kernel/ -I./ `xslt-config --cflags` `xml2-config --cflags` -lintl -lfcgi -lcrypto -DLINUX_FREE_ISSUE #-DDEBUG
    22# if JS_ENABLED flag is set to true in your ZOO-Kernel Makefile then you'll have
    33# uncomment the following line
  • branches/branch-1.2/zoo-services/utils/status/service.c

    r217 r268  
    7272      char tmp[128];
    7373      sprintf(tmp,"_%s.xml",tmpMap->value);
    74       while ((dp = readdir(dirp)) != NULL)
     74      while ((dp = readdir(dirp)) != NULL){
     75#ifdef DEBUG
     76        fprintf(stderr,"File : %s searched : %s\n",dp->d_name,tmp);
     77#endif
    7578        if(strstr(dp->d_name,tmp)!=0){
    7679          sprintf(fileName,"%s/%s",tmpTmap->value,dp->d_name);
    7780          hasFile=1;
    7881        }
     82      }
    7983    }else{
    8084      char tmp[1024];
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