[gdal-dev] How to use OGROpen with WFS?

Even Rouault even.rouault at mines-paris.org
Mon Apr 14 07:37:28 PDT 2014


Selon David Tran <david.tran at hsr.ch>:

> Hi
>
> I tried this:
>
> >     OGRRegisterAll();
> >     sourceName = "http://maps.zh.ch/wfs/FnsNSWFS";
> >     sourceData = OGROpen( sourceName.c_str(), 0, NULL );
> >     if(sourceData == NULL) {
> >         printf("Open failed.\n");
> >         exit(1);
> >     }
>
> and it ends with:
>
> > ERROR 4: Failed to read GeoJSON data
> > Open failed.
>
> Does anybody has a proper example?
>
> ogrinfo -ro -so WFS:"http://maps.zh.ch/wfs/FnsNSWFS" shows something,
> therefore I think that it is my source code.

Yes, you must include the "WFS:" prefix in the sourceName...

>
> Thanks in advance.
>
> David
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list