<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;font-size:small">It looks to me like you are using two dashes: "--f" or perhaps an emdash, and not just "-f" and that ogr2ogr thinks "PostgreSQL" is the name of your datasource. Compare with how it is listed in your initial commands, as a path.<br></div><div class="gmail_default" style="font-family:georgia,serif;font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 23, 2020 at 4:11 PM Jeff McKenna <<a href="mailto:jmckenna@gatewaygeomatics.com">jmckenna@gatewaygeomatics.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Thiemo,<br>
<br>
What if you following my steps and create a new database (sverige2), <br>
then connect to that empty database with ogrinfo, and then try ogr2ogr <br>
on that new empty db.<br>
<br>
-jeff<br>
<br>
<br>
<br>
-- <br>
Jeff McKenna<br>
MapServer Consulting and Training Services<br>
co-founder of FOSS4G<br>
<a href="http://gatewaygeo.com/" rel="noreferrer" target="_blank">http://gatewaygeo.com/</a><br>
<br>
<br>
<br>
On 2020-06-23 5:35 p.m., Thiemo Kellner wrote:<br>
> Hi Jeff<br>
> <br>
> Thank you for sharing your steps. I tried to follow them and had an <br>
> insight though I am still stuck. I noticed that I was passing the gdb <br>
> file within the unzipped folder to ogr2ogr whereas you passed the folder <br>
> path. Switching to your pattern it looks as follows.<br>
> <br>
> thiemo @ thiemos-toshi /mnt/schweden % ogrinfo --formats | grep -i postg<br>
> PostgreSQL -vector- (rw+): PostgreSQL/PostGIS<br>
> PGDUMP -vector- (w+v): PostgreSQL SQL dump<br>
> # PostGIS capabilities of ogrinfo proven<br>
> <br>
> thiemo @ thiemos-toshi /mnt/schweden % ogrinfo <br>
> PG:"host='/var/run/postgresql' port='6543' dbname='sverige' user='sverige'"<br>
> INFO: Open of `PG:host='/var/run/postgresql' port='6543' <br>
> dbname='sverige' user='sverige''<br>
> using driver `PostgreSQL' successful.<br>
> 1: tiger.county (Multi Polygon)<br>
> 2: tiger.state (Multi Polygon)<br>
> ...<br>
> # Connection to PostGIS works<br>
> <br>
> thiemo @ thiemos-toshi /mnt/schweden % ogrinfo SCID_v4.0.gdb<br>
> INFO: Open of `SCID_v4.0.gdb'<br>
> using driver `OpenFileGDB' successful.<br>
> 1: HBVSv_intrans_HQloc100_rcp45_ensembleMean_diffPerc (Multi Polygon)<br>
> 2: HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc (Multi Polygon)<br>
> ...<br>
> # Proven to be able to read the gdb file(s)<br>
> <br>
> thiemo @ thiemos-toshi /mnt/schweden % ogrinfo SCID_v4.0.gdb <br>
> HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc -summary<br>
> INFO: Open of `SCID_v4.0.gdb'<br>
> using driver `OpenFileGDB' successful.<br>
> <br>
> Layer name: HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc<br>
> Geometry: Multi Polygon<br>
> Feature Count: 1103<br>
> ...<br>
> # Proven to be able to access a specific layer in the gdb<br>
> <br>
> thiemo @ thiemos-toshi /mnt/schweden % ogr2ogr –f "PostgreSQL" <br>
> -overwrite –progress --config PG_USE_COPY YES <br>
> PG:"host='/var/run/postgresql' port='5432' dbname='sverige' <br>
> user='sverige'" SCID_v4.0.gdb <br>
> HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc<br>
> FAILURE:<br>
> Unable to open datasource `PostgreSQL' with the following drivers.<br>
> -> `PCIDSK'<br>
> ...<br>
> # UNABLE TO USE ogr2ogr TO WRITE DATA TO MY PostGIS<br>
> <br>
> thiemo @ thiemos-toshi /mnt/schweden :-( % ogr2ogr –f "ESRI Shapefile" <br>
> test.shp SCID_v4.0.gdb/gdb.shp SCID_v4.0.gdb <br>
> HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc<br>
> FAILURE:<br>
> Unable to open datasource `ESRI Shapefile' with the following drivers.<br>
> -> `PCIDSK'<br>
> ...<br>
> # To me it seems that I am not able to use ogr2ogr eventhough I can <br>
> ogrinfo shape files<br>
> thiemo @ thiemos-toshi /mnt/schweden % ogrinfo --formats | grep -i esri<br>
> ESRI Shapefile -vector- (rw+v): ESRI Shapefile<br>
> ESRIJSON -vector- (rov): ESRIJSON<br>
> PGeo -vector- (ro): ESRI Personal GeoDatabase<br>
> OpenFileGDB -vector- (rov): ESRI FileGDB<br>
> <br>
> I am pritty lost.<br>
> <br>
> Kind regards<br>
> <br>
> Thiemo<br>
> <br>
> Quoting Jeff McKenna <<a href="mailto:jmckenna@gatewaygeomatics.com" target="_blank">jmckenna@gatewaygeomatics.com</a>>:<br>
> <br>
>> Hi Thiemo!<br>
>><br>
>> I have downloaded your data, to hopefully show you how I would tackle <br>
>> this.<br>
>><br>
>> First thing is to take this in very small steps, to confirm along the <br>
>> way, otherwise you jump to ogr2ogr without confirming that it is even <br>
>> possible on your system - in other words, live by *ogrinfo*, ogrinfo <br>
>> is your friend, and only move to ogr2ogr once you have ogrinfo happy, <br>
>> and then later use ogrinfo again for confirmation.<br>
>><br>
>> Here are my notes, I've made comments with the # symbol, and I should <br>
>> also mention that I am testing on Windows, with MS4W, so sometimes the <br>
>> exact command may slightly change (such as a single quote instead of a <br>
>> double quote in a command, on Linux systems) :<br>
>><br>
>> create database<br>
>> ---------------<br>
>><br>
>> #must first create an empty db (named 'scid' here), and load the <br>
>> PostGIS extension<br>
>> createdb -U postgres -p 5436 -E UTF8 scid<br>
>> psql -U postgres -d scid -p 5436 -c "CREATE EXTENSION postgis;"<br>
>> psql -U postgres -d scid -p 5436 -c "CREATE EXTENSION postgis_topology;"<br>
>><br>
>> ogrinfo<br>
>> -------<br>
>><br>
>> #verify that your local GDAL/OGR is built with PostGIS and FileGDB <br>
>> support<br>
>> ogrinfo --formats<br>
>><br>
>> PostgreSQL -vector- (rw+): PostgreSQL/PostGIS<br>
>> MySQL -vector- (rw+): MySQL<br>
>> OpenFileGDB -vector- (rov): ESRI FileGDB<br>
>> XPlane -vector- (rov): X-Plane/Flightgear aeronautical data<br>
>> DXF -vector- (rw+v): AutoCAD DXF<br>
>><br>
>> #connect to your new database (see params for the PG driver at <br>
>> <a href="https://gdal.org/drivers/vector/pg.html" rel="noreferrer" target="_blank">https://gdal.org/drivers/vector/pg.html</a> )<br>
>> ogrinfo PG:"host=localhost user=postgres password=postgres port=5436 <br>
>> dbname=scid"<br>
>><br>
>> INFO: Open of `PG:host=localhost user=postgres password=postgres <br>
>> port=5436 dbname=scid'<br>
>> using driver `PostgreSQL' successful.<br>
>><br>
>> #we're in business, no errors, yet no spatial tables listed yet, <br>
>> because there is none<br>
>><br>
>> #examine the file geodatabase<br>
>> ogrinfo SCID_v4.0.gdb<br>
>><br>
>> INFO: Open of `SCID_v4.0.gdb'<br>
>> using driver `OpenFileGDB' successful.<br>
>><br>
>> #in my case, MS4W uses the 'OpenFileGDB' driver, but the 'FileGDB' <br>
>> driver is also possible<br>
>><br>
>> #356 layers should be listed there, with their layer names. I'll use <br>
>> the last layer listed in the long list:<br>
>><br>
>> 356: HBVSv_MLSM_rcp85_ensembleMax_abs (Multi Polygon)<br>
>><br>
>> #so the layer name is 'HBVSv_MLSM_rcp85_ensembleMax_abs'<br>
>><br>
>> #examine the single layer through OGR/GDAL<br>
>> ogrinfo SCID_v4.0.gdb HBVSv_MLSM_rcp85_ensembleMax_abs -summary<br>
>><br>
>> - lists that there are 1103 features in that layer<br>
>> - EPSG (projection): <a href="https://epsg.io/3006" rel="noreferrer" target="_blank">https://epsg.io/3006</a><br>
>><br>
>> ogr2ogr<br>
>> -------<br>
>><br>
>> #now you are ready to use ogr2ogr to bring the FileGDB layer into your <br>
>> empty PG/PostGIS database<br>
>> ogr2ogr -f PostgreSQL PG:"host=localhost user=postgres <br>
>> password=postgres port=5436 dbname=scid" SCID_v4.0.gdb <br>
>> HBVSv_MLSM_rcp85_ensembleMax_abs<br>
>><br>
>> ogrinfo<br>
>> -------<br>
>><br>
>> #use ogrinfo to confirm that the new spatial layer exists in your PG <br>
>> database<br>
>> ogrinfo PG:"host=localhost user=postgres password=postgres port=5436 <br>
>> dbname=scid"<br>
>><br>
>> - should list your new layer 'hbvsv_mlsm_rcp85_ensemblemax_abs'<br>
>><br>
>> #examine your new layer<br>
>> ogrinfo PG:"host=localhost user=postgres password=postgres port=5436 <br>
>> dbname=scid" hbvsv_mlsm_rcp85_ensemblemax_abs -summary<br>
>><br>
>><br>
>><br>
>> Hope this helps. Welcome to the FOSS4G community!<br>
>><br>
>> -jeff<br>
>><br>
>><br>
>> -- <br>
>> Jeff McKenna<br>
>> MapServer Consulting and Training Services<br>
>> co-founder of FOSS4G<br>
>> <a href="http://gatewaygeo.com/" rel="noreferrer" target="_blank">http://gatewaygeo.com/</a><br>
>><br>
>><br>
>><br>
>><br>
>> On 2020-06-23 4:27 a.m., Thiemo Kellner wrote:<br>
>>> Hi<br>
>>><br>
>>> I am new to spacial data processing. For a project of mine I try to <br>
>>> load swedish climate data in to my PostGIS installation running/using <br>
>>> an openSUSE Tumbleweed installation.<br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> gdal-dev mailing list<br>
>> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
>> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
> <br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
> <br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><i><font face="georgia, serif" color="#999999">The right coordinate system can turn an impossible problem into two really hard problems. -- Charlie Pellerin</font></i><div><i><font color="#999999"><br></font></i><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#999999">Thomas Juntunen</font></span><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#999999">GIS Specialist</font></span></div><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><font color="#999999">Polar Geospatial Center<br>R280 Learning and Environmental Science<br>1954 Buford Ave<br>University of Minnesota<br>St. Paul, MN 55108<br><a>612-626-0505</a></font></span></div></div></div></div>