[gdal-dev] Fwd: ogr2ogr

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Fwd: ogr2ogr

Mncedi Dlayiya
Hello everyone,

I am new in GDAL so I'm struggling to convert a wfs to shapefile using ogr2ogr.

my command is as follows: 

C:\>ogr2ogr -f "ESRI SHAPEFILE" ec_pensioners WFS:" http://localhost:8080/geoserver/osw?" pensioners


The error message I get:

FAILURE:
Unable to open datasource `WFS: http://localhost:8080/geoserver/osw?' with the following drivers.
  -> `JP2ECW'
  -> `OCI'
  -> `SOSI'
  -> `PCIDSK'
  -> `netCDF'
  -> `JP2OpenJPEG'
  -> `PDF'
  -> `MBTiles'
  -> `EEDA'
  -> `DB2ODBC'
  -> `ESRI Shapefile'
  -> `MapInfo File'
  -> `UK .NTF'
  -> `OGR_SDTS'
  -> `S57'
  -> `DGN'
  -> `OGR_VRT'
  -> `REC'
  -> `Memory'
  -> `BNA'
  -> `CSV'
  -> `NAS'
  -> `GML'
  -> `GPX'
  -> `LIBKML'
  -> `KML'
  -> `GeoJSON'
  -> `GeoJSONSeq'
  -> `ESRIJSON'
  -> `TopoJSON'
  -> `Interlis 1'
  -> `Interlis 2'
  -> `OGR_GMT'
  -> `GPKG'
  -> `SQLite'
  -> `ODBC'
  -> `WAsP'
  -> `PGeo'
  -> `MSSQLSpatial'
  -> `OGR_OGDI'
  -> `PostgreSQL'
  -> `MySQL'
  -> `OpenFileGDB'
  -> `XPlane'
  -> `DXF'
  -> `CAD'
  -> `Geoconcept'
  -> `GeoRSS'
  -> `GPSTrackMaker'
  -> `VFK'
  -> `PGDUMP'
  -> `OSM'
  -> `GPSBabel'
  -> `SUA'
  -> `OpenAir'
  -> `OGR_PDS'
  -> `WFS'
  -> `WFS3'
  -> `HTF'
  -> `AeronavFAA'
  -> `Geomedia'
  -> `EDIGEO'
  -> `GFT'
  -> `SVG'
  -> `CouchDB'
  -> `Cloudant'
  -> `Idrisi'
  -> `ARCGEN'
  -> `SEGUKOOA'
  -> `SEGY'
  -> `XLS'
  -> `ODS'
  -> `XLSX'
  -> `ElasticSearch'
  -> `Walk'
  -> `Carto'
  -> `AmigoCloud'
  -> `SXF'
  -> `Selafin'
  -> `JML'
  -> `PLSCENES'
  -> `CSW'
  -> `VDV'
  -> `GMLAS'
  -> `MVT'
  -> `TIGER'
  -> `AVCBin'
  -> `AVCE00'
  -> `NGW'
  -> `HTTP'

Thank you in advance

Mncedi

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: ogr2ogr

Even Rouault-2
On jeudi 2 mai 2019 15:11:03 CEST Mncedi Dlayiya wrote:
> Hello everyone,
>
> I am new in GDAL so I'm struggling to convert a wfs to shapefile using
> ogr2ogr.

From the error message, it seems there's an extra space between WFS: ad
http:// . Try to quote the whole WFS connection string

"WFS:http://localhost:8080/geoserver/osw?"

And the osw entry point is suspicious. Shouldn't that be ows (acronym for OGC
Web Services) instead ?

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: ogr2ogr

jratike80
In reply to this post by Mncedi Dlayiya
Mncedi Dlayiya wrote
> Hello everyone,
>
> I am new in GDAL so I'm struggling to convert a wfs to shapefile using
> ogr2ogr.
>
> my command is as follows:
>
> C:\>ogr2ogr -f "ESRI SHAPEFILE" ec_pensioners WFS:"
> http://localhost:8080/geoserver/osw?" pensioners

Hi,

And my command that works with the demo layer "states" (actually
"topp:states") is

ogr2ogr -f "ESRI Shapefile" test.shp
WFS:"http://localhost:8080/geoserver/ows?" states

Notices:

- Check the url of your service (osw vs. ows)
- Output name "test" should perhaps work and create a new directory and
insert shapefile into that. However, I got a directory "test" and an empty
file "topp" inside it. If your intention is not to write into a named
directory use "ec_pensioners.shp" as output.

-Jukka Rahkonen-





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: ogr2ogr

jmckenna
Administrator
In reply to this post by Mncedi Dlayiya
Hi Mncedi,

Welcome to GDAL !

Here is how I recommend working through that (using a working example) :

Step 1:  ogrinfo
----------------

Always always start with an ogrinfo command, to see the available layer
names:

        ogrinfo WFS:https://demo.gatewaygeomatics.com/cgi-bin/wfs_gateway


        returns:

                using driver `WFS' successful.
                1: ms:park

