Ticket #170: service_internal_ms.patch

File service_internal_ms.patch, 5.8 KB (added by jmckenna, 6 years ago)

service_internal_ms.ca patch

  • service_internal_ms.c

     
    402402    protoVersion=options[proto][1];
    403403    extent=getMapArray(tmpI->content,options[proto][4],imyIndex);
    404404    memset(webService_url,0,strlen(webService_url));
    405     freeMap(&rformat);
     405     freeMap(&rformat);
    406406    free(rformat);
    407407    rformat=createMap("value","image/tiff");
    408408    sprintf(webService_url,
     
    549549void setMsExtent(maps* output,mapObj* m,layerObj* myLayer,
    550550                 double minX,double minY,double maxX,double maxY){
    551551  int imyIndex=getPublishedId(output);
     552 
    552553  msMapSetExtent(m,minX,minY,maxX,maxY);
    553554  //m->maxsize=4096;
    554555#ifdef DEBUGMS
     
    559560#ifdef DEBUGMS
    560561  fprintf(stderr,"Extent %s\n",tmpExtent);
    561562#endif
    562   msInsertHashTable(&(myLayer->metadata), "ows_extent", tmpExtent);
     563  msInsertHashTable(&(myLayer->metadata), "ows_extent", tmpExtent); 
    563564 
    564565  if(output!=NULL){
    565566    map* test=getMapArray(output->content,"real_extent",imyIndex);
     
    577578    msProjectPoint(&myLayer->projection,&tempSrs,&max);
    578579 
    579580    if(test!=NULL){
    580       sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",min.y,min.x,max.y,max.x);
     581      sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",min.y,min.x,max.y,max.x);
    581582      map* isGeo=getMapArray(output->content,"crs_isGeographic",imyIndex);
    582583#ifdef DEBUGMS
    583584      fprintf(stderr,"isGeo = %s\n",isGeo->value);
    584585#endif
    585586      if(isGeo!=NULL && strcasecmp("true",isGeo->value)==0){
    586         sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",min.y,min.x,max.y,max.x);
     587        sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",min.y,min.x,max.y,max.x);
    587588        setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent);
    588589        sprintf(tmpExtent,"%f,%f,%f,%f", minY,minX, maxY, maxX);
    589590      }else{
    590         sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);
     591        sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",min.x,min.y,max.x,max.y);
    591592        setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent);
    592593      }
    593594      setMapArray(output->content,"wms_extent",imyIndex,tmpExtent);
    594       sprintf(tmpSrsStr,"%.3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);
     595      sprintf(tmpSrsStr,"%.15f,%.15f,%.15f,%.15f",min.x,min.y,max.x,max.y);
    595596      setMapArray(output->content,"wcs_extent",imyIndex,tmpExtent);
    596597    }else{
    597       sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);
     598      sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",min.x,min.y,max.x,max.y);
    598599      setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent);
    599600      sprintf(tmpExtent,"%f,%f,%f,%f",minX, minY, maxX, maxY);
    600601      map* isGeo=getMapArray(output->content,"crs_isGeographic",imyIndex);
     
    603604        fprintf(stderr,"isGeo = %s\n",isGeo->value);
    604605#endif
    605606        if(isGeo!=NULL && strcasecmp("true",isGeo->value)==0)
    606           sprintf(tmpExtent,"%f,%f,%f,%f", minY,minX, maxY, maxX);
     607          sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f", minY,minX,maxY,maxX);
    607608      }
    608609      setMapArray(output->content,"wms_extent",imyIndex,tmpExtent);
    609       sprintf(tmpExtent,"%.3f,%.3f,%.3f,%.3f",minX,minY,maxX,maxY);
     610      sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",minX,minY,maxX,maxY);
    610611      setMapArray(output->content,"wcs_extent",imyIndex,tmpExtent);
    611612    }
    612613  }
    613 
     614#ifdef DEBUGMS
     615        fprintf(stderr,"SetMapSize EXTENT: %f,%f,%f,%f\n",minX,minY,maxX,maxY);
     616#endif
    614617  setMapSize(output,minX,minY,maxX,maxY);
    615618}
    616619
     
    859862      char extent[1024];
    860863      memset(&extent,0,1024);
    861864      sprintf(extent,"%d,%d,%d,%d",oExt.MinX, oExt.MinY, oExt.MaxX, oExt.MaxY);
     865#ifdef DEBUGMS
     866      fprintf(stderr,"OGR Extent %d,%d,%d,%d\n",oExt.MinX, oExt.MinY, oExt.MaxX, oExt.MaxY);
     867#endif     
     868     
    862869      setMapArray(output->content,"boundingbox",imyIndex,extent);
    863870    }
    864871 
     
    10881095      char extent[1024];
    10891096      memset(&extent,0,1024);
    10901097      sprintf(extent,"%d,%d,%d,%d",minX,minY,maxX,maxY);
     1098#ifdef DEBUGMS
     1099      fprintf(stderr,"GDAL Transform Extent %d,%d,%d,%d\n",minX,minY,maxX,maxY);
     1100#endif     
    10911101      setMapArray(output->content,"boundingbox",imyIndex,extent);
    10921102    }
    10931103  }else{
     
    12771287   */
    12781288  int imyIndex=getPublishedId(outputs);
    12791289  map* mime=getMapArray(outputs->content,"mimeType",imyIndex);
     1290  map* msUrl=getMapFromMaps(conf,"main","mapserverAddress");
     1291  map* dataPath=getMapFromMaps(conf,"main","dataPath");
    12801292  char *ext="data";
    12811293  if(mime!=NULL)
    12821294    if(strncasecmp(mime->value,"application/json",16)==0)
     
    14811493  freeMap(&correspondance);
    14821494  free(correspondance);
    14831495
     1496  map* sid=getMapFromMaps(conf,"lenv","usid");
     1497  char *mapPath=
     1498    (char*)malloc((14+strlen(sid->value)+strlen(outputs->name)+strlen(dataPath->value))*sizeof(char));
     1499  sprintf(mapPath,"%s/%s_%d_%s.map",dataPath->value,outputs->name,imyIndex,sid->value);
     1500  char *mapUrl=
     1501    (char*)malloc((6+strlen(mapPath)+strlen(msUrl->value))*sizeof(char));
     1502  sprintf(mapUrl,"%s?map=%s",msUrl->value,mapPath);
    14841503
     1504  if (msInsertHashTable(&(myMap->web.metadata), "ows_onlineresource", mapUrl) == NULL){
     1505#ifdef DEBUGMS
     1506    fprintf(stderr,"Unable to add metadata");
     1507#endif
     1508    return;
     1509  }
     1510
    14851511  if(tryOgr(conf,outputs,myMap)<0)
    14861512    if(tryGdal(conf,outputs,myMap)<0)
    14871513      return ;
    14881514
    1489   tmp1=getMapFromMaps(conf,"main","dataPath");
    1490   char *tmpPath=(char*)malloc((13+strlen(tmp1->value))*sizeof(char));
    1491   sprintf(tmpPath,"%s/symbols.sym",tmp1->value);
     1515  char *tmpPath=(char*)malloc((13+strlen(dataPath->value))*sizeof(char));
     1516  sprintf(tmpPath,"%s/symbols.sym",dataPath->value);
    14921517  msInitSymbolSet(&myMap->symbolset);
    14931518  myMap->symbolset.filename=zStrdup(tmpPath);
    14941519  free(tmpPath);
    14951520
    1496   map* sid=getMapFromMaps(conf,"lenv","usid");
    1497   char *mapPath=
    1498     (char*)malloc((14+strlen(sid->value)+strlen(outputs->name)+strlen(tmp1->value))*sizeof(char));
    1499   sprintf(mapPath,"%s/%s_%d_%s.map",tmp1->value,outputs->name,imyIndex,sid->value);
    15001521  msSaveMap(myMap,mapPath);
    15011522  saveMapNames(conf,outputs,mapPath);
    15021523  free(mapPath);

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