Changeset 465
- Timestamp:
- Apr 23, 2014, 3:05:01 AM (11 years ago)
- Location:
- trunk/zoo-project
- Files:
-
- 2 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/HISTORY.txt
r434 r465 1 Version 1.4.0-dev 2 * Add the optional YAML ZCFG support #4 and the zcfg2yaml converter 3 * Return error messages that enable the service provider to quickly identify the root cause of errors due to configuration file syntax (ticket #90) 4 * Fix logic in addMapToMap (ticket #91) 5 * Enable AllowedValue and multiple Range definitions using default and supported blocks 6 * Add the lastest revision number in version.h (available in Python ZOO-API) 7 * Add the optional Ruby Language Support to the ZOO-Kernel with an API similar to the Python ZOO-API 8 * Small rewrite of Python support 9 * Inputs can be requested over https protocol (ticket #86) 10 * Add capability to define both percentage of execution and a message (ticket #87). 11 * Add usid in lenv section used to generate an unique identifier based on time and the process identifier. 12 * Add gdal_contour service 13 * Add dynamic definition of serverAddress from the main section 14 1 15 Version 1.3.0-rc2 2 16 * Fix POST Request issue (ticket #34) -
trunk/zoo-project/zoo-kernel/Makefile.in
r459 r465 12 12 JAVA_FILE=@JAVA_FILE@ 13 13 14 CFLAGS=-fpic ${ MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF15 LDFLAGS=-lcurl -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS} 14 CFLAGS=-fpic ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF 15 LDFLAGS=-lcurl -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${YAML_LDFLAGS} 16 16 17 17 PHPCFLAGS=@PHP_CPPFLAGS@ … … 27 27 28 28 29 all: zoo_loader.cgi 29 all: version.h zoo_loader.cgi ${YAML_FILE1} 30 31 version.h: 32 echo "#define ZOO_VERSION \"`svnversion -q -c -n .`\"" > version.h 30 33 31 34 main_conf_read.tab.c: main_conf_read.y service.h … … 57 60 58 61 service_internal.o: service_internal.c service.h 59 gcc ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_internal.c 62 g++ ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_internal.c 63 64 service_yaml.o: service_yaml.c service.h 65 gcc ${YAML_CFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_yaml.c 60 66 61 67 service_internal_ms.o: service_internal_ms.c … … 86 92 g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} -c zoo_service_loader.c -fno-common -DPIC -o zoo_service_loader.o 87 93 88 zoo_loader.cgi: zoo_loader.c zoo_service_loader.o ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} 94 zoo_loader.cgi: zoo_loader.c zoo_service_loader.o ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} 89 95 g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${RUBYCFLAGS} ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c -fno-common -DPIC -o zoo_loader.o 90 g++ ${JSCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PERL_FILE} ${PHP_FILE} ${JS_FILE} ${JAVA_FILE} ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi ${LDFLAGS} 96 g++ ${JSCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PERL_FILE} ${PHP_FILE} ${JS_FILE} ${JAVA_FILE} ${YAML_FILE} ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi ${LDFLAGS} 97 98 zcfg2yaml: zcfg2yaml.c ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o ${MS_FILE} ${JS_FILE} ${RUBY_FILE} ${YAML_FILE} 99 g++ -g -O2 ${JSCFLAGS} ${RUBYCFLAGS} ${XML2CFLAGS} ${CFLAGS} -c zcfg2yaml.c -fno-common -DPIC -o zcfg2yaml.o 100 g++ ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} zcfg2yaml.o service_internal.o ${MS_FILE} ${JS_FILE} ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o ${YAML_FILE} -o zcfg2yaml ${LDFLAGS} 91 101 92 102 install: -
trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in
r459 r465 5 5 MACOS_CFLAGS=-arch $(shell uname -m) 6 6 endif 7 8 YAML_CFLAGS=@YAML_CPPFLAGS@ 9 YAML_LDFLAGS=@YAML_LDFLAGS@ 10 YAML_FILE=@YAML_FILE@ 11 YAML_FILE1=@YAML_FILE1@ 7 12 8 13 GDAL_CFLAGS=@GDAL_CFLAGS@ -
trunk/zoo-project/zoo-kernel/configure.ac
r459 r465 14 14 AC_CHECK_LIB([fl], [main]) 15 15 AC_CHECK_LIB([pthread], [main]) 16 AC_CHECK_LIB([fcgi], [main])17 16 AC_CHECK_LIB([ssl], [main]) 18 17 … … 68 67 69 68 # =========================================================================== 69 # Detect if libyaml is available 70 # =========================================================================== 71 72 AC_ARG_WITH([yaml], 73 [AS_HELP_STRING([--with-yaml=PATH], [specify an alternative location for the fastcgi library])], 74 [YAMLPATH="$withval"], [YAMLPATH=""]) 75 76 if test -z "$YAMLPATH" 77 then 78 YAML_LDFLAGS="" 79 YAML_CPPFLAGS="" 80 YAML_FILE="" 81 YAML_FILE1="" 82 else 83 84 # Extract the linker and include flags 85 YAML_LDFLAGS="-L$YAMLPATH/lib -lyaml" 86 YAML_CPPFLAGS="-I$YAMLPATH/include -DYAML" 87 YAML_FILE="service_yaml.o" 88 YAML_FILE1="zcfg2yaml" 89 90 # Check headers file 91 CPPFLAGS_SAVE="$CPPFLAGS" 92 CPPFLAGS="$YAML_CPPFLAGS" 93 LDFLAGS_SAVE="$LDFLAGS" 94 LDFLAGS="YAML_LDFLAGS" 95 AC_CHECK_LIB([yaml], [yaml_parser_initialize,yaml_parser_set_input_file,yaml_parser_scan]) 96 AC_CHECK_HEADERS([yaml.h], 97 [], [AC_MSG_ERROR([could not find headers include related to YAML])]) 98 99 fi 100 AC_SUBST([YAML_CPPFLAGS]) 101 AC_SUBST([YAML_LDFLAGS]) 102 AC_SUBST([YAML_FILE]) 103 AC_SUBST([YAML_FILE1]) 104 105 # =========================================================================== 70 106 # Detect if fastcgi is available 71 107 # =========================================================================== … … 73 109 AC_ARG_WITH([fastcgi], 74 110 [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])], 75 [FCGIPATH="$withval"], [FCGIPATH=" "])111 [FCGIPATH="$withval"], [FCGIPATH="/usr"]) 76 112 77 113 # Extract the linker and include flags … … 82 118 CPPFLAGS_SAVE="$CPPFLAGS" 83 119 CPPFLAGS="$FCGI_CPPFLAGS" 120 LDFLAGS_SAVE="LDFLAGS" 121 LDFLAGS="$FCGI_LDFLAGS" 122 AC_CHECK_LIB([fcgi], [main]) 84 123 AC_CHECK_HEADERS([fcgi_stdio.h], 85 124 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])]) -
trunk/zoo-project/zoo-kernel/main.cfg
r253 r465 1 [main] 2 encoding = utf-8 3 version = 1.0.0 4 serverAddress = http://www.zoo-project.org/zoo/ 5 lang = fr-FR,en-CA 6 tmpPath=/YourFullTmpPathHere/ 7 tmpUrl = ../TmpPathRelativeToServerAdress/ 8 dataPath = /YouFullDataPathHere/ 1 [mm] 2 biLayerAlias=Carte,Ortophoto,Ortophoto 2005,Parcels,Etat Major,Cassini,Elev 3 editingToolbar=select,add,edit 4 navName=Authenticate,Permalink,Twitter sharing,Facebook sharing,Scroll,Pan,Geolocate,Track my position,Zoom Box,Zoom To Max Extent,Identify,Identify Circle,Mesure Distance,Mesure Area,Print,Profile 5 scales=443744273,221872136,110936068,55468034,27734017,13867008,6933504,3466752,1733376,866688,433344,216672,108336,54168,27084,13542,6771,3385,1692 6 rasterToolbarAlias=Profile,Contour,Shaded Relief,Color Relief,Slope Map,Clip 7 supportedDbs=PostGIS,MySQL 8 mapcacheUrl=http://127.0.0.1/cache/ 9 biLayers=GEOGRAPHICALGRIDSYSTEMS.MAPS,ORTHOIMAGERY.ORTHOPHOTOS,ORTHOIMAGERY.ORTHOPHOTOS2000-2005,CADASTRALPARCELS.PARCELS,GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40,GEOGRAPHICALGRIDSYSTEMS.CASSINI,ELEVATION.SLOPES 10 bgLayers=google.maps.MapTypeId.TERRAIN,null,google.maps.MapTypeId.SATELLITE,google.maps.MapTypeId.HYBRID 11 bpDefault=g 12 bgName=Google 13 bbLayers=Road,Aerial,AerialWithLabels 14 navIcon=auth,permalink,tshare,fshare,scroll,pan,geoloc,track,zoom-in,zoomtomaxextent,info,infocircle,dist,area,print,terrain-profile 15 bbName=Bing 16 boLayerAlias=OpenStreetMap 17 bmLayerAlias=Streets,Satelite 18 toolbars=Vector 19 navId=authenticate,permalink,tshare,fshare,scroll,control,geolocate,track,zoomin,zoomtomaxextent,getFeature,getFeatureCircle,line,polygon,print,profile 20 navIdX=authenticate,permalink,tshare,fshare,zoomtomaxextent,print 21 navIdXX=scroll 22 navIdF=loadLoginForm,permalink,shareOnTwitter,shareOnFB,gotoMaxExtent,printIntoDocument 23 nvIID=getFeature,getFeatureCircle 24 osmApiUrl=http://open.mapquestapi.com/xapi/api/0.6/ 25 vectorToolbar=buffer,spatial-buffer,centroid,boundary,convexhull,simplify,spatial-query 26 bmLayers=Map,Aerial 27 boName=OSM 28 editingToolbarAlias=Select feature,Add feature,Edit feature 29 boLayers=OSM 30 address=http://127.0.0.1/mm 31 bmName=MapQuest 32 bpList=g,b,i 33 uomsName=Foot,Meter,Deegree 34 adminTheme=green 35 vectorToolbarAlias=Buffer,BufferMask,Centroid,Boundary,ConvexHull,Simplify,SpatialQuery 36 mapcacheCfg=/Users/djay/Sites/mapcache.xml 37 dateFormat=%A %d %B %Y 38 uomsId=english,metric,geographic 39 oldToolbars=Editing,Raster 40 rasterToolbar=profile,contour,shaded_relief,color_relief,slope_map,clip 41 bgLayerAlias=Physical,Streets,Satelite,Hybrid 42 bbLayerAlias=Streets,Satelite,Hybrid 43 sizeLimit=100M 44 biName=IGN 45 46 [headers] 47 X-Powered-By=ZOO-Project@MapMint 9 48 10 49 [identification] 11 title = The Zoo WPS Development Server 12 abstract = Development version of ZooWPS. See http://www.zoo-project.org 13 fees = None 14 accessConstraints =none15 keywords = WPS,GIS,buffer 50 keywords=WPS,GIS,buffer,MapMint,ZOO-Project 51 title=ZOO-Project WPS Production Server 52 abstract=Development version of ZooWPS. See http://www.zoo-project.org 53 accessConstraints=none 54 fees=None 16 55 17 56 [provider] 18 providerName=ZOO Project 19 providerSite=http://www.zoo-project.org 57 positionName=Developer 58 providerName=GeoLabs SARL 59 addressAdministrativeArea=False 60 addressDeliveryPoint=1280, avenue des Platanes 61 addressCountry=fr 62 phoneVoice=+33 4 67 43 09 95 63 addressPostalCode=34970 64 role=Dev 65 providerSite=http://www.geolabs.fr 66 phoneFacsimile=False 67 addressElectronicMailAddress=gerald@geolabs.fr 68 addressCity=Lattes 20 69 individualName=Gerald FENOY 21 positionName=Developer 22 role=Dev 23 addressDeliveryPoint=1280, avenue des Platanes 24 addressCity=Lattes 25 addressAdministrativeArea=False 26 addressPostalCode=34970 27 addressCountry=fr 28 addressElectronicMailAddress=gerald@geolabs.fr 29 phoneVoice=False 30 phoneFacsimile=False 70 71 [main] 72 encoding=utf-8 73 isTrial=true 74 dataPath=/Users/djay/Sites/data 75 tmpPath=/Users/djay/Sites/tmp 76 supportedDbs=PostGIS,MySQL,WFS 77 cacheDir=/Users/djay/Sites/cache 78 rootUrl=/~djay/mm-np/public/ 79 publicationUrl=/~djay/pm-np/ 80 dblink=/Users/djay/Sites/mm.db 81 mmPath=/Users/djay/Sites/mm-np/ 82 sessPath=/Users/djay/Sites/tmp 83 version=1.0.0 84 dbuser=npdb 85 dcount=3 86 dbuserName=np 87 3D=false 88 Rpy2=true 89 applicationAddress=http://127.0.0.1/~djay/mm-np/ 90 mmAddress=/~djay/mm-np/ 91 publicationPath=/Users/djay/Sites/pm-np/ 92 msOgcVersion=1.0.0 93 serverAddress=http://127.0.0.1/np-bin/zoo_loader.cgi 94 lang=fr-FR,en-US,ja-JP 95 mapserverAddress=http://127.0.0.1/np-bin/mapserv.cgi 96 tmpUrl=http://127.0.0.1/~djay/tmp/ 97 templatesPath=/Users/djay/Sites/mm-np/templates/ 98 templatesAddress=http://127.0.0.1/~djay/pm-np/tmpl/ 99 crs=IGNF:LAMB93 100 jsCache=dev 101 cssCache=prod 102 cookiePrefix=MMID 103 104 [npdb] 105 host=127.0.0.1 106 schema=velo 107 user=postgres 108 dbname=demogis 109 port=5432 110 111 [oo] 112 external=true 113 path=/Applications/LibreOffice.app/Contents/program/python 114 ghostscript=/usr/local/bin/gs -
trunk/zoo-project/zoo-kernel/main_conf_read.y
r453 r465 8 8 #include <service.h> 9 9 10 static int defaultsc=0;11 10 static maps* my_maps=NULL; 12 11 static maps* current_maps=NULL; 13 static map* previous_content=NULL;14 12 static map* current_content=NULL; 15 static elements* current_element=NULL;16 static map* scontent=NULL;17 13 static char* curr_key; 18 14 static int debug=0; 19 static int previous_data=0;20 static int current_data=0;21 15 using namespace std; 22 16 -
trunk/zoo-project/zoo-kernel/makefile.vc
r453 r465 9 9 10 10 all: zoo_loader.cgi 11 12 version.h: 13 svnversion -q -c -n . > version_0.h 14 set /p VERS=<version_0.h 15 rm version_0.h 16 echo #define ZOO_VERSION "%VERS%" > version.h 11 17 12 18 main_conf_read.tab.c: main_conf_read.y service.h -
trunk/zoo-project/zoo-kernel/service.h
r458 r465 82 82 #define SHMSZ 27 83 83 84 #include "version.h" 84 85 85 86 #ifdef DEBUG_STACK … … 133 134 static void _dumpMap(map* t){ 134 135 if(t!=NULL){ 135 fprintf(stderr," [%s] => [%s]\n",t->name,t->value);136 fprintf(stderr,"%s: %s\n",t->name,t->value); 136 137 fflush(stderr); 137 138 }else{ … … 437 438 map* tmp=mi; 438 439 map* _cursor=*mo; 439 if(tmp==NULL){440 if(_cursor!=NULL){441 while(_cursor!=NULL)442 _cursor=_cursor->next;443 _cursor=NULL;444 }else445 *mo=NULL;446 }447 440 while(tmp!=NULL){ 448 441 if(_cursor==NULL){ 449 if(*mo==NULL) 450 *mo=createMap(tmp->name,tmp->value); 451 else 452 addToMap(*mo,tmp->name,tmp->value); 442 *mo=createMap(tmp->name,tmp->value); 443 (*mo)->next=NULL; 453 444 } 454 445 else{ … … 457 448 dumpMap(_cursor); 458 449 #endif 459 while(_cursor !=NULL)450 while(_cursor->next!=NULL) 460 451 _cursor=_cursor->next; 461 _cursor=createMap(tmp->name,tmp->value); 462 _cursor->next=NULL; 463 } 452 map* tmp1=getMap(_cursor,tmp->name); 453 if(tmp1==NULL) 454 _cursor->next=createMap(tmp->name,tmp->value); 455 else{ 456 free(tmp1->value); 457 tmp1->value=zStrdup(tmp->value); 458 } 459 } 460 _cursor=*mo; 464 461 tmp=tmp->next; 465 462 #ifdef DEBUG … … 568 565 if(_cursor==NULL){ 569 566 *mo=dupMaps(&mi); 570 (*mo)->next=NULL;571 567 } 572 568 else{ 569 maps* tmp1=getMaps(*mo,tmp->name); 573 570 while(_cursor->next!=NULL) 574 571 _cursor=_cursor->next; 575 _cursor->next=dupMaps(&tmp); 572 if(tmp1==NULL) 573 _cursor->next=dupMaps(&tmp); 574 else 575 addMapToMap(&tmp1->content,tmp->content); 576 _cursor=*mo; 576 577 } 577 578 tmp=tmp->next; … … 603 604 else 604 605 sprintf(tmp,"%s",key); 605 map* tmpSize=getMapArray(m, "size",index);606 map* tmpSize=getMapArray(m,(char*)"size",index); 606 607 if(tmpSize!=NULL && strncasecmp(key,"value",5)==0){ 607 608 #ifdef DEBUG 608 609 fprintf(stderr,"%s\n",tmpSize->value); 609 610 #endif 610 map* ptr=getMapOrFill(m,tmp, "");611 map* ptr=getMapOrFill(m,tmp,(char *)""); 611 612 free(ptr->value); 612 613 ptr->value=(char*)malloc((atoi(tmpSize->value)+1)*sizeof(char)); … … 618 619 619 620 static map* getMapType(map* mt){ 620 map* tmap=getMap(mt, "mimeType");621 map* tmap=getMap(mt,(char *)"mimeType"); 621 622 if(tmap==NULL){ 622 623 tmap=getMap(mt,"dataType"); … … 646 647 647 648 char *tmpV[8]={ 648 "size",649 "value",650 "uom",651 "Reference",652 "xlink:href",649 (char*)"size", 650 (char*)"value", 651 (char*)"uom", 652 (char*)"Reference", 653 (char*)"xlink:href", 653 654 typ, 654 "schema",655 "encoding"655 (char*)"schema", 656 (char*)"encoding" 656 657 }; 657 658 sprintf(tmpLen,"%d",len+1); … … 730 731 } 731 732 733 static void dumpElementsAsYAML(elements* e){ 734 elements* tmp=e; 735 while(tmp!=NULL){ 736 for(int i=0;i<2;i++) 737 fprintf(stderr," "); 738 fprintf(stderr,"%s:\n",tmp->name); 739 map* mcurs=tmp->content; 740 while(mcurs!=NULL){ 741 for(int i=0;i<4;i++) 742 fprintf(stderr," "); 743 _dumpMap(mcurs); 744 mcurs=mcurs->next; 745 } 746 mcurs=tmp->metadata; 747 if(mcurs!=NULL){ 748 for(int i=0;i<4;i++) 749 fprintf(stderr," "); 750 fprintf(stderr,"MetaData:\n"); 751 while(mcurs!=NULL){ 752 for(int i=0;i<6;i++) 753 fprintf(stderr," "); 754 _dumpMap(mcurs); 755 mcurs=mcurs->next; 756 } 757 } 758 for(int i=0;i<4;i++) 759 fprintf(stderr," "); 760 fprintf(stderr,"%s:\n",tmp->format); 761 iotype* tmpio=tmp->defaults; 762 int ioc=0; 763 while(tmpio!=NULL){ 764 for(int i=0;i<6;i++) 765 fprintf(stderr," "); 766 fprintf(stderr,"default:\n"); 767 mcurs=tmpio->content; 768 while(mcurs!=NULL){ 769 for(int i=0;i<8;i++) 770 fprintf(stderr," "); 771 if(strcasecmp(mcurs->name,"range")==0){ 772 fprintf(stderr,"range: \"%s\"\n",mcurs->value); 773 }else 774 _dumpMap(mcurs); 775 mcurs=mcurs->next; 776 } 777 tmpio=tmpio->next; 778 ioc++; 779 } 780 tmpio=tmp->supported; 781 ioc=0; 782 while(tmpio!=NULL){ 783 for(int i=0;i<6;i++) 784 fprintf(stderr," "); 785 fprintf(stderr,"supported:\n"); 786 mcurs=tmpio->content; 787 while(mcurs!=NULL){ 788 for(int i=0;i<8;i++) 789 fprintf(stderr," "); 790 if(strcasecmp(mcurs->name,"range")==0){ 791 fprintf(stderr,"range: \"%s\"\n",mcurs->value); 792 }else 793 _dumpMap(mcurs); 794 mcurs=mcurs->next; 795 } 796 tmpio=tmpio->next; 797 ioc++; 798 } 799 tmp=tmp->next; 800 } 801 } 802 803 732 804 static elements* dupElements(elements* e){ 733 805 elements* cursor=e; … … 805 877 } 806 878 fprintf(stderr,"++++++++++++++++++\n"); 879 } 880 881 static void dumpServiceAsYAML(service* s){ 882 int level=0; 883 fprintf(stderr,"# %s\n\n",s->name); 884 if(s->content!=NULL){ 885 map* mcurs=s->content; 886 dumpMap(mcurs); 887 mcurs=s->metadata; 888 if(mcurs!=NULL){ 889 fprintf(stderr,"MetaData:\n"); 890 while(mcurs!=NULL){ 891 for(int i=0;i<2;i++) 892 fprintf(stderr," "); 893 _dumpMap(mcurs); 894 mcurs=mcurs->next; 895 } 896 } 897 } 898 if(s->inputs!=NULL){ 899 fprintf(stderr,"\ninputs:\n",s->name); 900 dumpElementsAsYAML(s->inputs); 901 } 902 if(s->outputs!=NULL){ 903 fprintf(stderr,"\noutputs:\n",s->name); 904 dumpElementsAsYAML(s->outputs); 905 } 807 906 } 808 907 -
trunk/zoo-project/zoo-kernel/service_conf.l
r229 r465 22 22 #endif 23 23 24 24 char *lmsg; 25 25 int attentionImpossibleDeTrouverXMLDeclapres = 0 ; 26 26 … … 41 41 42 42 attname [a-zA-Z0-9_\-]+ 43 attvalue1 [\^\*\+,;@a-zA-Z0-9_\-::.:" "\"\'/\\\(\)\t\|\$\&> ]+43 attvalue1 [\^\*\+,;@a-zA-Z0-9_\-::.:" "\"\'/\\\(\)\t\|\$\&>\[\]]+ 44 44 45 45 attvalue \"[^"]*\"|\'[^']*\'\(\) … … 118 118 119 119 120 <INITIAL,DANSBALISE,HORSBALISE>.|\n { fprintf(stderr,"error : ligne %d : caractere non reconnu '%s'\n",srlineno,yytext);}120 <INITIAL,DANSBALISE,HORSBALISE>.|\n {lmsg=(char*)malloc(1024*sizeof(char));sprintf(lmsg,"error: line %d: character not allowed '%s'",srlineno,yytext);fprintf(stderr,"%s \n",lmsg);srlval.chaine=lmsg;return -1;} 121 121 122 122 %% -
trunk/zoo-project/zoo-kernel/service_conf.y
r453 r465 24 24 static bool wait_outputs=false; 25 25 static bool wait_data=false; 26 static int services_c=0;27 26 static service* my_service=NULL; 28 static map* previous_content=NULL;29 27 static map* current_content=NULL; 30 28 static elements* current_element=NULL; 31 static map* scontent=NULL;32 29 static char* curr_key; 33 30 static int debug=0; … … 772 769 * definition file. 773 770 */ 774 int getServiceFromFile(const char* file,service** service){ 775 776 freeMap(&previous_content); 777 previous_content=NULL; 778 freeMap(¤t_content); 779 current_content=NULL; 780 freeMap(&scontent); 771 int getServiceFromFile(maps* conf,const char* file,service** service){ 772 if(current_content!=NULL){ 773 freeMap(¤t_content); 774 free(current_content); 775 current_content=NULL; 776 } 781 777 #ifdef DEBUG_SERVICE_CONF 782 778 fprintf(stderr,"(STARTING)FREE current_element\n"); 783 779 #endif 784 freeElements(¤t_element); 785 free(current_element); 786 current_element=NULL; 780 if(current_element!=NULL){ 781 freeElements(¤t_element); 782 free(current_element); 783 current_element=NULL; 784 } 787 785 my_service=NULL; 788 scontent=NULL;789 786 790 787 wait_maincontent=true; … … 810 807 int resultatYYParse = srparse() ; 811 808 809 #ifdef DEBUG_SERVICE_CONF 810 fprintf(stderr,"RESULT: %d %d\n",resultatYYParse,wait_outputs); 811 #endif 812 812 if(wait_outputs && current_element!=NULL && current_element->name!=NULL){ 813 813 if(my_service->outputs==NULL){ … … 848 848 dumpService(my_service); 849 849 #endif 850 *service=my_service; 850 if(wait_outputs<0 || my_service==NULL || my_service->name==NULL || my_service->content==NULL || my_service->inputs==NULL || my_service->outputs==NULL){ 851 setMapInMaps(conf,"lenv","message",srlval.chaine); 852 #ifndef WIN32 853 srlex_destroy(); 854 #endif 855 return -1; 856 } 857 else 858 *service=my_service; 851 859 852 860 #ifndef WIN32 -
trunk/zoo-project/zoo-kernel/service_internal.c
r464 r465 34 34 #define FALSE -1 35 35 #endif 36 37 int readServiceFile(maps* conf, char* file,service** service,char *name){ 38 int t=getServiceFromFile(conf,file,service); 39 #ifdef YAML 40 if(t<0){ 41 t=getServiceFromYAML(conf,file,service,name); 42 } 43 #endif 44 return t; 45 } 36 46 37 47 void printHeaders(maps* m){ … … 883 893 884 894 void printFullDescription(elements *elem,const char* type,xmlNsPtr ns_ows,xmlNodePtr nc1){ 885 char *orderedFields[1 2];895 char *orderedFields[13]; 886 896 orderedFields[0]="mimeType"; 887 897 orderedFields[1]="encoding"; … … 892 902 orderedFields[6]="value"; 893 903 orderedFields[7]="AllowedValues"; 894 orderedFields[8]="rangeMin"; 895 orderedFields[9]="rangeMax"; 896 orderedFields[10]="rangeClosure"; 897 orderedFields[11]="rangeSpace"; 904 orderedFields[8]="range"; 905 orderedFields[9]="rangeMin"; 906 orderedFields[10]="rangeMax"; 907 orderedFields[11]="rangeClosure"; 908 orderedFields[12]="rangeSpace"; 898 909 899 910 xmlNodePtr nc2,nc3,nc4,nc5,nc6,nc7,nc8; … … 935 946 nc3 = xmlNewNode(NULL, BAD_CAST e->format); 936 947 } 948 iotype* _tmp0=NULL; 937 949 iotype* _tmp=e->defaults; 938 950 int datatype=0; … … 961 973 int dcnt=0; 962 974 int oI=0; 963 for(oI=0;oI<1 2;oI++)975 for(oI=0;oI<13;oI++) 964 976 if((tmp1=getMap(_tmp->content,orderedFields[oI]))!=NULL){ 965 977 //while(tmp1!=NULL){ … … 1018 1030 token=strtok_r(NULL,",",&saveptr1); 1019 1031 } 1020 if(getMap(_tmp->content,"rangeMin")!=NULL || 1032 if(getMap(_tmp->content,"range")!=NULL || 1033 getMap(_tmp->content,"rangeMin")!=NULL || 1021 1034 getMap(_tmp->content,"rangeMax")!=NULL || 1022 1035 getMap(_tmp->content,"rangeClosure")!=NULL ) … … 1029 1042 nc6 = xmlNewNode(ns_ows, BAD_CAST "AllowedValues"); 1030 1043 doRange: 1044 1045 /** 1046 * Range: Table 46 OGC Web Services Common Standard 1047 */ 1031 1048 nc8 = xmlNewNode(ns_ows, BAD_CAST "Range"); 1032 map *tmp0=getMap(tmp1,"rangeMin"); 1049 1050 map* tmp0=getMap(tmp1,"range"); 1051 if(tmp0!=NULL){ 1052 char* pToken; 1053 char* orig=zStrdup(tmp0->value); 1054 /** 1055 * RangeClosure: Table 47 OGC Web Services Common Standard 1056 */ 1057 char *tmp="closed"; 1058 if(orig[0]=='[' && orig[strlen(orig)-1]=='[') 1059 tmp="closed-open"; 1060 else 1061 if(orig[0]==']' && orig[strlen(orig)-1]==']') 1062 tmp="open-closed"; 1063 else 1064 if(orig[0]==']' && orig[strlen(orig)-1]=='[') 1065 tmp="open"; 1066 xmlNewNsProp(nc8,ns_ows,BAD_CAST "rangeClosure",BAD_CAST tmp); 1067 pToken=strtok(orig,","); 1068 int nci0=0; 1069 while(pToken!=NULL){ 1070 char *tmpStr=(char*) malloc((strlen(pToken))*sizeof(char)); 1071 if(nci0==0){ 1072 nc7 = xmlNewNode(ns_ows, BAD_CAST "MinimumValue"); 1073 int nci=1; 1074 for(nci=1;nci<strlen(pToken);nci++){ 1075 tmpStr[nci-1]=pToken[nci]; 1076 } 1077 }else{ 1078 nc7 = xmlNewNode(ns_ows, BAD_CAST "MaximumValue"); 1079 int nci=0; 1080 for(nci=0;nci<strlen(pToken)-1;nci++){ 1081 tmpStr[nci]=pToken[nci]; 1082 } 1083 } 1084 xmlAddChild(nc7,xmlNewText(BAD_CAST tmpStr)); 1085 xmlAddChild(nc8,nc7); 1086 nci0++; 1087 pToken = strtok(NULL,","); 1088 } 1089 if(getMap(tmp1,"rangeSpacing")==NULL){ 1090 nc7 = xmlNewNode(ns_ows, BAD_CAST "Spacing"); 1091 xmlAddChild(nc7,xmlNewText(BAD_CAST "1")); 1092 xmlAddChild(nc8,nc7); 1093 } 1094 }else{ 1095 1096 tmp0=getMap(tmp1,"rangeMin"); 1033 1097 if(tmp0!=NULL){ 1034 1098 nc7 = xmlNewNode(ns_ows, BAD_CAST "MinimumValue"); … … 1068 1132 }else 1069 1133 xmlNewNsProp(nc8,ns_ows,BAD_CAST "rangeClosure",BAD_CAST "closed"); 1134 } 1135 if(_tmp0==NULL){ 1136 xmlAddChild(nc6,nc8); 1137 _tmp0=e->supported; 1138 tmp1=_tmp0->content; 1139 goto doRange; 1140 }else{ 1141 _tmp0=_tmp0->next; 1142 if(_tmp0!=NULL){ 1143 xmlAddChild(nc6,nc8); 1144 tmp1=_tmp0->content; 1145 goto doRange; 1146 } 1147 1148 } 1149 xmlAddChild(nc6,nc8); 1150 xmlAddChild(nc3,nc6); 1151 isAnyValue=-1; 1070 1152 } 1071 xmlAddChild(nc6,nc8);1072 xmlAddChild(nc3,nc6);1073 isAnyValue=-1;1074 1153 } 1075 1154 } … … 1096 1175 avcnt++; 1097 1176 } 1177 } 1178 1179 map* metadata=e->metadata; 1180 xmlNodePtr n; 1181 int xlinkId=zooXmlAddNs(n,"http://www.w3.org/1999/xlink","xlink"); 1182 xmlNsPtr ns_xlink=usedNs[xlinkId]; 1183 1184 while(metadata!=NULL){ 1185 nc6=xmlNewNode(ns_ows, BAD_CAST "MetaData"); 1186 xmlNewNsProp(nc6,ns_xlink,BAD_CAST metadata->name,BAD_CAST metadata->value); 1187 xmlAddChild(nc2,nc6); 1188 metadata=metadata->next; 1098 1189 } 1099 1190 } -
trunk/zoo-project/zoo-kernel/service_internal.h
r459 r465 65 65 #include "ulinet.h" 66 66 67 extern int getServiceFromFile( const char*,service**);67 extern int getServiceFromFile(maps*,const char*,service**); 68 68 extern int conf_read(const char*,maps*); 69 69 … … 88 88 static char* nsName[10]; 89 89 static int nbNs=0; 90 91 int getServiceFromYAML(maps*,char*,service**,char *name); 92 int readServiceFile(maps*, char*,service**,char *); 93 90 94 91 95 void printHeaders(maps*); -
trunk/zoo-project/zoo-kernel/service_internal_python.c
r458 r465 101 101 tmp = PyInt_FromLong(4); 102 102 PyDict_SetItemString(d, "SERVICE_FAILED", tmp); 103 Py_DECREF(tmp); 104 105 tmp = PyString_FromString(ZOO_VERSION); 106 PyDict_SetItemString(d, "VERSION", tmp); 103 107 Py_DECREF(tmp); 104 108 -
trunk/zoo-project/zoo-kernel/zoo_loader.c
r459 r465 117 117 }else{ 118 118 char *buffer=new char[cgiContentLength+1]; 119 int r=0;120 119 if(fread(buffer,sizeof(char),cgiContentLength,cgiIn)>=0){ 121 120 buffer[cgiContentLength]=0; … … 223 222 if(req!=NULL && req->nodeNr==1){ 224 223 addToMap(tmpMap,"soap","true"); 225 int k=0; 226 for(k;k < req->nodeNr;k++){ 227 xmlNsPtr ns=xmlNewNs(req->nodeTab[k],BAD_CAST "http://www.w3.org/2001/XMLSchema-instance",BAD_CAST "xsi"); 224 for(int k=0;k < req->nodeNr;k++){ 225 //xmlNsPtr ns=xmlNewNs(req->nodeTab[k],BAD_CAST "http://www.w3.org/2001/XMLSchema-instance",BAD_CAST "xsi"); 228 226 xmlDocSetRootElement(doc, req->nodeTab[k]); 229 227 xmlChar *xmlbuff; … … 231 229 xmlDocDumpFormatMemoryEnc(doc, &xmlbuff, &buffersize, "utf-8", 1); 232 230 addToMap(tmpMap,"xrequest",(char*)xmlbuff); 233 char *tmp=(char*)xmlbuff;234 231 xmlFree(xmlbuff); 235 232 } -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r459 r465 239 239 map* r_inputs=NULL; 240 240 #ifndef WIN32 241 char* pntmp=getcwd(ntmp,1024);241 getcwd(ntmp,1024); 242 242 #else 243 243 _getcwd(ntmp,1024); … … 560 560 char ntmp[1024]; 561 561 #ifndef WIN32 562 char *pntmp=getcwd(ntmp,1024);562 getcwd(ntmp,1024); 563 563 #else 564 564 _getcwd(ntmp,1024); … … 760 760 while ((dp = readdir(dirp)) != NULL) 761 761 if(strstr(dp->d_name,".zcfg")!=0){ 762 int t; 762 763 memset(tmps1,0,1024); 763 764 snprintf(tmps1,1024,"%s/%s",conf_dir,dp->d_name); … … 769 770 fprintf(stderr,"#################\n%s\n#################\n",tmps1); 770 771 #endif 771 t=getServiceFromFile(tmps1,&s1); 772 t=readServiceFile(m,tmps1,&s1,dp->d_name); 773 if(t<0){ 774 dumpMaps(m); 775 map* tmp00=getMapFromMaps(m,"lenv","message"); 776 char tmp01[1024]; 777 sprintf(tmp01,_("Unable to parse the ZCFG file: %s (%s)"),dp->d_name,tmp00->value); 778 dup2(saved_stdout,fileno(stdout)); 779 errorException(m, tmp01,"InternalError",NULL); 780 freeMaps(&m); 781 free(m); 782 return 1; 783 } 784 772 785 #ifdef DEBUG 773 786 dumpService(s1); … … 828 841 829 842 r_inputs=getMap(request_inputs,"Identifier"); 830 char *tmps=strtok(r_inputs->value,","); 843 844 char *saveptr; 845 char *orig=zStrdup(r_inputs->value); 846 char *tmps=strtok_r(orig,",",&saveptr); 831 847 832 848 char buff[256]; … … 839 855 memset(buff1,0,1024); 840 856 #ifdef DEBUG 841 printf("\n#######%s\n########\n",buff 1);857 printf("\n#######%s\n########\n",buff); 842 858 #endif 843 859 while ((dp = readdir(dirp)) != NULL) … … 852 868 } 853 869 #ifdef DEBUG 854 printf("#################\n%s\n#################\n",buff1); 855 #endif 856 t=getServiceFromFile(buff1,&s1); 870 printf("#################\n(%s) %s\n#################\n",r_inputs->value,buff1); 871 #endif 872 char *tmp0=zStrdup(dp->d_name); 873 tmp0[strlen(tmp0)-5]=0; 874 t=readServiceFile(m,buff1,&s1,tmp0); 875 free(tmp0); 876 if(t<0){ 877 map* tmp00=getMapFromMaps(m,"lenv","message"); 878 char tmp01[1024]; 879 if(tmp00!=NULL) 880 sprintf(tmp01,_("Unable to parse the ZCFG file: %s (%s)"),dp->d_name,tmp00->value); 881 else 882 sprintf(tmp01,_("Unable to parse the ZCFG file: %s."),dp->d_name); 883 dup2(saved_stdout,fileno(stdout)); 884 errorException(m, tmp01,"InternalError",NULL); 885 freeMaps(&m); 886 free(m); 887 return 1; 888 } 857 889 #ifdef DEBUG 858 890 dumpService(s1); … … 861 893 freeService(&s1); 862 894 free(s1); 895 s1=NULL; 863 896 scount++; 864 897 } 865 898 rewinddir(dirp); 866 tmps=strtok (NULL,",");899 tmps=strtok_r(NULL,",",&saveptr); 867 900 } 868 901 closedir(dirp); 869 902 fflush(stdout); 870 903 dup2(saved_stdout,fileno(stdout)); 904 free(orig); 871 905 printDocument(m,doc,getpid()); 872 906 freeMaps(&m); … … 917 951 int saved_stdout = dup(fileno(stdout)); 918 952 dup2(fileno(stderr),fileno(stdout)); 919 t= getServiceFromFile(tmps1,&s1);953 t=readServiceFile(m,tmps1,&s1,r_inputs->value); 920 954 fflush(stdout); 921 955 dup2(saved_stdout,fileno(stdout)); … … 2181 2215 addToMap(_tmpMaps->content,"sid",tmpBuff); 2182 2216 addToMap(_tmpMaps->content,"status","0"); 2217 addToMap(_tmpMaps->content,"cwd",ntmp); 2183 2218 addToMap(_tmpMaps->content,"message",_("No message provided")); 2184 addToMap(_tmpMaps->content,"cwd",ntmp);2185 2219 map* ltmp=getMap(request_inputs,"soap"); 2186 2220 if(ltmp!=NULL) … … 2248 2282 freeMaps(&_tmpMaps); 2249 2283 free(_tmpMaps); 2250 2284 2251 2285 #ifdef DEBUG 2252 2286 dumpMap(request_inputs); … … 2265 2299 } 2266 2300 #endif 2267 int hrstd=-1;2268 2301 char *fbkp,*fbkp1; 2269 2302 FILE *f0,*f1; -
trunk/zoo-project/zoo-services/ogr/base-vect-ops-py/cgi-env/CentroidPy.zcfg
r106 r465 1 [CentroidPy] 2 Title = Get the centroid of a polygon. 3 Abstract = Compute the geometry centroid. 4 Profile = urn:ogc:wps:1.0.0:centroid 5 processVersion = 2 1 [Clean] 2 Title = Extract the feature that have a valid geometry field. 3 Abstract = Extract the feature that have a valid geometry field. 4 processVersion = 1 6 5 storeSupported = true 7 6 statusSupported = true 8 7 serviceProvider = ogr_sp 9 8 serviceType = Python 10 <MetaData>11 title = Demo12 </MetaData>13 9 <DataInputs> 14 [Input Polygon]10 [InputData] 15 11 Title = Polygon to get the centroid 16 12 Abstract = The centroid which is not necessarily within the geometry. 17 13 minOccurs = 1 18 14 maxOccurs = 1 19 <MetaData>20 title = Mon test21 </MetaData>22 15 <ComplexData> 23 16 <Default> … … 37 30 Title = The Centroid 38 31 Abstract = JSON String / GML Entity of the centroid 39 <MetaData>40 title = Mon test41 </MetaData>42 32 <ComplexData> 43 33 <Default> -
trunk/zoo-project/zoo-services/ogr/base-vect-ops-py/cgi-env/ogr_sp.py
r447 r465 52 52 print >> sys.stderr,e 53 53 return [] 54 54 55 55 def buildFeatureFromGeomtry(conf,geom,driverName,ext): 56 56 drv = osgeo.ogr.GetDriverByName( driverName ) … … 69 69 def createGeometryFromWFS(conf,my_wfs_response): 70 70 try: 71 geom=osgeo.ogr.CreateGeometryFromGML(my_wfs_response.replace('<?xml version="1.0" encoding="utf-8"?>\n','')) 72 except: 71 geom=osgeo.ogr.CreateGeometryFromGML(my_wfs_response.replace('<?xml version="1.0" encoding="utf-8"?>\n','').replace('<?xml version=\'1.0\' encoding="utf-8"?>\n','')) 72 except Exception,e: 73 print >> sys.stderr,"**" 74 print >> sys.stderr,e 73 75 geom=None 74 76 try: 77 print >> sys.stderr,geom is None 75 78 if geom is None: 76 79 if not(conf["lenv"].has_key("cnt")): … … 98 101 99 102 def outputResult(conf,obj,geom): 100 driverName = "GML" 101 extension = [ ".xml" , ".xsd" ] 103 if obj["mimeType"].count("text/xml")>0: 104 driverName = "GML" 105 extension = [ ".xml" , ".xsd" ] 106 format_list = { "2.": 'GML2', "3.1.1": 'GML3', "3.1": 'GML3Deegree', "3.2": 'GML3.2' } 107 opts=['FORMAT=%s,GML3_LONGSRS=YES',format_list["3.2"]] 108 for i in format_list: 109 if obj["mimeType"].count(i)>0: 110 opts=['FORMAT=%s,GML3_LONGSRS=YES',format_list[i]] 102 111 if obj["mimeType"]=="application/json": 103 112 driverName = "GeoJSON" 104 113 extension = [ ".js" ] 114 opts=None 105 115 if obj.keys().count("schema")>0 and \ 106 116 obj["schema"]=="http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd": 107 117 driverName = "KML" 108 118 extension = [ ".kml" ] 119 opts=None 109 120 drv = osgeo.ogr.GetDriverByName( driverName ) 110 # Create virtual file 111 ds = drv.CreateDataSource( "/vsimem/store"+conf["lenv"]["sid"]+extension[0] ) 121 print >> sys.stderr,drv 122 # Create virtual file 123 ds = drv.CreateDataSource( "/vsimem/store"+conf["lenv"]["sid"]+extension[0],options = opts) 124 print >> sys.stderr,ds 112 125 lyr = ds.CreateLayer( "Result", None, osgeo.ogr.wkbUnknown ) 113 i=0 126 print >> sys.stderr,lyr 127 i=0 128 print >> sys.stderr,driverName 129 print >> sys.stderr,extension 114 130 while i < len(geom): 115 131 if i==0 and driverName!="GeoJSON": … … 123 139 oFieldDefn.SetPrecision( poSrcFieldDefn.GetPrecision() ) 124 140 lyr.CreateField( oFieldDefn ) 125 lyr.CreateFeature(geom[i]) 141 try: 142 lyr.CreateFeature(geom[i]) 143 except: 144 pass 126 145 geom[i].Destroy() 127 146 i+=1 … … 157 176 outputResult(conf,outputs["Result"],rgeometries) 158 177 i=0 178 return zoo.SERVICE_SUCCEEDED 179 180 def Clean(conf,inputs,outputs): 181 from shapely.wkb import loads 182 print >> sys.stderr, "Starting service ..." 183 features=extractInputs(conf,inputs["InputData"]) 184 i=0 185 rgeometries=[] 186 while i < len(features): 187 tmp=features[i].Clone() 188 resg=features[i].GetGeometryRef() 189 if resg is not None: 190 geom = loads(resg.ExportToWkb()) 191 if geom.is_valid: 192 tmp.SetGeometryDirectly(resg) 193 rgeometries+=[tmp] 194 print >> sys.stderr,"valid !" 195 else: 196 print >> sys.stderr,"invalid !" 197 print >> sys.stderr,geom.wkt[0:50] 198 features[i].Destroy() 199 resg.thisown=False 200 tmp.thisown=False 201 i+=1 202 outputResult(conf,outputs["Result"],rgeometries) 203 i=0 204 print >> sys.stderr,"Return" 205 return zoo.SERVICE_SUCCEEDED 206 207 def TransformService(conf,inputs,outputs): 208 from osgeo import osr 209 geometry=extractInputs(conf,inputs["InputData"]) 210 sourceRef = osr.SpatialReference() 211 tmp=inputs["SourceCRS"]["value"].split(":") 212 sourceRef.ImportFromEPSG(int(tmp[len(tmp)-1])) 213 targetRef = osr.SpatialReference() 214 tmp=inputs["TargetCRS"]["value"].split(":") 215 targetRef.ImportFromEPSG(int(tmp[len(tmp)-1])) 216 transform = osr.CoordinateTransformation(sourceRef, targetRef) 217 i=0 218 rgeometries=[] 219 while i < len(geometry): 220 tmp=geometry[i].Clone() 221 resg=geometry[i].GetGeometryRef() 222 resg.Transform(transform) 223 tmp.SetGeometryDirectly(resg.Clone()) 224 rgeometries+=[tmp] 225 geometry[i].Destroy() 226 i+=1 227 outputResult(conf,outputs["TransformedData"],rgeometries) 159 228 return zoo.SERVICE_SUCCEEDED 160 229
Note: See TracChangeset
for help on using the changeset viewer.