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

David Tran david.tran at hsr.ch
Mon Apr 14 06:53:14 PDT 2014


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.

Thanks in advance.

David


More information about the gdal-dev mailing list