[mapserver-users] CSV from Mapscript results

Matej Mailing mailing at tam.si
Wed Sep 9 01:03:24 PDT 2015


Thanks Mike, that seems to be an interesting option as well.

Regards,
Matej

2015-09-09 3:18 GMT+02:00 Michael Smith <michael.smith.erdc at gmail.com>:
> Another option would be to use the csv ogr driver and set the outputformat
>
> http://mapserver.org/output/ogr_output.html
>
>
> Mike
>
> ----
> Michael Smith
>
> US Army Corps
> Remote Sensing GIS/Center
> michael.smith at usace.army.mil
>
>
>
>
> -----Original Message-----
> From: <mapserver-users-bounces at lists.osgeo.org> on behalf of Matej Mailing
> <mailing at tam.si>
> Date: Tuesday, September 8, 2015 at 8:03 PM
> To: "Lime, Steve D (MNIT)" <Steve.Lime at state.mn.us>
> Cc: "mapserver-users at lists.osgeo.org" <mapserver-users at lists.osgeo.org>
> Subject: Re: [mapserver-users] CSV from Mapscript results
>
>>Thanks, Steve.
>>
>>It looks I will choose the 2nd option as well. What I don't like with
>>this "direct" approach though is not using already existing Mapfile
>>with DATA, CONNECTION and everything set - basically it creates
>>another point where this data needs to be set and changed for example
>>when changing access rights, moving data to new server etc., it
>>increases complexity.
>>
>>As far as I have checked, there is no for example getData() method to
>>get the DATA variable, set in the Mapfile. (Perhaps the reason is that
>>since there is no set, there is no get method as well :-))
>>However, in this case this would be useful or perhaps I am just
>>thinking in the wrong direction? :-)
>>
>>Thanks,
>>Matej
>>
>>
>>2015-09-08 18:07 GMT+02:00 Lime, Steve D (MNIT) <Steve.Lime at state.mn.us>:
>>> You have two options:
>>>
>>>   1 - use query templates to render the result as CSV
>>>   2 - use whatever tool your programming language gives you and just
>>>loop through the results and dump to CSV
>>>
>>> Personally since you're using MapScript I'd opt for 2 for a couple of
>>>reasons: you have total control that way and for larger result sets it's
>>>likely to be more performant since the whole CSV file wouldn't need to
>>>be constructed in memory like templates would.
>>>
>>> Steve
>>>
>>> -----Original Message-----
>>> From: mapserver-users-bounces at lists.osgeo.org
>>>[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Matej
>>>Mailing
>>> Sent: Tuesday, September 08, 2015 5:30 AM
>>> To: mapserver-users at lists.osgeo.org
>>> Subject: [mapserver-users] CSV from Mapscript results
>>>
>>> Hi,
>>>
>>> what would be the best way to create a CSV from Mapscript query results?
>>>
>>> Thanks,
>>> Matej
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>_______________________________________________
>>mapserver-users mailing list
>>mapserver-users at lists.osgeo.org
>>http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>


More information about the mapserver-users mailing list