Ticket #670 (closed enhancement: duplicate)

Opened 9 years ago

Last modified 7 years ago

Expose WMS dispatching to mapscript

Reported by: sgillies@… Owned by: sdlime
Priority: lowest Milestone: FUTURE
Component: MapScript-SWIG Version: unspecified
Severity: minor Keywords:
Cc:

Description

The beginning is to expose the cgiRequestObj structure to mapscript
(as class OWSRequest) and add a loadOWSParameters method to mapObj
that functions like loadMapContext.  

This allows us to create lightweight WMS services like this
Python example

    import mapscript

    wms_map = mapscript.mapObj('wms.map')
    wms_request = mapscript.OWSRequest()

    # Convert application request parameters (req.args)
    for param, value in req.args.items():
        wms_request.setParam(param, value)
    
    # Map loads parameters from OWSRequest, adjusting its SRS, extents,
    # active layers accordingly
    wms_map.loadOWSParameters('1.1.0', wms_request)

    # Render the Map
    img = wms_map.draw()

Change History

Changed 9 years ago by sgillies@…

  • status changed from new to assigned
  • milestone set to 4.4 release

Changed 9 years ago by dmorissette

  • cc mapserver-bugs@… added

Changed 9 years ago by sgillies@…

The addition of mapserver-bugs to the CC list reminds me to add
that I did commit this to mapscript.i in the main (4.3) CVS.  After
the users meeting, I'll move the code into a C module so that the
PHP developers can have at it too.

I'm planning to demo in my users meeting workshop and see how much
interest there is.  There was a post to the users list this morning
that indicates some.  If there is interest, I will look into how
much work would be required to rewrite the OWS dispatcher to output
to strings or file handles other than stdout.

Changed 9 years ago by dmorissette

I thought about outputing to strings before since that would seem like a cleaner
solution, but there are two problems that worry me:

- Memory usage: large WMS Capabilities or large GML results could use tons of
memory.

- Slower response time: the client will not start receiving data until the
response is completely generated.  Once again wth large GML results this can
have a significant impact.

However one nice benefit of this approach is that it would be possible to
generate exceptions in the middle of processing of the response, which is
impossible at the moment.  i.e. with the current printf-based approach, if you
run into a problem in the middle of the generation of GetCapabilities output
then it's too late to generate an exception... you end up producing an
incomplete or invalid document.

Changed 9 years ago by sgillies@…

Generating exceptions during processing -- is this related to the new bug 748?

Changed 9 years ago by dmorissette

I didn't look into bug 748 yet, but my first reaction would be to think that
it's not related to this

Changed 9 years ago by sgillies@…

  • milestone changed from 4.4 release to FUTURE
no longer targeted for 4.4

Changed 8 years ago by sgillies@…

  • priority changed from high to lowest

Changed 7 years ago by sgillies@…

  • cc warmerdam@… added
  • owner changed from sgillies@… to sdlime
  • status changed from assigned to new
reassigning

Changed 7 years ago by fwarmerdam

  • status changed from new to closed
  • resolution set to duplicate
This requirement is being addressed by RFC 16, documented in bug 1788.


*** This bug has been marked as a duplicate of 1788 ***
Note: See TracTickets for help on using tickets.