Ignore:
Timestamp:
Feb 1, 2018, 11:27:28 AM (6 years ago)
Author:
djay
Message:

Add the capability to publish heatmap or any templated mapfile using the epecific msInclude and msLayer keys for an output. For MapServer? published output, define 4096 as the default maxsize and use pixel width or height for raster files. use the correct MapServer? imagemode depending on GDALGetRasterDataType (MS_IMAGEMODE_BYTE for GDT_Byte, MS_IMAGEMODE_INT16 for GDT_Int16 and MS_IMAGEMODE_FLOAT32 for GDT_Float32). Create a text file (.maps) listing every mapfiles created for a MapServer? published output (or inputs) using saveMapNames function. Fixes in ulinet, use uuid for naming temporary files. Add dialect input to the ogr2ogr service. Use the .maps file for removing a file from the DeleteData? service

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/server_internal.c

    r858 r862  
    377377  struct stat file_status;
    378378  stat(filename, &file_status);
    379   map* tmpMap1=getMap(content,"value");
    380   if(tmpMap1==NULL){
    381     addToMap(content,"value","");
    382     tmpMap1=getMap(content,"value");
    383   }
    384   free(tmpMap1->value);
    385   tmpMap1->value=(char*) malloc((count+1)*sizeof(char)); 
    386   fread(tmpMap1->value,1,count,file);
    387   tmpMap1->value[count]=0;
     379  if(getMap(content,"storage")==NULL){
     380    map* tmpMap1=getMap(content,"value");
     381    if(tmpMap1==NULL){
     382      addToMap(content,"value","");
     383      tmpMap1=getMap(content,"value");
     384    }
     385    free(tmpMap1->value);
     386    tmpMap1->value=(char*) malloc((count+1)*sizeof(char));
     387    if(tmpMap1->value==NULL){
     388      setMapInMaps(m,"lenv","message","Unable to allocate the memory required to read the produced file.");
     389    }
     390    fread(tmpMap1->value,1,count,file);
     391    tmpMap1->value[count]=0;
     392  }
    388393  fclose(file);
    389394  char rsize[1000];
     
    423428void dumpMapsValuesToFiles(maps** main_conf,maps** in){
    424429  map* tmpPath=getMapFromMaps(*main_conf,"main","tmpPath");
     430  map* tmpUrl=getMapFromMaps(*main_conf,"main","tmpUrl");
    425431  map* tmpSid=getMapFromMaps(*main_conf,"lenv","usid");
    426432  maps* inputs=*in;
     
    450456          setMapArray(cMap,"cache_file",k,val);
    451457          free(val);
     458          val=(char*)malloc((strlen(tmpUrl->value)+strlen(inputs->name)+strlen(tmpSid->value)+strlen(file_ext)+16)*sizeof(char));
     459          sprintf(val,"%s/Input_%s_%s_%d.%s",tmpUrl->value,inputs->name,tmpSid->value,k,file_ext);
     460          setMapArray(cMap,"cache_url",k,val);
     461          setMapArray(cMap,"byValue",k,"true");
     462          free(val);
    452463        }
    453464      }else{
     
    467478        addToMap(cMap,"cache_file",val);
    468479        free(val);
    469       }
    470       addToMap(inputs->content,"byValue","true");
     480        val=(char*)malloc((strlen(tmpUrl->value)+strlen(inputs->name)+strlen(tmpSid->value)+strlen(file_ext)+16)*sizeof(char));
     481        sprintf(val,"%s/Input_%s_%s_%d.%s",tmpUrl->value,inputs->name,tmpSid->value,0,file_ext);
     482        addToMap(cMap,"cache_url",val);
     483        addToMap(cMap,"byValue",val);
     484        free(val);
     485      }
    471486    }
    472487    inputs=inputs->next;
     
    641656        }
    642657        if(res==NULL){
     658          map* tmpMaxO0=getMap(tmpInputs->content,"useMapserver");
     659          if(tmpMaxO0!=NULL){
     660            if(tmpMaps2->content==NULL)
     661              tmpMaps2->content=createMap("useMapserver",tmpMaxO0->value);
     662            else
     663              addToMap(tmpMaps2->content,"useMapserver",tmpMaxO0->value);
     664          }
    643665          map* tmpMaxO=getMap(tmpInputs->content,"maxOccurs");
    644666          if(tmpMaxO!=NULL){
     
    714736           * content map.
    715737           */
    716           map* tmpMap1=getMap(tmpInputs->content,"minOccurs");
    717           if(tmpMap1!=NULL){
    718             if(tmpMaps->content==NULL)
    719               tmpMaps->content=createMap("minOccurs",tmpMap1->value);
    720             else
    721               addToMap(tmpMaps->content,"minOccurs",tmpMap1->value);
    722           }
    723           map* tmpMaxO=getMap(tmpInputs->content,"maxOccurs");
    724           if(tmpMaxO!=NULL){
    725             if(tmpMaps->content==NULL)
    726               tmpMaps->content=createMap("maxOccurs",tmpMaxO->value);
    727             else
    728               addToMap(tmpMaps->content,"maxOccurs",tmpMaxO->value);
    729           }
    730           map* tmpMaxMB=getMap(tmpInputs->content,"maximumMegabytes");
    731           if(tmpMaxMB!=NULL){
    732             if(tmpMaps->content==NULL)
    733               tmpMaps->content=createMap("maximumMegabytes",tmpMaxMB->value);
    734             else
    735               addToMap(tmpMaps->content,"maximumMegabytes",tmpMaxMB->value);
     738          char* keys[4]={
     739            "minOccurs",
     740            "maxOccurs",
     741            "maximumMegabytes",
     742            "useMapserver"
     743          };
     744          int i=0;
     745          for(i=0;i<4;i++){
     746            map* tmpMap1=getMap(tmpInputs->content,keys[i]);
     747            if(tmpMap1!=NULL){
     748              addToMap(tmpMaps->content,keys[i],tmpMap1->value);
     749            }
    736750          }
    737751          /**
     
    812826          if(tmpCheck!=NULL && strncasecmp(tmpCheck->value,"true",4)==0){
    813827            // Get the default value
     828            addToMap(tmpMaps->content,"useMapserver","true");
    814829            tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL);
    815830            tmpCheck=getMap(tmpMaps->content,"mimeType");
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