Ignore:
Timestamp:
Mar 27, 2013, 7:09:39 PM (7 years ago)
Author:
djay
Message:

Fixing issue when there is no SRS in the file you want to return as result of your processing (cf. #77).

File:
1 edited

Legend:

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

    r379 r402  
    105105
    106106void setReferenceUrl(maps* m,maps* tmpI){
    107   //dumpMaps(tmpI);
    108107  outputMapfile(m,tmpI);
    109108  map *msUrl=getMapFromMaps(m,"main","mapserverAddress");
     
    148147  map* extent=getMap(tmpI->content,options[proto][4]);
    149148  map* crs=getMap(tmpI->content,"crs");
     149  int hasCRS=1;
     150  if(crs==NULL){
     151    crs=getMapFromMaps(m,"main","crs");
     152    if(crs==NULL){
     153      crs=createMap("crs","epsg:4326");
     154      hasCRS=0;
     155    }
     156  }
    150157  char layers[128];
    151158  sprintf(layers,options[proto][3],tmpI->name);
     
    186193            crs->value
    187194            );
     195  }
     196  if(hasCRS==0){
     197    freeMap(&crs);
     198    free(crs);
    188199  }
    189200  addToMap(tmpI->content,"Reference",webService_url);
     
    300311 
    301312  if(output!=NULL){
    302 
    303313    map* test=getMap(output->content,"real_extent");
    304314    if(test!=NULL){
    305315      pointObj min, max;
    306316      projectionObj tempSrs;
    307 
    308317      min.x = m->extent.minx;
    309318      min.y = m->extent.miny;
     
    311320      max.y = m->extent.maxy;
    312321      char tmpSrsStr[1024];
    313 
    314 
    315322      msInitProjection(&tempSrs);
    316323      msLoadProjectionStringEPSG(&tempSrs,"EPSG:4326");
     
    327334      sprintf(tmpSrsStr,"%.3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);
    328335      addToMap(output->content,"wcs_extent",tmpExtent);
    329       //dumpMap(output->content);
    330 
    331336    }else{
    332337      sprintf(tmpExtent,"%f,%f,%f,%f",minX, minY, maxX, maxY);
    333338      map* isGeo=getMap(output->content,"crs_isGeographic");
    334       fprintf(stderr,"isGeo = %s\n",isGeo->value);
    335       if(isGeo!=NULL && strcasecmp("true",isGeo->value)==0)
    336         sprintf(tmpExtent,"%f,%f,%f,%f", minY,minX, maxY, maxX);
     339      if(isGeo!=NULL){
     340        fprintf(stderr,"isGeo = %s\n",isGeo->value);
     341        if(isGeo!=NULL && strcasecmp("true",isGeo->value)==0)
     342          sprintf(tmpExtent,"%f,%f,%f,%f", minY,minX, maxY, maxX);
     343      }
    337344      addToMap(output->content,"wms_extent",tmpExtent);
    338345      sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",minX,minY,maxX,maxY);
    339346      addToMap(output->content,"wcs_extent",tmpExtent);
    340      
    341     }
    342 
     347    }
    343348  }
    344349
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