Changeset 55 for trunk/zoo-services/ogr/base-vect-ops
- Timestamp:
- Dec 21, 2010, 4:34:01 PM (14 years ago)
- Location:
- trunk/zoo-services/ogr/base-vect-ops
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-services/ogr/base-vect-ops/cgi-env/Distance.zcfg
r9 r55 1 1 [Distance] 2 Title = C alcul la distance entre deux entites geographique.3 Abstract = C alcul de la distance entre deux entites geographique.2 Title = Compute the distance between two geometries 3 Abstract = Compute the distance between two geometries 4 4 Profile = urn:ogc:wps:1.0.0:buffer 5 5 processVersion = 2 -
trunk/zoo-services/ogr/base-vect-ops/service.c
r54 r55 393 393 res=(*myFunc)(geometry1,geometry2); 394 394 fprintf(stderr,"\nService internal print1\n"); 395 396 /* nuova parte */ 397 map* tmp2=getMapFromMaps(outputs,"Result","mimeType"); 398 if(strncmp(tmp2->value,"application/json",16)==0){ 399 char *tmpS=OGR_G_ExportToJson(res); 400 setMapInMaps(outputs,"Result","value",tmpS); 401 setMapInMaps(outputs,"Result","mimeType","text/plain"); 402 setMapInMaps(outputs,"Result","encoding","UTF-8"); 403 free(tmpS); 404 } 405 else{ 406 char *tmpS=OGR_G_ExportToGML(res); 407 setMapInMaps(outputs,"Result","value",tmpS); 408 setMapInMaps(outputs,"Result","mimeType","text/xml"); 409 setMapInMaps(outputs,"Result","encoding","UTF-8"); 410 setMapInMaps(outputs,"Result","schema","http://fooa/gml/3.1.0/polygon.xsd"); 411 free(tmpS); 412 } 413 414 /* vecchia da togliere */ 415 /* 395 416 char *tmpS=OGR_G_ExportToJson(res); 396 417 setMapInMaps(outputs,"Result","value",tmpS); … … 398 419 setMapInMaps(outputs,"Result","encoding","UTF-8"); 399 420 free(tmpS); 421 */ 400 422 OGR_G_DestroyGeometry(geometry1); 401 423 OGR_G_DestroyGeometry(geometry2); … … 491 513 res=OGR_G_Distance(geometry1,geometry2); 492 514 char tmpres[100]; 493 sprintf(tmpres,"% d",res);515 sprintf(tmpres,"%f",res); 494 516 setMapInMaps(outputs,"Distance","value",tmpres); 495 517 setMapInMaps(outputs,"Distance","dataType","float"); … … 529 551 */ 530 552 char tmp1[100]; 531 sprintf(tmp1,"% d",res);553 sprintf(tmp1,"%f",res); 532 554 setMapInMaps(outputs,"Area","value",tmp1); 533 555 setMapInMaps(outputs,"Area","dataType","float");
Note: See TracChangeset
for help on using the changeset viewer.