<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></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="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Hi Jeff and others<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">I have been using a Python cgi-bin service that returns a GeoJSON spatial feature:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">LAYER<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"> NAME farm<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"> TYPE POLYGON<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"> STATUS ON<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"> CONNECTIONTYPE OGR<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"> CONNECTION "http://myserver/cgi-bin/farmgjson.py?farmid=%farmid%"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"> VALIDATION<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"> 'farmid' '^[A-Z]{2}[0-9]{5}$'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"> END<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Kind regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif">Robert Sanson<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> mapserver-users <mapserver-users-bounces@lists.osgeo.org>
<b>On Behalf Of </b>Thomas Gratier<br>
<b>Sent:</b> Thursday, 17 June 2021 3:52 am<br>
<b>To:</b> Jeff McKenna <jmckenna@gatewaygeomatics.com><br>
<b>Cc:</b> MapserverList OSGEO <mapserver-users@lists.osgeo.org><br>
<b>Subject:</b> Re: [mapserver-users] server geojson data as input to map file<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Jeff,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Could be wrong but your exemple use a static GeoJSON file whereas flask datasource would more probably be
<a href="http://urlflaskserver/my_end_point/layername.geojson" target="_blank">http://urlflaskserver/my_end_point/layername.geojson</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">So<o:p></o:p></p>
</div>
<div>
<pre>CONNECTIONTYPE OGR<o:p></o:p></pre>
<pre>CONNECTION "name.json"<o:p></o:p></pre>
<pre>DATA "layername"<o:p></o:p></pre>
</div>
<div>
<p class="MsoNormal">would be<o:p></o:p></p>
</div>
<div>
<pre>CONNECTIONTYPE OGR<o:p></o:p></pre>
<pre>CONNECTION "/vsicurl/<a href="http://urlflaskserver/my_end_point/layername.geojson" target="_blank">http://urlflaskserver/my_end_point/layername.geojson</a>"<o:p></o:p></pre>
<pre>DATA "layername"<o:p></o:p></pre>
</div>
<div>
<p class="MsoNormal">FYI, above untested but considering it may work because it could inherit from GDAL/OGR behaviour like below and already mentioned for other datasources e.g
<a href="https://mapserver.org/input/virtual-file.html#configure-mapserver-layer">
https://mapserver.org/input/virtual-file.html#configure-mapserver-layer</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Be aware that remote consumption a least on ogrinfo need an url ending like it's a file e.g<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"># Working because geojson extension in the url (so GDAL can guess it's a GeoJSON)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">ogrinfo -so <a href="https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_airports.geojson">
https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_airports.geojson</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"># Not working whereas it's a GeoJSON <a href="https://ahocevar.com/geoserver/wfs?request=GetFeature&service=WFS&version=1.1.0&outputFormat=application/json&typenames=usa:states">
https://ahocevar.com/geoserver/wfs?request=GetFeature&service=WFS&version=1.1.0&outputFormat=application/json&typenames=usa:states</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">ogrinfo -so /vsicurl/<a href="https://ahocevar.com/geoserver/wfs?request=GetFeature&service=WFS&version=1.1.0&outputFormat=application/json&typenames=usa:states">https://ahocevar.com/geoserver/wfs?request=GetFeature&service=WFS&version=1.1.0&outputFormat=application/json&typenames=usa:states</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Regards<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thomas Gratier<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Le mer. 16 juin 2021 à 16:24, Jeff McKenna <<a href="mailto:jmckenna@gatewaygeomatics.com" target="_blank">jmckenna@gatewaygeomatics.com</a>> a écrit :<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hi Ahmet, yes in fact I recently worked on those documentation steps:
<br>
<a href="https://mapserver.org/input/vector/geojson.html" target="_blank">https://mapserver.org/input/vector/geojson.html</a><br>
<br>
Please let me know if that page needs any enhancements.<br>
<br>
-jeff<br>
<br>
<br>
<br>
-- <br>
Jeff McKenna<br>
GatewayGeo: Developers of MS4W, MapServer Consulting and Training<br>
co-founder of FOSS4G<br>
<a href="http://gatewaygeo.com/" target="_blank">http://gatewaygeo.com/</a><br>
<br>
<br>
<br>
<br>
On 2021-06-16 11:20 a.m., Ahmet Temiz wrote:<br>
> Hi,<br>
> My server(flask) publishes data as geojson.<br>
> Can I get this data to mymapfile's Data as online?<br>
> <br>
> regards<br>
> <br>
> <br>
> -- <br>
> Ahmet Temiz<br>
> Jeoloji Müh.<br>
> Afet ve Acil Durum Yönetimi Başkanlığı<br>
> Deprem Dairesi Başkanlığı<br>
> <br>
> <br>
> ________________________<br>
> <br>
> Ahmet Temiz<br>
> Geological Eng.<br>
> <br>
> Disaster and Emergency Management<br>
> of Presidency<br>
> <br>
> _______________________________________________<br>
> mapserver-users mailing list<br>
> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">
https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
> <br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
</blockquote>
</div>
</div>
<br>
<span style="font-family: Arial; font-size: 8pt; text-decoration: none;">This email, including any attachments, may contain information which is confidential or subject to copyright. If you are not the intended recipient, please notify us immediately and delete
this email from your system. Email communications are not secure and are not guaranteed by AsureQuality Limited to be free of unauthorised interference, error or virus. Anyone who communicates with us by email is taken to accept this risk. Anything in this
email which does not relate to the official business of AsureQuality Limited is neither given nor endorsed by AsureQuality Limited. Please refer to
<a href="https://www.asurequality.com">www.asurequality.com</a> or contact AsureQuality Limited for more information, including about our terms of business.</span>
</body>
</html>