Great! We now know the layer name is called "ms:park"

Step 2: ogrinfo + layername
---------------------------

Next, see if ogrinfo can return info about that ms:park layer:

        ogrinfo WFS:https://demo.gatewaygeomatics.com/cgi-bin/wfs_gateway 
ms:park -summary

        returns:

                using driver `WFS' successful.
                Layer name: ms:park
                        Metadata:
    TITLE=Parks
                                Geometry: Unknown (any)
                                Feature Count: 46
                                Extent: (-2346804.000000, -67422.421875) - (2840366.000000,
3830124.250000)
                                Layer SRS WKT:
                                PROJCS["NAD83 / Canada Atlas Lambert"

Great! ogrinfo gave us info about our layer

Step 3: ogr2ogr + layername
---------------------------

Notice that the syntax is something like:  ogr2ogr output input layername :

        ogr2ogr -f "ESRI Shapefile" parks.shp
WFS:https://demo.gatewaygeomatics.com/cgi-bin/wfs_gateway ms:park



Tested using MS4W 4.0 https://ms4w.com

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/

On 2019-05-02 10:11 AM, Mncedi Dlayiya wrote:

> Hello everyone,
>
> I am new in GDAL so I'm struggling to convert a wfs to shapefile using
> ogr2ogr.
>
> my command is as follows:
>
> C:\>ogr2ogr -f "ESRI SHAPEFILE" ec_pensioners WFS:"
> http://localhost:8080/geoserver/osw?" pensioners
>
>   * ec_pensioners is the name of the wfs layer
>   * pensioners is the output layer
>   * " http://localhost:8080/geoserver/osw?" is where the layer is hosted
>
>
> The error message I get:
>
> FAILURE:
> Unable to open datasource `WFS: http://localhost:8080/geoserver/osw?' 
> with the following drivers.
>    -> `JP2ECW'
>    -> `OCI'
>    -> `SOSI'
>    -> `PCIDSK'
>    -> `netCDF'
>    -> `JP2OpenJPEG'
>    -> `PDF'
>    -> `MBTiles'
>    -> `EEDA'
>    -> `DB2ODBC'
>    -> `ESRI Shapefile'
>    -> `MapInfo File'
>    -> `UK .NTF'
>    -> `OGR_SDTS'
>    -> `S57'
>    -> `DGN'
>    -> `OGR_VRT'
>    -> `REC'
>    -> `Memory'
>    -> `BNA'
>    -> `CSV'
>    -> `NAS'
>    -> `GML'
>    -> `GPX'
>    -> `LIBKML'
>    -> `KML'
>    -> `GeoJSON'
>    -> `GeoJSONSeq'
>    -> `ESRIJSON'
>    -> `TopoJSON'
>    -> `Interlis 1'
>    -> `Interlis 2'
>    -> `OGR_GMT'
>    -> `GPKG'
>    -> `SQLite'
>    -> `ODBC'
>    -> `WAsP'
>    -> `PGeo'
>    -> `MSSQLSpatial'
>    -> `OGR_OGDI'
>    -> `PostgreSQL'
>    -> `MySQL'
>    -> `OpenFileGDB'
>    -> `XPlane'
>    -> `DXF'
>    -> `CAD'
>    -> `Geoconcept'
>    -> `GeoRSS'
>    -> `GPSTrackMaker'
>    -> `VFK'
>    -> `PGDUMP'
>    -> `OSM'
>    -> `GPSBabel'
>    -> `SUA'
>    -> `OpenAir'
>    -> `OGR_PDS'
>    -> `WFS'
>    -> `WFS3'
>    -> `HTF'
>    -> `AeronavFAA'
>    -> `Geomedia'
>    -> `EDIGEO'
>    -> `GFT'
>    -> `SVG'
>    -> `CouchDB'
>    -> `Cloudant'
>    -> `Idrisi'
>    -> `ARCGEN'
>    -> `SEGUKOOA'
>    -> `SEGY'
>    -> `XLS'
>    -> `ODS'
>    -> `XLSX'
>    -> `ElasticSearch'
>    -> `Walk'
>    -> `Carto'
>    -> `AmigoCloud'
>    -> `SXF'
>    -> `Selafin'
>    -> `JML'
>    -> `PLSCENES'
>    -> `CSW'
>    -> `VDV'
>    -> `GMLAS'
>    -> `MVT'
>    -> `TIGER'
>    -> `AVCBin'
>    -> `AVCE00'
>    -> `NGW'
>    -> `HTTP'
>
> Thank you in advance
>
> Mncedi
>
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev