Ignore:
Timestamp:
Jan 6, 2014, 11:09:29 AM (10 years ago)
Author:
djay
Message:

Small fixes for building on windows platform.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal_ms.c

    r434 r451  
    211211  map* msSrs=NULL;
    212212  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){
    250234          if(OSRIsGeographic(hSRS)==TRUE)
    251235            addToMap(output->content,"crs_isGeographic","true");
    252236          else
    253237            addToMap(output->content,"crs_isGeographic","false");
     238          addToMap(output->content,"crs",tmpSrs);
    254239        }
    255240      }
    256241      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        }
    259264        if(output!=NULL){
    260           addToMap(output->content,"crs_isGeographic","true");
     265          addToMap(output->content,"crs","EPSG:4326");
     266          addToMap(output->content,"real_extent","true");
    261267        }
     268        msInsertHashTable(&(m->web.metadata),"ows_srs", "EPSG:4326 EPSG:900913");
     269        msInsertHashTable(&(myLayer->metadata),"ows_srs","EPSG:4326 EPSG:900913");
    262270      }
    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 
    271271    }
    272272  }
     
    684684  }
    685685#ifdef DEBUGMS
    686     fprintf(stderr,"Accessing the DataSource %s %d\n",pszFilename,__LINE__);
     686  fprintf(stderr,"Accessing the DataSource %s %d\n",pszFilename,__LINE__);
    687687#endif
    688688
     
    696696    return -1;
    697697  }
     698  m->layers[m->numlayers]->index=m->numlayers;
    698699
    699700  layerObj* myLayer=m->layers[m->numlayers];
     
    714715  if(tmpMap!=NULL)
    715716    abstract=tmpMap->value;
     717
    716718  msInsertHashTable(&(myLayer->metadata), "ows_label", title);
    717719  msInsertHashTable(&(myLayer->metadata), "ows_title", title);
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