[gdal-dev] Problems loading swedish climate data to PostGIS

michael.smith.erdc at gmail.com michael.smith.erdc at gmail.com
Tue Jun 23 17:11:45 PDT 2020


You should try using the precision=no layer creation option. With the default of YES, it tries to set the precision on columns based on the first 50 values. Often you have data that can exceed that. You could either precreate the table with correct field definitions and then append, or set precision equals NO and try the load. 

Michael Smith
US Army Corps

> On Jun 23, 2020, at 7:49 PM, Thiemo Kellner <thiemo at gelassene-pferde.biz> wrote:
> 
> Hi all
> 
> Eli, you are quite right. Typo of mine.
> 
> thiemo @ thiemos-toshi /mnt/schweden % ogr2ogr test.shp SCID_v4.0.gdb HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc 2>/dev/null
> 
> Does work with me too, sort of. As you can see, I suppressed error output. Without it, I get flooded with warnings:
> 
> Warning 1: Value 524332509.438000023 of field AREA of feature 4961 not successfully written. Possibly due to too larger number with respect to field width
> More than 1000 errors or warnings have been reported. No more will be reported from now.
> 
> It puzzles me, however, that if I explicitly give the output format, it fails miserably.
> 
> thiemo @ thiemos-toshi /mnt/schweden % ogr2ogr –f "ESRI Shapefile" test.shp SCID_v4.0.gdb HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc
> FAILURE:
> Unable to open datasource `ESRI Shapefile' with the following drivers.
>   -> `PCIDSK'
> 
> Jeff, suggested, I tried to load into a new empty database with.
> 
> thiemo @ thiemos-toshi /mnt/schweden % ogr2ogr -overwrite –progress --config PG_USE_COPY YES PG:"host='/var/run/postgresql' port='6543' dbname='sverige_gdb' user='sverige'" SCID_v4.0.gdb HBVSv_intrans_HQloc100_rcp45_ensembleMean_diffPerc
> ERROR 1: Couldn't fetch requested layer 'SCID_v4.0.gdb'!
> 
> But still, I get errors.
> 
> Got it! Thomas, you are a genius! You are right with your dash assumption. Whatever I copied from the documentation pdf was not a dash! It loads into non-empty database (as was to be expected).
> 
> Thanks folks, for helping! It loads
> 
> Kind regards
> 
> Thiemo
> 
> 
> 
> Quoting Eli Adam <eadam at co.lincoln.or.us>:
> 
>>> On Tue, Jun 23, 2020 at 1:40 PM Thiemo Kellner
>>> <thiemo at gelassene-pferde.biz> wrote:
>>> 
>>> 
>>> thiemo @ thiemos-toshi /mnt/schweden :-( % ogr2ogr –f "ESRI Shapefile"
>>> test.shp SCID_v4.0.gdb/gdb.shp SCID_v4.0.gdb
>>> HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc
>>> FAILURE:
>>> Unable to open datasource `ESRI Shapefile' with the following drivers.
>>>  -> `PCIDSK'
>> 
>> I think that ogr2ogr destination and source datasets is like this:
>> dst_datasource_name src_datasource_name
>> 
>> Can you try this: ogr2ogr test.shp SCID_v4.0.gdb
>> HBVSv_intrans_HQloc100_rcp85_ensembleMean_diffPerc
>> 
>> If that works, build from there.
>> 
>> HTH, Eli
> 
> 
> -- 
> S/MIME Public Key: https://oc.gelassene-pferde.biz/index.php/s/eJuAUFONag6ofnH
> Signal (Safer than WhatsApp): +49 1578 7723737
> Handys: +41 78 947 36 21 | +49 1578 772 37 37
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list