Changeset 451 for trunk/zoo-project/zoo-kernel/service_internal_ms.c
- Timestamp:
- Jan 6, 2014, 11:09:29 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal_ms.c
r434 r451 211 211 map* msSrs=NULL; 212 212 hSRS = OSRNewSpatialReference(NULL); 213 if( pszProjection!=NULL && strlen(pszProjection)>1 && 214 OSRImportFromWkt( hSRS, &pszProjection ) == CE_None ){ 215 char *proj4Str=NULL; 216 if(OSRGetAuthorityName(hSRS,NULL)!=NULL && 217 OSRGetAuthorityCode(hSRS,NULL)!=NULL){ 218 char tmpSrs[20]; 219 sprintf(tmpSrs,"%s:%s", 220 OSRGetAuthorityName(hSRS,NULL),OSRGetAuthorityCode(hSRS,NULL)); 221 msLoadProjectionStringEPSG(&m->projection,tmpSrs); 222 msLoadProjectionStringEPSG(&myLayer->projection,tmpSrs); 223 224 char tmpSrss[256]; 225 sprintf(tmpSrss,"EPSG:4326 EPSG:900913 %s",tmpSrs); 226 227 msInsertHashTable(&(m->web.metadata), "ows_srs", tmpSrss); 228 msInsertHashTable(&(myLayer->metadata), "ows_srs", tmpSrss); 229 230 #ifdef DEBUGMS 231 fprintf(stderr,"isGeo %b\n\n",OSRIsGeographic(hSRS)==TRUE); 232 #endif 233 if(output!=NULL){ 234 if(OSRIsGeographic(hSRS)==TRUE) 235 addToMap(output->content,"crs_isGeographic","true"); 236 else 237 addToMap(output->content,"crs_isGeographic","false"); 238 addToMap(output->content,"crs",tmpSrs); 239 } 240 } 241 else{ 242 OSRExportToProj4(hSRS,&proj4Str); 243 if(proj4Str!=NULL){ 244 #ifdef DEBUGMS 245 fprintf(stderr,"PROJ (%s)\n",proj4Str); 246 #endif 247 msLoadProjectionString(&(m->projection),proj4Str); 248 msLoadProjectionString(&(myLayer->projection),proj4Str); 249 if(output!=NULL){ 213 if( pszProjection!=NULL && strlen(pszProjection)>1){ 214 if(OSRImportFromWkt( hSRS, &pszProjection ) == CE_None ){ 215 char *proj4Str=NULL; 216 if(OSRGetAuthorityName(hSRS,NULL)!=NULL && 217 OSRGetAuthorityCode(hSRS,NULL)!=NULL){ 218 char tmpSrs[20]; 219 sprintf(tmpSrs,"%s:%s", 220 OSRGetAuthorityName(hSRS,NULL),OSRGetAuthorityCode(hSRS,NULL)); 221 msLoadProjectionStringEPSG(&m->projection,tmpSrs); 222 msLoadProjectionStringEPSG(&myLayer->projection,tmpSrs); 223 224 char tmpSrss[256]; 225 sprintf(tmpSrss,"EPSG:4326 EPSG:900913 %s",tmpSrs); 226 227 msInsertHashTable(&(m->web.metadata), "ows_srs", tmpSrss); 228 msInsertHashTable(&(myLayer->metadata), "ows_srs", tmpSrss); 229 230 #ifdef DEBUGMS 231 fprintf(stderr,"isGeo %b\n\n",OSRIsGeographic(hSRS)==TRUE); 232 #endif 233 if(output!=NULL){ 250 234 if(OSRIsGeographic(hSRS)==TRUE) 251 235 addToMap(output->content,"crs_isGeographic","true"); 252 236 else 253 237 addToMap(output->content,"crs_isGeographic","false"); 238 addToMap(output->content,"crs",tmpSrs); 254 239 } 255 240 } 256 241 else{ 257 msLoadProjectionStringEPSG(&m->projection,"EPSG:4326"); 258 msLoadProjectionStringEPSG(&myLayer->projection,"EPSG:4326"); 242 OSRExportToProj4(hSRS,&proj4Str); 243 fprintf(stderr,"Debug WKT: %s \n",proj4Str); 244 if(proj4Str!=NULL){ 245 #ifdef DEBUGMS 246 fprintf(stderr,"PROJ (%s)\n",proj4Str); 247 #endif 248 msLoadProjectionString(&(m->projection),proj4Str); 249 msLoadProjectionString(&(myLayer->projection),proj4Str); 250 if(output!=NULL){ 251 if(OSRIsGeographic(hSRS)==TRUE) 252 addToMap(output->content,"crs_isGeographic","true"); 253 else 254 addToMap(output->content,"crs_isGeographic","false"); 255 } 256 } 257 else{ 258 msLoadProjectionStringEPSG(&m->projection,"EPSG:4326"); 259 msLoadProjectionStringEPSG(&myLayer->projection,"EPSG:4326"); 260 if(output!=NULL){ 261 addToMap(output->content,"crs_isGeographic","true"); 262 } 263 } 259 264 if(output!=NULL){ 260 addToMap(output->content,"crs_isGeographic","true"); 265 addToMap(output->content,"crs","EPSG:4326"); 266 addToMap(output->content,"real_extent","true"); 261 267 } 268 msInsertHashTable(&(m->web.metadata),"ows_srs", "EPSG:4326 EPSG:900913"); 269 msInsertHashTable(&(myLayer->metadata),"ows_srs","EPSG:4326 EPSG:900913"); 262 270 } 263 if(output!=NULL){264 addToMap(output->content,"crs","EPSG:4326");265 addToMap(output->content,"real_extent","true");266 }267 msInsertHashTable(&(m->web.metadata),"ows_srs", "EPSG:4326 EPSG:900913");268 msInsertHashTable(&(myLayer->metadata),"ows_srs","EPSG:4326 EPSG:900913");269 270 271 271 } 272 272 } … … 684 684 } 685 685 #ifdef DEBUGMS 686 686 fprintf(stderr,"Accessing the DataSource %s %d\n",pszFilename,__LINE__); 687 687 #endif 688 688 … … 696 696 return -1; 697 697 } 698 m->layers[m->numlayers]->index=m->numlayers; 698 699 699 700 layerObj* myLayer=m->layers[m->numlayers]; … … 714 715 if(tmpMap!=NULL) 715 716 abstract=tmpMap->value; 717 716 718 msInsertHashTable(&(myLayer->metadata), "ows_label", title); 717 719 msInsertHashTable(&(myLayer->metadata), "ows_title", title);
Note: See TracChangeset
for help on using the changeset viewer.