Changes between Version 52 and Version 53 of ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices
- Timestamp:
- Oct 16, 2010, 2:34:54 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices
v52 v53 623 623 OGRGeometryH geometry,res; 624 624 map* tmp=getMapFromMaps(inputs,"InputPolygon","value"); 625 if(tmp==NULL) 625 if(tmp==NULL){ 626 setMapInMaps(conf,"lenv","message","Unable to fetch InputPolygon value."); 626 627 return SERVICE_FAILED; 628 } 627 629 map* tmp1=getMapFromMaps(inputs,"InputPolygon","mimeType"); 628 630 if(strncmp(tmp1->value,"application/json",16)==0) … … 630 632 else 631 633 geometry=createGeometryFromWFS(conf,tmp->value); 634 if(geometry==NULL){ 635 setMapInMaps(conf,"lenv","message","Unable to parse InputPolygon value."); 636 return SERVICE_FAILED; 637 } 632 638 res=OGR_G_ConvexHull(geometry); 633 639 tmp1=getMapFromMaps(outputs,"Result","mimeType"); … … 656 662 OGRGeometryH geometry,res; 657 663 map* tmp=getMapFromMaps(inputs,"InputPolygon","value"); 658 if(tmp==NULL) 664 if(tmp==NULL){ 665 setMapInMaps(conf,"lenv","message","Unable to fetch InputPolygon value."); 659 666 return SERVICE_FAILED; 667 } 660 668 map* tmp1=getMapFromMaps(inputs,"InputPolygon","mimeType"); 661 669 if(strncmp(tmp1->value,"application/json",16)==0) … … 663 671 else 664 672 geometry=createGeometryFromWFS(conf,tmp->value); 673 if(geometry==NULL){ 674 setMapInMaps(conf,"lenv","message","Unable to parse InputPolygon value."); 675 return SERVICE_FAILED; 676 } 665 677 res=(*myFunc)(geometry); 666 678 tmp1=getMapFromMaps(outputs,"Result","mimeType"); 667 679 if(strncmp(tmp1->value,"application/json",16)==0){ 668 addToMap(outputs->content,"value",OGR_G_ExportToJson(res)); 669 addToMap(outputs->content,"mimeType","text/plain"); 680 char *tmp=OGR_G_ExportToJson(res); 681 setMapInMaps(outputs,"Result","value",tmp); 682 setMapInMaps(outputs,"Result","mimeType","text/plain"); 683 free(tmp); 670 684 } 671 685 else{ 672 addToMap(outputs->content,"value",OGR_G_ExportToGML(res)); 686 char *tmp=OGR_G_ExportToGML(res); 687 setMapInMaps(outputs,"Result","value",tmp); 688 free(tmp); 673 689 } 674 690 outputs->next=NULL;