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

Jeff McKenna jmckenna at gatewaygeomatics.com
Wed Jun 16 09:51:57 PDT 2021


Thanks Thomas, I'll update the documentation. :)

-jeff



On 2021-06-16 12:52 p.m., Thomas Gratier wrote:
> 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 
> <http://urlflaskserver/my_end_point/layername.geojson>
> 
> So
> 
> CONNECTIONTYPE  OGR
> CONNECTION  "name.json"
> DATA  "layername"
> 
> would be
> 
> CONNECTIONTYPE  OGR
> CONNECTION  "/vsicurl/http://urlflaskserver/my_end_point/layername.geojson 
> <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 
> <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 
> <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 
> <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 
> <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 <mailto: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
>     <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/ <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
>     <mailto:mapserver-users at lists.osgeo.org>
>      > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>     <https://lists.osgeo.org/mailman/listinfo/mapserver-users>
>      >
> 
>     _______________________________________________
>     mapserver-users mailing list
>     mapserver-users at lists.osgeo.org <mailto:mapserver-users at lists.osgeo.org>
>     https://lists.osgeo.org/mailman/listinfo/mapserver-users
>     <https://lists.osgeo.org/mailman/listinfo/mapserver-users>
> 


-- 
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training
co-founder of FOSS4G
http://gatewaygeo.com/



More information about the MapServer-users mailing list