Hi Jeff and others

I have been using a Python cgi-bin service that returns a GeoJSON spatial 
feature:

LAYER
  NAME farm
  TYPE POLYGON
  STATUS ON
  CONNECTIONTYPE OGR
  CONNECTION "http://myserver/cgi-bin/farmgjson.py?farmid=%farmid%";
  VALIDATION
   'farmid'         '^[A-Z]{2}[0-9]{5}$'
  END
…

Kind regards

Robert Sanson

From: mapserver-users <[email protected]> On Behalf Of 
Thomas Gratier
Sent: Thursday, 17 June 2021 3:52 am
To: Jeff McKenna <[email protected]>
Cc: MapserverList OSGEO <[email protected]>
Subject: Re: [mapserver-users] server geojson data as input to map file

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 OGR

CONNECTION "name.json"

DATA "layername"
would be

CONNECTIONTYPE OGR

CONNECTION "/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 
<[email protected]<mailto:[email protected]>> 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
> [email protected]<mailto:[email protected]>
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>

_______________________________________________
mapserver-users mailing list
[email protected]<mailto:[email protected]>
https://lists.osgeo.org/mailman/listinfo/mapserver-users

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 
www.asurequality.com<https://www.asurequality.com> or contact AsureQuality 
Limited for more information, including about our terms of business.
_______________________________________________
mapserver-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to