<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 11/13/2013 12:49 PM, Smith, Michael
      ERDC-RDE-CRREL-NH wrote:<br>
    </div>
    <blockquote cite="mid:CEA8D00B.92E15%25michael.smith@erdc.dren.mil"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div>Peter,</div>
      <div><br>
      </div>
    </blockquote>
    Hi Michael,<br>
    <blockquote cite="mid:CEA8D00B.92E15%25michael.smith@erdc.dren.mil"
      type="cite">
      <div>
      </div>
      <div>You can use OGR outputformats. Add something like this to
        your mapfile</div>
      <div><br>
      </div>
      <div>
        <div>OUTPUTFORMAT</div>
        <div>  NAME "geojson"</div>
        <div>  DRIVER "OGR/GEOJSON"</div>
        <div>  MIMETYPE "application/json; subtype=geojson"</div>
        <div>  FORMATOPTION "STORAGE=stream"</div>
        <div>  FORMATOPTION "FORM=SIMPLE"</div>
        <div>END</div>
      </div>
      <div><br>
      </div>
      <div>Add to your LAYER or MAP
        METADATA, "wfs_getfeature_formatlist” "geojson"</div>
      <div><br>
      </div>
      <div>And then in your WFS call add &outputformat=geojson.</div>
      <div><br>
      </div>
      <div>This will return geojson directly in the browser, if you need
        it to download, you can change the FORMATOPTION to FORM=ZIP</div>
      <div><br>
      </div>
      <div>See <a moz-do-not-send="true"
          href="http://mapserver.org/output/ogr_output.html">http://mapserver.org/output/ogr_output.html</a> for
        more detail.</div>
      <div><br>
      </div>
    </blockquote>
    Thanks, this works!<br>
    <br>
    <blockquote cite="mid:CEA8D00B.92E15%25michael.smith@erdc.dren.mil"
      type="cite">
      <div>
      </div>
      <div>Mike</div>
      <div><br>
      </div>
      <div>
        <div>
          <div>
            <div>-- </div>
            <div>Michael Smith</div>
          </div>
          <div>US Army Corps</div>
          <div>Remote Sensing GIS/Center</div>
        </div>
      </div>
    </blockquote>
    Peter<br>
    <br>
    R3 GIS<br>
    <a class="moz-txt-link-freetext" href="http://www.r3-gis.com">http://www.r3-gis.com</a><br>
    <blockquote cite="mid:CEA8D00B.92E15%25michael.smith@erdc.dren.mil"
      type="cite">
      <div>
        <div>
        </div>
      </div>
      <div><br>
      </div>
      <span id="OLK_SRC_BODY_SECTION">
        <div style="font-family:Calibri; font-size:11pt;
          text-align:left; color:black; BORDER-BOTTOM: medium none;
          BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT:
          0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid;
          BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
          <span style="font-weight:bold">From: </span>Peter Hopfgartner
          <<a moz-do-not-send="true"
            href="mailto:peter.hopfgartner@r3-gis.com">peter.hopfgartner@r3-gis.com</a>><br>
          <span style="font-weight:bold">Date: </span>Wednesday,
          November 13, 2013 at 6:15 AM<br>
          <span style="font-weight:bold">To: </span>users mapserver
          <<a moz-do-not-send="true"
            href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>><br>
          <span style="font-weight:bold">Subject: </span>[EXTERNAL]
          [mapserver-users] GeoJSON as WFS output format without
          template<br>
          <span style="font-weight:bold">Resent-From: </span>Michael
          Smith <<a moz-do-not-send="true"
            href="mailto:michael.smith@usace.army.mil">michael.smith@usace.army.mil</a>><br>
        </div>
        <div><br>
        </div>
        <div>
          <div text="#000000" bgcolor="#FFFFFF">Hi list!<br>
            <br>
            I wanted to have GeoJSON as an output format. Now, if I got
            the documentation right (
            <a moz-do-not-send="true"
              href="http://mapserver.org/it/development/rfc/ms-rfc-62.html">http://mapserver.org/it/development/rfc/ms-rfc-62.html</a>,
            <a moz-do-not-send="true"
              href="http://mapserver.org/it/development/rfc/ms-rfc-36.html">http://mapserver.org/it/development/rfc/ms-rfc-36.html</a>),
            I should prepare a template for each layer I'd like to serve
            as GeoJSON.<br>
            Is this right or is there a way that MapServer guesses a
            reasonable format directly from the data, as it does for
            GML?<br>
            Indeed, <a moz-do-not-send="true"
              href="http://mapserver.org/it/output/template_output.html">http://mapserver.org/it/output/template_output.html</a>
            says "There are other, simpler, ways to output some of these
            formats using MapServer".<br>
            Does this simpler way exist for GeoJSON, too?<br>
            <br>
            Regards,<br>
            <br>
            Peter<br>
            <br>
            <br>
            <br>
          </div>
        </div>
      </span>
    </blockquote>
    <br>
  </body>
</html>