<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:500505739;
mso-list-type:hybrid;
mso-list-template-ids:1793729650 -1090071360 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:22.5pt;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:58.5pt;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:94.5pt;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:130.5pt;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:166.5pt;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:202.5pt;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:238.5pt;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:274.5pt;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:310.5pt;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">It’s actually GDAL/OGR that provides GeoJson read support. So assuming you have a file called cemeteries.geojson it should be as simple as replacing:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span>DATA './cemeteries.shp’<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">with:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> CONNECTIONTYPE OGR<o:p></o:p></p>
<p class="MsoNormal"> CONNECTION ‘./cemeteries.geojson’<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">See <a href="https://mapserver.org/input/vector/ogr.html">
https://mapserver.org/input/vector/ogr.html</a> for additional information on OGR support.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">--Steve<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> mapserver-users [mailto:mapserver-users-bounces@lists.osgeo.org]
<b>On Behalf Of </b>e.arapostathis@gmail.com<br>
<b>Sent:</b> Friday, January 11, 2019 11:24 AM<br>
<b>To:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> [mapserver-users] map file syntax for geojson file formats<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> As few years have passed since the time that I was using mapserver constantly (before geojson file format started emerging) I would like to ask if there is any basic difference while creating the map files.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">It would be of great help if you could provide me an example in the following map file which loads a shape file. What differences must be done in order to load the file cemetery.geojson instead of the cemetery.shp?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">MAP<o:p></o:p></p>
<p class="MsoNormal"> INCLUDE '../../geomoose_globals.map'<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> WEB<o:p></o:p></p>
<p class="MsoNormal"> METADATA<o:p></o:p></p>
<p class="MsoNormal"> 'ows_title' 'Cemeteries'<o:p></o:p></p>
<p class="MsoNormal"> INCLUDE '../../common_metadata.map'<o:p></o:p></p>
<p class="MsoNormal"> 'wfs_getfeature_formatlist' 'gml,geojson'<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> DEBUG 5<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> LAYER<o:p></o:p></p>
<p class="MsoNormal"> NAME cemeteries<o:p></o:p></p>
<p class="MsoNormal"> GROUP cemeteries<o:p></o:p></p>
<p class="MsoNormal"> STATUS ON<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> METADATA<o:p></o:p></p>
<p class="MsoNormal"> 'ows_title' 'cemeteries'<o:p></o:p></p>
<p class="MsoNormal"> 'ows_include_items' 'all'<o:p></o:p></p>
<p class="MsoNormal"> 'gml_include_items' 'all'<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> TYPE POINT<o:p></o:p></p>
<p class="MsoNormal"> DATA './cemeteries.shp’<o:p></o:p></p>
<p class="MsoNormal"> TOLERANCE 4<o:p></o:p></p>
<p class="MsoNormal"> PROJECTION<o:p></o:p></p>
<p class="MsoNormal"> 'init=epsg:4326'<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> CLASS<o:p></o:p></p>
<p class="MsoNormal"> STYLE<o:p></o:p></p>
<p class="MsoNormal"> SYMBOL 'cemetery.png'<o:p></o:p></p>
<p class="MsoNormal"> SIZE 13<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> TEMPLATE 'dummy'<o:p></o:p></p>
<p class="MsoNormal"> END<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">END ## end Map<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you for your help.<o:p></o:p></p>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="1" cellpadding="0" style="border:none;border-top:solid #D3D4DE 1.0pt">
<tbody>
<tr>
<td width="58" style="width:41.25pt;border:none;padding:9.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=icon" target="_blank"><span style="text-decoration:none"><img border="0" width="46" height="29" id="_x0000_i1025" src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif"></span></a><o:p></o:p></span></p>
</td>
<td width="473" style="width:352.5pt;border:none;padding:9.0pt .75pt .75pt .75pt">
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#41424E">Virus-free.
<a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=link" target="_blank">
<span style="color:#4453EA">www.avast.com</span></a> <o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>