[mapserver-users] server geojson data as input to map file

Thomas Gratier osgeo.mailinglist at gmail.com
Wed Jun 16 08:52:04 PDT 2021


Hi Jeff,

Could be wrong but your exemple use a static GeoJSON file whereas flask
datasource would more probably be
http://urlflaskserver/my_end_point/layername.geojson

So

CONNECTIONTYPE OGRCONNECTION "name.json"DATA "layername"

would be

CONNECTIONTYPE OGRCONNECTION
"/vsicurl/http://urlflaskserver/my_end_point/layername.geojson"DATA
"layername"

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
https://mapserver.org/input/virtual-file.html#configure-mapserver-layer

Be aware that remote consumption a least on ogrinfo need an url ending like
it's a file e.g
# Working because geojson extension in the url (so GDAL can guess it's a
GeoJSON)
ogrinfo -so
https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_airports.geojson

# Not working whereas it's a GeoJSON
https://ahocevar.com/geoserver/wfs?request=GetFeature&service=WFS&version=1.1.0&outputFormat=application/json&typenames=usa:states
ogrinfo -so /vsicurl/
https://ahocevar.com/geoserver/wfs?request=GetFeature&service=WFS&version=1.1.0&outputFormat=application/json&typenames=usa:states

Regards

Thomas Gratier

Le mer. 16 juin 2021 à 16:24, Jeff McKenna <jmckenna at gatewaygeomatics.com>
a écrit :

> Hi Ahmet, yes in fact I recently worked on those documentation steps:
> https://mapserver.org/input/vector/geojson.html
>
> Please let me know if that page needs any enhancements.
>
> -jeff
>
>
>
> --
> Jeff McKenna
> GatewayGeo: Developers of MS4W, MapServer Consulting and Training
> co-founder of FOSS4G
> http://gatewaygeo.com/
>
>
>
>
> On 2021-06-16 11:20 a.m., Ahmet Temiz wrote:
> > Hi,
> > My server(flask) publishes data as geojson.
> > Can I get this data to mymapfile's Data as online?
> >
> > regards
> >
> >
> > --
> > Ahmet Temiz
> > Jeoloji Müh.
> > Afet ve Acil Durum Yönetimi Başkanlığı
> > Deprem  Dairesi Başkanlığı
> >
> >
> > ________________________
> >
> > Ahmet Temiz
> > Geological Eng.
> >
> > Disaster and Emergency Management
> > of Presidency
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210616/6990026f/attachment.htm>


More information about the MapServer-users mailing list