Changeset 917 for trunk/zoo-project/zoo-services
- Timestamp:
- May 7, 2019, 2:17:08 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
False
/branches/prototype-v0 merged eligible
-
Property
svn:mergeinfo
set to
False
-
trunk/zoo-project/zoo-services/cgal/Makefile
r779 r917 1 1 ZRPATH=../.. 2 2 include ${ZRPATH}/zoo-kernel/ZOOMakefile.opts 3 CFLAGS= -I${INST_INCLUDE}${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} ${CGAL_CFLAGS} -frounding-math -fPIC -DLINUX_FREE_ISSUE #-DDEBUG3 CFLAGS= ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} ${CGAL_CFLAGS} -frounding-math -fPIC -DLINUX_FREE_ISSUE #-DDEBUG 4 4 CC=gcc 5 5 … … 7 7 g++ ${CFLAGS} -c ./delaunay.c 8 8 g++ ${CFLAGS} -c ./voronoi.c 9 g++ ${CFLAGS} -shared -o cgi-env/cgal_service.zo ./delaunay.o ./voronoi.o ./cgal_service.o ${GDAL_LIBS} ${ MACOS_LD_FLAGS} ${CGAL_LDFLAGS} -lCGAL -lgmp ${GDAL_LIBS} -L${ZRPATH}/zoo-kernel/ -lzoo_service9 g++ ${CFLAGS} -shared -o cgi-env/cgal_service.zo ./delaunay.o ./voronoi.o ./cgal_service.o ${GDAL_LIBS} ${CGAL_LDFLAGS} -lCGAL -lgmp ${GDAL_LIBS} -L${ZRPATH}/zoo-kernel/ -lzoo_service -lfcgi 10 10 11 11 cgal_service.o: cgal_service.c cgal_service.h -
trunk/zoo-project/zoo-services/cgal/cgal_service.c
r775 r917 24 24 #include "cgal_service.h" 25 25 26 int parseInput(maps* conf,maps* inputs, std::vector<Point >* points,char* filename){26 int parseInput(maps* conf,maps* inputs, std::vector<Pointz>* points,char* filename){ 27 27 map* tmpm=NULL; 28 tmpm=getMapFromMaps(inputs,"InputPoints","value"); 29 VSILFILE *ifile=VSIFileFromMemBuffer(filename,(GByte*)tmpm->value,strlen(tmpm->value),FALSE); 30 VSIFCloseL(ifile); 28 tmpm=getMapFromMaps(inputs,"InputPoints","cache_file"); 31 29 #if GDAL_VERSION_MAJOR >= 2 32 GDALDataset *ipoDS = 33 (GDALDataset*) GDALOpenEx( filename, 34 GDAL_OF_READONLY | GDAL_OF_VECTOR, 35 NULL, NULL, NULL ); 30 GDALDataset *ipoDS; 36 31 #else 37 OGRDataSource* ipoDS = OGRSFDriverRegistrar::Open(filename,FALSE);32 OGRDataSource* ipoDS; 38 33 #endif 34 if(tmpm==NULL){ 35 tmpm=getMapFromMaps(inputs,"InputPoints","value"); 36 VSILFILE *ifile=VSIFileFromMemBuffer(filename,(GByte*)tmpm->value,strlen(tmpm->value),FALSE); 37 VSIFCloseL(ifile); 38 #if GDAL_VERSION_MAJOR >= 2 39 ipoDS = (GDALDataset*) GDALOpenEx( filename, 40 GDAL_OF_READONLY | GDAL_OF_VECTOR, 41 NULL, NULL, NULL ); 42 #else 43 ipoDS = OGRSFDriverRegistrar::Open(filename,FALSE); 44 #endif 45 }else 46 #if GDAL_VERSION_MAJOR >= 2 47 ipoDS = (GDALDataset*) GDALOpenEx( tmpm->value, 48 GDAL_OF_READONLY | GDAL_OF_VECTOR, 49 NULL, NULL, NULL ); 50 #else 51 ipoDS = OGRSFDriverRegistrar::Open(tmpm->value,FALSE); 52 #endif 53 39 54 if( ipoDS == NULL ) 40 55 { … … 87 102 break; 88 103 if(poFeature->GetGeometryRef() != NULL){ 89 points->push_back(Point (OGR_G_GetX(poFeature->GetGeometryRef(),0),OGR_G_GetY(poFeature->GetGeometryRef(),0)));104 points->push_back(Pointz(OGR_G_GetX(poFeature->GetGeometryRef(),0),OGR_G_GetY(poFeature->GetGeometryRef(),0))); 90 105 } 91 106 } -
trunk/zoo-project/zoo-services/cgal/cgal_service.h
r469 r917 38 38 39 39 typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; 40 typedef Kernel::Point_2 Point ;40 typedef Kernel::Point_2 Pointz; 41 41 42 int parseInput(maps*,maps*, std::vector<Point >*,char*);42 int parseInput(maps*,maps*, std::vector<Pointz>*,char*); 43 43 44 44 #endif -
trunk/zoo-project/zoo-services/cgal/cgi-env/Voronoi.zcfg
r536 r917 46 46 </Default> 47 47 <Supported> 48 mimeType = image/png 49 useMapserver = true 50 asReference = true 51 msStyle = STYLE COLOR 125 0 105 OUTLINECOLOR 0 0 0 WIDTH 0.3 OPACITY 65 END 52 </Supported> 53 <Supported> 48 54 mimeType = text/xml 49 55 encoding = base64 -
trunk/zoo-project/zoo-services/cgal/delaunay.c
r775 r917 40 40 OGRRegisterAll(); 41 41 42 std::vector<Point > points;42 std::vector<Pointz> points; 43 43 if(int res=parseInput(conf,inputs,&points,"/vsimem/tmp")!=SERVICE_SUCCEEDED) 44 44 return res; -
trunk/zoo-project/zoo-services/cgal/voronoi.c
r775 r917 24 24 25 25 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> 26 #include <CGAL/Triangulation_euclidean_traits_xy_3.h>26 //#include <CGAL/Triangulation_euclidean_traits_2.h> 27 27 #include <CGAL/Delaunay_triangulation_2.h> 28 #include <CGAL/Constrained_Delaunay_triangulation_2.h>28 //#include <CGAL/Constrained_Delaunay_triangulation_2.h> 29 29 #include <CGAL/Triangulation_conformer_2.h> 30 30 #include <CGAL/Triangulation_face_base_2.h> … … 39 39 40 40 typedef CGAL::Delaunay_triangulation_2<Kernel> Triangulation; 41 typedef Triangulation::Face_iterator Face_iterator; 41 42 typedef Triangulation::Edge_iterator Edge_iterator; 42 43 typedef Triangulation::Vertex_circulator Vertex_circulator; … … 45 46 46 47 int Voronoi(maps*& conf,maps*& inputs,maps*& outputs){ 47 #ifdef DEBUG48 //#ifdef DEBUG 48 49 fprintf(stderr,"\nService internal print\nStarting\n"); 49 #endif 50 //#endif 51 //return SERVICE_FAILED; 50 52 maps* cursor=inputs; 51 53 OGRGeometryH geometry,res; … … 54 56 tmpm=getMapFromMaps(inputs,"InputPoints","value"); 55 57 58 fprintf(stderr," **** %s %d\n",__FILE__,__LINE__); 59 fflush(stderr); 60 56 61 OGRRegisterAll(); 57 62 58 std::vector<Point> points; 59 if(int res=parseInput(conf,inputs,&points,"/vsimem/tmp")!=SERVICE_SUCCEEDED) 60 return res; 63 std::vector<Pointz> points; 64 if(int res=parseInput(conf,inputs,&points,"/vsimem/tmp")!=SERVICE_SUCCEEDED){ 65 fprintf(stderr," **** %s %d\n",__FILE__,__LINE__); 66 fflush(stderr); 67 return SERVICE_FAILED; 68 } 69 fprintf(stderr," **** %s %d\n",__FILE__,__LINE__); 70 fflush(stderr); 61 71 62 72 Triangulation T; 63 73 T.insert(points.begin(), points.end()); 64 74 65 OGRRegisterAll();75 //OGRRegisterAll(); 66 76 /* -------------------------------------------------------------------- */ 67 77 /* Try opening the output datasource as an existing, writable */ … … 187 197 int ns = 0; 188 198 int nr = 0; 199 int nf = 0; 200 Face_iterator fit =T.faces_begin(); 201 FILE* f=fopen("/tmp/toto.log","w+"); 202 for ( ; fit !=T.faces_end(); ++fit) { 203 fprintf(stderr," *** %s %d %d %d\n",__FILE__,__LINE__,nf,fit.info()); 204 fflush(stderr); 205 206 nf++; 207 } 208 fclose(f); 189 209 Edge_iterator eit =T.edges_begin(); 190 210 for ( ; eit !=T.edges_end(); ++eit) { 191 211 CGAL::Object o = T.dual(eit); 192 212 if (const Kernel::Segment_2 *tmp=CGAL::object_cast<Kernel::Segment_2>(&o)) { 193 const Point p1=tmp->source(); 194 const Point p2=tmp->target(); 213 const Pointz p1=tmp->source(); 214 const Pointz p2=tmp->target(); 215 fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y()); 195 216 #ifdef DEBUG 196 217 fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y()); … … 210 231 } 211 232 else if (const Kernel::Ray_2 *tmp=CGAL::object_cast<Kernel::Ray_2>(&o)) { 212 const Point p1=tmp->source();213 const Point p2=tmp->point(2);233 const Pointz p1=tmp->source(); 234 const Pointz p2=tmp->point(2); 214 235 OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) ); 215 236 OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString); … … 250 271 fprintf(stderr,"\nService internal print\n===\n"); 251 272 #endif 252 OGRCleanupAll();273 //OGRCleanupAll(); 253 274 return SERVICE_SUCCEEDED; 254 275 } -
trunk/zoo-project/zoo-services/gdal/dem/cgi-env/Gdal_Dem.zcfg
r412 r917 44 44 <Default /> 45 45 </LiteralData> 46 [co] 47 Title = Creation Option 48 Abstract = string representing options (NAME=VALUE) 49 minOccurs = 0 50 maxOccurs = 1 51 <LiteralData> 52 DataType = string 53 <Default /> 54 </LiteralData> 46 55 </DataInputs> 47 56 <DataOutputs> -
trunk/zoo-project/zoo-services/gdal/dem/service.c
r444 r917 2486 2486 setMapInMaps(outputs,"Result","value",tmpMap->value); 2487 2487 } 2488 2489 tmpMap=getMapFromMaps(inputs,"co","value"); 2490 if(tmpMap!=NULL){ 2491 papszCreateOptions = CSLAddString( papszCreateOptions, tmpMap->value ); 2492 map* tmpMap1; 2493 maps* tmpMaps=getMaps(inputs,"co"); 2494 if((tmpMap1=getMapFromMaps(inputs,"co","length"))!=NULL){ 2495 int i=1; 2496 int length=atoi(tmpMap1->value); 2497 for(;i<length;i++){ 2498 tmpMap=getMapArray(tmpMaps->content,"value",i); 2499 papszCreateOptions = CSLAddString( papszCreateOptions, tmpMap->value ); 2500 } 2501 } 2502 } 2488 2503 2489 2504 tmpMap=NULL; -
trunk/zoo-project/zoo-services/hello-mono/cgi-env/longProcessMono.zcfg
r794 r917 1 1 [longProcessMono] 2 Title = Create a welcome message string.3 Abstract = Create a welcome string.2 Title = Demo long process. 3 Abstract = This service doesn't do anything except taking its time, it demonstrates how to use the updateStatus function from your ZOO Service. 4 4 processVersion = 2 5 5 storeSupported = true … … 13 13 Title = Input string 14 14 Abstract = The name to display in the welcome message. 15 minOccurs = 115 minOccurs = 0 16 16 maxOccurs = 1 17 17 <LiteralData> 18 18 dataType = int 19 <Default> 20 AllowedValues = 101,202,303,404 21 rangeMin = -100 22 rangeMax = 100 23 rangeSpacing = 1 24 rangeClosure = co 25 value = 11 26 </Default> 27 <Supported> 28 AllowedValues = 405,502,503,504 29 </Supported> 30 <Supported> 31 AllowedValues = 540,502,603,604 32 </Supported> 19 <Default /> 33 20 </LiteralData> 34 21 </DataInputs> -
trunk/zoo-project/zoo-services/ogr/base-vect-ops-py/cgi-env/ogr_sp.py
r465 r917 95 95 96 96 def extractInputs(conf,obj): 97 if obj.keys().count("cache_file"): 98 print >> sys.stderr,obj 99 geometry=[] 100 ds = osgeo.ogr.Open(obj["cache_file"]) 101 lyr = ds.GetLayer(0) 102 feat = lyr.GetNextFeature() 103 while feat is not None: 104 geometry+=[feat.Clone()] 105 feat.Destroy() 106 feat = lyr.GetNextFeature() 107 ds.Destroy() 108 return geometry 97 109 if obj["mimeType"]=="application/json": 98 110 return createLayerFromJson(conf,obj["value"]) -
trunk/zoo-project/zoo-services/ogr/base-vect-ops/service.c
r769 r917 473 473 { 474 474 475 if( EQUAL(475 if( 476 476 #if GDAL_VERSION_MAJOR >=2 477 poR->GetDriver(iDriver)->GetDescription()478 #else 479 poR->GetDriver(iDriver)->GetName()480 #endif 481 ,oDriver1))477 EQUAL(poR->GetDriver(iDriver)->GetDescription(),oDriver1) 478 #else 479 EQUAL(poR->GetDriver(iDriver)->GetName(),oDriver1) 480 #endif 481 ) 482 482 { 483 483 poDriver = poR->GetDriver(iDriver); -
trunk/zoo-project/zoo-services/ogr/ogr2ogr/service.c
r790 r917 96 96 #endif 97 97 { 98 char *pszDialect = NULL; 98 99 const char *pszFormat = "ESRI Shapefile"; 99 100 const char *pszDataSource = NULL; … … 155 156 sprintf(serverAddress,"%s",tmpMap->value); 156 157 } 157 158 158 159 tmpMap=NULL; 159 160 char tmpurl[1024]; … … 223 224 if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){ 224 225 pszSQLStatement = tmpMap->value; 226 } 227 228 tmpMap=getMapFromMaps(inputs,"dialect","value"); 229 if(tmpMap!=NULL){ 230 pszDialect=strdup(tmpMap->value); 225 231 } 226 232 … … 360 366 dfMaxSegmentLength = atof(tmpMap->value); 361 367 } 362 363 /*tmpMap=NULL; 364 tmpMap=getMapFromMaps(inputs,"segmentize","value"); 365 if(tmpMap!=NULL){ 366 dfMaxSegmentLength = atof(tmpMap->value); 367 }*/ 368 368 369 369 tmpMap=NULL; 370 370 tmpMap=getMapFromMaps(inputs,"InputDSN","value"); … … 825 825 826 826 poResultSet = poDS->ExecuteSQL( pszSQLStatement, poSpatialFilter, 827 NULL);827 pszDialect ); 828 828 829 829 if( poResultSet != NULL ) … … 841 841 } 842 842 poDS->ReleaseResultSet( poResultSet ); 843 } 844 } 843 }else{ 844 setMapInMaps(conf,"lenv","message","There was an error when running yoru SQL query."); 845 if(pszDialect!=NULL) 846 free(pszDialect); 847 return SERVICE_FAILED; 848 } 849 } 850 if(pszDialect!=NULL) 851 free(pszDialect); 845 852 846 853 /* -------------------------------------------------------------------- */ … … 901 908 902 909 #ifdef ZOO_SERVICE 903 outputs->content=createMap("value",(char*)pszwebDestData); 910 setMapInMaps(outputs,"OutputedDataSourceName","value",(char*)pszwebDestData); 911 //outputs->content=createMap("value",(char*)pszwebDestData); 904 912 #endif 905 913 … … 930 938 fprintf(stderr,"%s %d\n",__FILE__,__LINE__); 931 939 932 OGRCleanupAll();940 //OGRCleanupAll(); 933 941 fprintf(stderr,"%s %d\n",__FILE__,__LINE__); 934 942 … … 939 947 940 948 #ifdef ZOO_SERVICE 949 //sleep(10); 941 950 return SERVICE_SUCCEEDED; 942 951 #else -
trunk/zoo-project/zoo-services/utils/registry/Makefile
r779 r917 1 1 ZRPATH=../../.. 2 2 include ${ZRPATH}/zoo-kernel/ZOOMakefile.opts 3 CFLAGS=${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG3 ZCFLAGS=-I${ZRPATH}/zoo-kernel/ ${CFLAGS} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG 4 4 5 5 YAML_FILES="" … … 16 16 17 17 cgi-env/wps_registry.zo: service.c 18 g++ ${ CFLAGS} -shared -fpic -o cgi-env/wps_registry.zo ./service.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} -lfcgi -L${ZRPATH}/zoo-kernel/ -lzoo_service ${ZRPATH}/zoo-kernel/server_internal.o ${ZRPATH}/zoo-kernel/lex.cr.o ${ZRPATH}/zoo-kernel/lex.sr.o ${ZRPATH}/zoo-kernel/service_conf.tab.o ${ZRPATH}/zoo-kernel/main_conf_read.tab.o ${ZRPATH}/zoo-kernel/response_print.o ${YAML_FILES} ${MS_FILES} ${MS_LDFLAGS} ${YAML_LDFLAGS}18 g++ ${ZCFLAGS} -shared -fpic -o cgi-env/wps_registry.zo ./service.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} -lfcgi -L${ZRPATH}/zoo-kernel/ -lzoo_service ${ZRPATH}/zoo-kernel/server_internal.o ${ZRPATH}/zoo-kernel/lex.cr.o ${ZRPATH}/zoo-kernel/lex.sr.o ${ZRPATH}/zoo-kernel/service_conf.tab.o ${ZRPATH}/zoo-kernel/main_conf_read.tab.o ${ZRPATH}/zoo-kernel/response_print.o ${YAML_FILES} ${MS_FILES} ${MS_LDFLAGS} ${YAML_LDFLAGS} 19 19 20 20 install: -
trunk/zoo-project/zoo-services/utils/registry/service.c
r778 r917 80 80 root_nodes[1][1],"2.0.0",1); 81 81 setMapInMaps(conf,"main","rversion","2.0.0"); 82 printDescribeProcessForProcess(zooRegistry,conf, n,inherited);82 printDescribeProcessForProcess(zooRegistry,conf,doc,n,inherited); 83 83 setMapInMaps(conf,"main","rversion","1.0.0"); 84 84 -
trunk/zoo-project/zoo-services/utils/status/Makefile
r811 r917 1 1 ZRPATH=../../.. 2 2 include ${ZRPATH}/zoo-kernel/ZOOMakefile.opts 3 CFLAGS =-I${INST_INCLUDE} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG3 CFLAGS1=${CFLAGS} -I${INST_INCLUDE} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG 4 4 5 5 cgi-env/wps_status.zo: service.c 6 g++ ${CFLAGS } -shared -fpic -o cgi-env/wps_status.zo ./service.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} ${FCGI_LDFLAGS} -L${ZRPATH}/zoo-kernel/ -lzoo_service6 g++ ${CFLAGS1} -shared -fpic -o cgi-env/wps_status.zo ./service.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} ${FCGI_LDFLAGS} -L${ZRPATH}/zoo-kernel/ -lzoo_service 7 7 8 8 install: -
trunk/zoo-project/zoo-services/utils/status/service.c
r788 r917 72 72 return SERVICE_FAILED; 73 73 } 74 map* tmpMap1=getMapFromMaps(conf,"lenv","semaphore"); 75 if(tmpMap1!=NULL && strcasecmp(tmpMap1->value,"Created")==0) 76 removeShmLock(conf,1); 74 77 sprintf(xslFileName,"%s/updateStatus.xsl",tmpMmap->value); 75 78 xmlSubstituteEntitiesDefault(1); … … 85 88 */ 86 89 char *tmpStr=_getStatus(conf,tmpMap->value); 87 #ifdef DEBUG90 //#ifdef DEBUG 88 91 fprintf(stderr,"DEBUG: %s \n",tmpStr); 89 #endif92 //#endif 90 93 if(tmpStr!=NULL && strncmp(tmpStr,"-1",2)!=0){ 91 94 char *tmpStr1=strdup(tmpStr); … … 140 143 char message[10]; 141 144 sprintf(message,"Step %d",i); 145 fprintf (stderr, "RUN IN BACKGROUND MODE %s %d \n",__FILE__,__LINE__); 146 fflush(stderr); 142 147 updateStatus(conf,i,message); 143 148 #ifndef WIN32
Note: See TracChangeset
for help on using the changeset viewer.