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

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon Feb 13 00:22:31 EST 2012


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.html
> > 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.


-Jukka Rahkonen-



More information about the gdal-dev mailing list