MCPcopy Index your code
hub / github.com/MapServer/MapServer / msInitDefaultOGROutputFormat

Function msInitDefaultOGROutputFormat

mapogroutput.c:52–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50/************************************************************************/
51
52int msInitDefaultOGROutputFormat( outputFormatObj *format )
53
54{
55 OGRSFDriverH hDriver;
56
57 msOGRInitialize();
58
59/* -------------------------------------------------------------------- */
60/* check that this driver exists. Note visiting drivers should */
61/* be pretty threadsafe so don't bother acquiring the GDAL */
62/* lock. */
63/* -------------------------------------------------------------------- */
64 hDriver = OGRGetDriverByName( format->driver+4 );
65 if( hDriver == NULL )
66 {
67 msSetError( MS_MISCERR, "No OGR driver named `%s' available.",
68 "msInitOGROutputFormat()", format->driver+4 );
69 return MS_FAILURE;
70 }
71
72 if( !OGR_Dr_TestCapability( hDriver, ODrCCreateDataSource ) )
73 {
74 msSetError( MS_MISCERR, "OGR `%s' driver does not support output.",
75 "msInitOGROutputFormat()", format->driver+4 );
76 return MS_FAILURE;
77 }
78
79/* -------------------------------------------------------------------- */
80/* Initialize the object. */
81/* -------------------------------------------------------------------- */
82 format->imagemode = MS_IMAGEMODE_FEATURE;
83 format->renderer = MS_RENDER_WITH_OGR;
84
85 /* perhaps we should eventually hardcode mimetypes and extensions
86 for some formats? */
87
88 return MS_SUCCESS;
89}
90
91/************************************************************************/
92/* msOGRRecursiveFileList() */

Callers 1

Calls 2

msOGRInitializeFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected