[gdal-dev] Problems loading swedish climate data to PostGIS
thiemo at gelassene-pferde.biz
Tue Jun 23 22:28:22 PDT 2020
Thanks for pointing out the source of mentioned warning and nudging to a solution.
24.06.2020 2:11:54 vorm. michael.smith.erdc at gmail.com:
> 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
>> 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
>> 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
>>>> 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
>>> If that works, build from there.
>>> HTH, Eli
More information about the gdal-dev