Changeset 3273 for DPPP/kml


Ignore:
Timestamp:
25/01/08 15:51:42 (12 years ago)
Author:
mkochan
Message:

Finished the dummy GeoServer?: responds with an XML/CSML example feature collection, and requires a "station_id" parameter, although ignores it.

Location:
DPPP/kml/csml2kml/python/pylonsstack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • DPPP/kml/csml2kml/python/pylonsstack/development.ini

    r3269 r3273  
    3535#set debug = false 
    3636 
    37  
    3837# Logging configuration 
    3938[loggers] 
  • DPPP/kml/csml2kml/python/pylonsstack/pylonsstack/controllers/dummyGeoServer.py

    r3269 r3273  
    22 
    33from pylonsstack.lib.base import * 
     4from paste.httpexceptions import HTTPBadRequest 
    45 
    56log = logging.getLogger(__name__) 
     
    2021 
    2122    def GetStationCSMLFeatures(self): 
    22         csmlFile = open('/public/exampleps.xml', 'r') 
    23         csml = csmlFile.read(csmlFile) 
     23        ''' 
     24        Return content of an example CSML file (however, with a "wfs" namespace, as supposed to be returned by GeoServer). 
     25        Return the same content -- a feature collection. Supposedly, this would be different for each station, 
     26        i.e. there would be a 'station_id' parameter in GeoServer. 
     27        ''' 
     28        try: 
     29            station_id = request.params['station_id'] 
     30        except KeyError: 
     31            raise HTTPBadRequest('The "station_id" parameter not supplied') 
     32        csmlDir = (config['app_conf'])['csml_dir'] 
     33        csmlFile = open(csmlDir + '/wfs_featurecollection.xml', 'r') 
     34        csml = csmlFile.read() 
    2435        csmlFile.close() 
     36        response.content = csml 
    2537        response.content_type = 'text/xml' 
    26         response.content = csml 
Note: See TracChangeset for help on using the changeset viewer.