Ignore:
Timestamp:
Dec 21, 2010, 4:34:01 PM (14 years ago)
Author:
nmarco
Message:

fixed error in GetArea? and Distance functions: wrong data type. Added the output in GML format in the ApplayTwo? function. Distance.zcfg: translated from French to English

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  
    11[Distance]
    2  Title = Calcul la distance entre deux entites geographique.
    3  Abstract = Calcul de la distance entre deux entites geographique.
     2 Title = Compute the distance between two geometries
     3 Abstract = Compute the distance between two geometries
    44 Profile = urn:ogc:wps:1.0.0:buffer
    55 processVersion = 2
  • trunk/zoo-services/ogr/base-vect-ops/service.c

    r54 r55  
    393393    res=(*myFunc)(geometry1,geometry2);
    394394    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    /*
    395416    char *tmpS=OGR_G_ExportToJson(res);
    396417    setMapInMaps(outputs,"Result","value",tmpS);
     
    398419    setMapInMaps(outputs,"Result","encoding","UTF-8");
    399420    free(tmpS);
     421    */
    400422    OGR_G_DestroyGeometry(geometry1);
    401423    OGR_G_DestroyGeometry(geometry2);
     
    491513    res=OGR_G_Distance(geometry1,geometry2);   
    492514    char tmpres[100];
    493     sprintf(tmpres,"%d",res);
     515    sprintf(tmpres,"%f",res);
    494516    setMapInMaps(outputs,"Distance","value",tmpres);
    495517    setMapInMaps(outputs,"Distance","dataType","float");
     
    529551     */
    530552    char tmp1[100];
    531     sprintf(tmp1,"%d",res);
     553    sprintf(tmp1,"%f",res);
    532554    setMapInMaps(outputs,"Area","value",tmp1);
    533555    setMapInMaps(outputs,"Area","dataType","float");
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