[gdal-dev] Re: Unreliable names for temporary files

Even Rouault even.rouault at mines-paris.org
Mon Feb 13 17:06:25 EST 2012


Le lundi 13 février 2012 06:22:31, Jukka Rahkonen a écrit :
> Even Rouault <even.rouault <at> mines-paris.org> writes:
> > Le dimanche 12 février 2012 14:25:07, Jukka Rahkonen a écrit :
> > > Hi,
> > > 
> > > I noticed a ticket http://trac.osgeo.org/gdal/ticket/4510 and started
> > > to wonder if something similar can happen also elsewhere. I have had
> > > troubles with Mapserver OGR output and they are somehow related to
> > > temporary files (both physisical and vsimem files). See
> > > http://lists.maptools.org/pipermail/ms4w-users/2012-February/001948.htm
> > > l for some details.
> > 
> > Jukka,
> > 
> > The issue with the mapfile in http://lists.maptools.org/pipermail/ms4w-
> > users/2012-February/001948.html is the default filename. For the CSV
> > driver to create a single file, you need to change the filename to
> > something ending with .csv (for example "default_outfile" "out.csv"),
> > otherwise the CSV driver will create a directory, and when MapServer
> > tries to read the filename, it is confused because it finds a directory,
> > and not a file.
> 
> Now I have these outputformats
> 
> OUTPUTFORMAT
>   NAME "SHAPEZIP"
>   DRIVER "OGR/ESRI Shapefile"
>   MIMETYPE "application/shapefile"
>   FORMATOPTION "STORAGE=memory"
>   FORMATOPTION "FORM=zip"
>   FORMATOPTION "FILENAME=shape.zip"
> END
> OUTPUTFORMAT
>   NAME "CSV"
>   DRIVER "OGR/CSV"
>   MIMETYPE "text/csv"
>   FORMATOPTION "LCO:GEOMETRY=AS_WKT"
>   FORMATOPTION "STORAGE=filesystem"
>   FORMATOPTION "FORM=simple"
>   FORMATOPTION "FILENAME=out.csv"
> END
> 
> You can try them:
> 
> http://188.64.1.61/cgi-bin/mapserver_wfs?service=wfs&version=1.1.0&request=
> getfeature&typename=municipalities&outputformat=CSV Result is probably
> "Failed to open result file"
> 
> http://188.64.1.61/cgi-bin/mapserver_wfs?service=wfs&version=1.1.0&request=
> getfeature&typename=municipalities&outputformat=SHAPEZIP Result is probably
> an empty zip file.

CC'ing to mapserver-users list.

Similar requests with the 2 above outputformats work great on my local 
mapserver instance, so I suspect something wrong in your setup. If I issue the 
CSV request on your server, I see the following error message :
<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:ows="http://www.opengis.net/ows" version="1.1.0" language="en-US" 
xsi:schemaLocation="http://www.opengis.net/ows 
http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
  <ows:Exception exceptionCode="NoApplicableCode" locator="mapserv">
    <ows:ExceptionText>msOGRWriteFromQuery(): General error message. Failed to 
open result file '/usr/temp/4f3988d4_287f_0/out.csv'.</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

The /usr/temp/ path look suspicious to me...

> 
> 
> -Jukka Rahkonen-
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list