I have been using Python MapScript bindings for MapServer - and they work great. A new datasource for the application I am working on is MongoDB. I have seen mentions of a MongoDB Driver for MapServer - but that won't work, as some 'data massaging' is required, that is not possible directly in Mongo.
My workflow is this:
- Using pymongo - get data of interest from Mongo
- 'Massage' data - save as valid geojson into tempfile
- Mapfile layers are of type MS_OGR - and connection is set to temp geojson file from step above
Overall, this workflow works good, and is stable. But, some of the geojson payloads are fairly big - say 75-100 MB. And in some cases, writing geojson to the tempfiles can take a few seconds. And then I also have to deal with cleanup...
Rather that write the geojson to tempfiles, I am hoping to just use geojson string in the mapfile layers. But I can't get this work.
Is this even possible? Any other suggestions?