Ignore:
Timestamp:
Jun 7, 2012, 10:54:31 PM (12 years ago)
Author:
djay
Message:

Add support for multiple inputs values for the same identifier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal_ms.c

    r357 r360  
    126126
    127127  if(proto>0){
    128     map* test=getMap(tmpI->content,"real_extent");
    129     if(test!=NULL)
    130         extent=test;
    131128    sprintf(webService_url,
    132129            "%s?map=%s/%s_%s.map&request=%s&service=%s&version=%s&%s&format=%s&bbox=%s&crs=%s",
     
    145142  }
    146143  else{
    147     map* test=getMap(tmpI->content,"real_extent_reverse");
    148     if(test!=NULL)
    149         extent=test;
    150144    sprintf(webService_url,
    151145            "%s?map=%s/%s_%s.map&request=%s&service=%s&version=%s&%s&width=%s&height=%s&format=%s&bbox=%s&crs=%s",
     
    281275 
    282276  if(output!=NULL){
     277
    283278    map* test=getMap(output->content,"real_extent");
    284279    if(test!=NULL){
    285280      pointObj min, max;
    286281      projectionObj tempSrs;
    287      
     282
    288283      min.x = m->extent.minx;
    289284      min.y = m->extent.miny;
     
    291286      max.y = m->extent.maxy;
    292287      char tmpSrsStr[1024];
    293      
     288
     289
    294290      msInitProjection(&tempSrs);
    295291      msLoadProjectionStringEPSG(&tempSrs,"EPSG:4326");
    296      
     292
    297293      msProjectPoint(&(m->projection),&tempSrs,&min);
    298294      msProjectPoint(&m->projection,&tempSrs,&max);
    299295     
    300296      sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",min.y,min.x,max.y,max.x);
     297      map* isGeo=getMap(output->content,"crs_isGeographic");
     298      fprintf(stderr,"isGeo = %s\n",isGeo->value);
     299      if(isGeo!=NULL && strcasecmp("true",isGeo->value)==0)
     300        sprintf(tmpExtent,"%f,%f,%f,%f", minY,minX, maxY, maxX);
    301301      addToMap(output->content,"wms_extent",tmpExtent);
    302       sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);
     302      sprintf(tmpSrsStr,"%.3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);
    303303      addToMap(output->content,"wcs_extent",tmpExtent);
    304      
     304      dumpMap(output->content);
     305
    305306    }else{
    306307      sprintf(tmpExtent,"%f,%f,%f,%f",minX, minY, maxX, maxY);
     
    308309      fprintf(stderr,"isGeo = %s\n",isGeo->value);
    309310      if(isGeo!=NULL && strcasecmp("true",isGeo->value)==0)
    310         sprintf(tmpExtent,"%f,%f,%f,%f", minY,minX, maxY, maxX);
     311        sprintf(tmpExtent,"%f,%f,%f,%f", minY,minX, maxY, maxX);
    311312      addToMap(output->content,"wms_extent",tmpExtent);
    312313      sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",minX,minY,maxX,maxY);
    313       addToMap(output->content,"wcs_extent",tmpExtent);
    314     }
     314      addToMap(output->content,"wcs_extent",tmpExtent);
     315     
     316    }
     317
    315318  }
    316319
     
    858861   * Firs store the value on disk
    859862   */
     863  map* mime=getMap(outputs->content,"mimeType");
     864  char *ext="data";
     865  if(mime!=NULL)
     866    if(strncasecmp(mime->value,"application/json",16)==0)
     867      ext="json";
     868 
    860869  map* tmpMap=getMapFromMaps(conf,"main","dataPath");
    861870  map* sidMap=getMapFromMaps(conf,"lenv","sid");
    862871  char *pszDataSource=(char*)malloc((strlen(tmpMap->value)+strlen(sidMap->value)+strlen(outputs->name)+17)*sizeof(char));
    863   sprintf(pszDataSource,"%s/ZOO_DATA_%s_%s.data",tmpMap->value,outputs->name,sidMap->value);
     872  sprintf(pszDataSource,"%s/ZOO_DATA_%s_%s.%s",tmpMap->value,outputs->name,sidMap->value,ext);
    864873  int f=open(pszDataSource,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
    865874  map* sizeMap=getMap(outputs->content,"size");
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