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
402 402 protoVersion=options[proto][1]; 403 403 extent=getMapArray(tmpI->content,options[proto][4],imyIndex); 404 404 memset(webService_url,0,strlen(webService_url)); 405 freeMap(&rformat);405 freeMap(&rformat); 406 406 free(rformat); 407 407 rformat=createMap("value","image/tiff"); 408 408 sprintf(webService_url, … … 549 549 void setMsExtent(maps* output,mapObj* m,layerObj* myLayer, 550 550 double minX,double minY,double maxX,double maxY){ 551 551 int imyIndex=getPublishedId(output); 552 552 553 msMapSetExtent(m,minX,minY,maxX,maxY); 553 554 //m->maxsize=4096; 554 555 #ifdef DEBUGMS … … 559 560 #ifdef DEBUGMS 560 561 fprintf(stderr,"Extent %s\n",tmpExtent); 561 562 #endif 562 msInsertHashTable(&(myLayer->metadata), "ows_extent", tmpExtent); 563 msInsertHashTable(&(myLayer->metadata), "ows_extent", tmpExtent); 563 564 564 565 if(output!=NULL){ 565 566 map* test=getMapArray(output->content,"real_extent",imyIndex); … … 577 578 msProjectPoint(&myLayer->projection,&tempSrs,&max); 578 579 579 580 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); 581 582 map* isGeo=getMapArray(output->content,"crs_isGeographic",imyIndex); 582 583 #ifdef DEBUGMS 583 584 fprintf(stderr,"isGeo = %s\n",isGeo->value); 584 585 #endif 585 586 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); 587 588 setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent); 588 589 sprintf(tmpExtent,"%f,%f,%f,%f", minY,minX, maxY, maxX); 589 590 }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); 591 592 setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent); 592 593 } 593 594 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); 595 596 setMapArray(output->content,"wcs_extent",imyIndex,tmpExtent); 596 597 }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); 598 599 setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent); 599 600 sprintf(tmpExtent,"%f,%f,%f,%f",minX, minY, maxX, maxY); 600 601 map* isGeo=getMapArray(output->content,"crs_isGeographic",imyIndex); … … 603 604 fprintf(stderr,"isGeo = %s\n",isGeo->value); 604 605 #endif 605 606 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); 607 608 } 608 609 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); 610 611 setMapArray(output->content,"wcs_extent",imyIndex,tmpExtent); 611 612 } 612 613 } 613 614 #ifdef DEBUGMS 615 fprintf(stderr,"SetMapSize EXTENT: %f,%f,%f,%f\n",minX,minY,maxX,maxY); 616 #endif 614 617 setMapSize(output,minX,minY,maxX,maxY); 615 618 } 616 619 … … 859 862 char extent[1024]; 860 863 memset(&extent,0,1024); 861 864 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 862 869 setMapArray(output->content,"boundingbox",imyIndex,extent); 863 870 } 864 871 … … 1088 1095 char extent[1024]; 1089 1096 memset(&extent,0,1024); 1090 1097 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 1091 1101 setMapArray(output->content,"boundingbox",imyIndex,extent); 1092 1102 } 1093 1103 }else{ … … 1277 1287 */ 1278 1288 int imyIndex=getPublishedId(outputs); 1279 1289 map* mime=getMapArray(outputs->content,"mimeType",imyIndex); 1290 map* msUrl=getMapFromMaps(conf,"main","mapserverAddress"); 1291 map* dataPath=getMapFromMaps(conf,"main","dataPath"); 1280 1292 char *ext="data"; 1281 1293 if(mime!=NULL) 1282 1294 if(strncasecmp(mime->value,"application/json",16)==0) … … 1481 1493 freeMap(&correspondance); 1482 1494 free(correspondance); 1483 1495 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); 1484 1503 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 1485 1511 if(tryOgr(conf,outputs,myMap)<0) 1486 1512 if(tryGdal(conf,outputs,myMap)<0) 1487 1513 return ; 1488 1514 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); 1492 1517 msInitSymbolSet(&myMap->symbolset); 1493 1518 myMap->symbolset.filename=zStrdup(tmpPath); 1494 1519 free(tmpPath); 1495 1520 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);1500 1521 msSaveMap(myMap,mapPath); 1501 1522 saveMapNames(conf,outputs,mapPath); 1502 1523 free(mapPath);