Changeset 195 for src/ows/ows_config.c

Show
Ignore:
Timestamp:
01/21/10 22:19:43 (2 years ago)
Author:
ol
Message:

Use PostGIS 1.5 GeomFromGML to parse GML instead of TinyOWS one. Add check_schema and check_valid_geom config properties to allow to bypass schema and is_valid check, cf #44.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ows/ows_config.c

    r193 r195  
    4242 
    4343    a = xmlTextReaderGetAttribute(r, (xmlChar *) "online_resource"); 
    44  
    4544    if (a != NULL) { 
    4645        o->online_resource = buffer_init(); 
     
    5049 
    5150    a = xmlTextReaderGetAttribute(r, (xmlChar *) "schema_dir"); 
    52  
    5351    if (a != NULL) { 
    5452        o->schema_dir = buffer_init(); 
     
    5856 
    5957    a = xmlTextReaderGetAttribute(r, (xmlChar *) "log"); 
    60  
    6158    if (a != NULL) { 
    6259        o->log = buffer_init(); 
     
    6663 
    6764    a = xmlTextReaderGetAttribute(r, (xmlChar *) "degree_precision"); 
    68  
    6965    if (a != NULL) { 
    7066        o->schema_dir = buffer_init(); 
    7167        precision = atoi((char *) a); 
    72  
    7368        if (precision > 0 && precision < 12) 
    7469            o->degree_precision = precision; 
    75  
    7670        xmlFree(a); 
    7771    } 
    7872 
    7973    a = xmlTextReaderGetAttribute(r, (xmlChar *) "meter_precision"); 
    80  
    8174    if (a != NULL) { 
    8275        o->schema_dir = buffer_init(); 
    8376        precision = atoi((char *) a); 
    84  
    8577        if (precision > 0 && precision < 12) 
    8678            o->meter_precision = precision; 
    87  
    8879        xmlFree(a); 
    8980    } 
    9081 
    9182    a = xmlTextReaderGetAttribute(r, (xmlChar *) "wfs_display_bbox"); 
    92  
    9383    o->wfs_display_bbox = true; 
    94  
    95     if (a != NULL) { 
    96         if (atoi((char *) a)) 
    97             o->wfs_display_bbox = true; 
    98         else 
    99             o->wfs_display_bbox = false; 
    100  
    101         xmlFree(a); 
    102     } 
    103  
     84    if (a != NULL) { 
     85        if (atoi((char *) a)) o->wfs_display_bbox = true; 
     86        else                  o->wfs_display_bbox = false; 
     87        xmlFree(a); 
     88    } 
     89 
     90    a = xmlTextReaderGetAttribute(r, (xmlChar *) "check_schema"); 
     91    o->check_schema = true; 
     92    if (a != NULL) { 
     93        if (atoi((char *) a)) o->check_schema = true; 
     94        else                  o->check_schema = false; 
     95        xmlFree(a); 
     96    } 
     97 
     98    a = xmlTextReaderGetAttribute(r, (xmlChar *) "check_valid_geom"); 
     99    o->check_valid_geom = true; 
     100    if (a != NULL) { 
     101        if (atoi((char *) a)) o->check_valid_geom = true; 
     102        else                  o->check_valid_geom = false; 
     103        xmlFree(a); 
     104    } 
    104105} 
    105106