Changes between Version 52 and Version 53 of ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices


Ignore:
Timestamp:
Oct 16, 2010, 2:34:54 PM (14 years ago)
Author:
djay
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices

    v52 v53  
    623623  OGRGeometryH geometry,res;
    624624  map* tmp=getMapFromMaps(inputs,"InputPolygon","value");
    625   if(tmp==NULL)
     625  if(tmp==NULL){
     626    setMapInMaps(conf,"lenv","message","Unable to fetch InputPolygon value.");
    626627    return SERVICE_FAILED;
     628  }
    627629  map* tmp1=getMapFromMaps(inputs,"InputPolygon","mimeType");
    628630  if(strncmp(tmp1->value,"application/json",16)==0)
     
    630632  else
    631633    geometry=createGeometryFromWFS(conf,tmp->value);
     634  if(geometry==NULL){
     635    setMapInMaps(conf,"lenv","message","Unable to parse InputPolygon value.");
     636    return SERVICE_FAILED;
     637  }
    632638  res=OGR_G_ConvexHull(geometry);
    633639  tmp1=getMapFromMaps(outputs,"Result","mimeType");
     
    656662  OGRGeometryH geometry,res;
    657663  map* tmp=getMapFromMaps(inputs,"InputPolygon","value");
    658   if(tmp==NULL)
     664  if(tmp==NULL){
     665    setMapInMaps(conf,"lenv","message","Unable to fetch InputPolygon value.");
    659666    return SERVICE_FAILED;
     667  }
    660668  map* tmp1=getMapFromMaps(inputs,"InputPolygon","mimeType");
    661669  if(strncmp(tmp1->value,"application/json",16)==0)
     
    663671  else
    664672    geometry=createGeometryFromWFS(conf,tmp->value);
     673  if(geometry==NULL){
     674    setMapInMaps(conf,"lenv","message","Unable to parse InputPolygon value.");
     675    return SERVICE_FAILED;
     676  }
    665677  res=(*myFunc)(geometry);
    666678  tmp1=getMapFromMaps(outputs,"Result","mimeType");
    667679  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);
    670684  }
    671685  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);
    673689  }
    674690  outputs->next=NULL;

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