Hi Jukka,
GDAL has the internal default of 80 characters. GDAL users do not really need
other options because fields are automatically expanded when longer strings are
appended afterwards but if the shapefile is used in some other software it does
happen that it is impossible to insert long s
: matteo
Lähetetty: perjantai 8. lokakuuta 2021 12.29
Vastaanottaja: Rahkonen Jukka (MML) ; Even
Rouault ; gdal-dev@lists.osgeo.org
Aihe: Re: [gdal-dev] ogr2ogr changes field length
Hi Jukka,
works perfectly, thanks!
so no default options to impose the field length but it is alterable after
Hi Jukka,
works perfectly, thanks!
so no default options to impose the field length but it is alterable after
Cheers!
Matteo
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev
).
-Jukka Rahkonen-
-Alkuperäinen viesti-
Lähettäjä: matteo
Lähetetty: perjantai 8. lokakuuta 2021 11.20
Vastaanottaja: Rahkonen Jukka (MML) ; Even
Rouault ; gdal-dev@lists.osgeo.org
Aihe: Re: [gdal-dev] ogr2ogr changes field length
Hi Jukka,
> The strings fields are created by defau
Hi Jukka,
The strings fields are created by default with width 80. If there are longer
strings in the data the width is automatically extended up till 255 characters
that is the maximum that dBase format supports. If strings are shorter than 80
charaters it is possible to use RESIZE and shrin
o you have some concrete problem with field widths that you want to resolve?
-Jukka Rahkonen-
-Alkuperäinen viesti-
Lähettäjä: gdal-dev Puolesta matteo
Lähetetty: perjantai 8. lokakuuta 2021 9.11
Vastaanottaja: Even Rouault ;
gdal-dev@lists.osgeo.org
Aihe: Re: [gdal-dev] ogr2ogr cha
Hi Even,
If you add -lco RESIZE=YES fields will be resized to their minimum size.
See https://gdal.org/drivers/vector/shapefile.html#layer-creation-options
yep I see. I also read
* String fields without an assigned width are treated as 80 characters
does it mean that if a field is set as TEX
If you add -lco RESIZE=YES fields will be resized to their minimum size.
See https://gdal.org/drivers/vector/shapefile.html#layer-creation-options
Le 07/10/2021 à 17:40, matteo a écrit :
Even,
still a weird issue with the command. I'm using this command
ogr2ogr -f "ESRI Shapefile" /home/matte
Even,
still a weird issue with the command. I'm using this command
ogr2ogr -f "ESRI Shapefile" /home/matteo/myfolder "PG:dbname='mydb'
host=myhost port=5432 user='myuser' password='mypws' sslmode=disable
schemas='dati'" --config PG_USE_COPY YES --config PG_LIST_ALL_TABLES YES
-progress'
so
Hi Even,
thanks for the hint :) it si just an additional step
Cheers!
Matteo
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Matteo,
When overwriting, a fresh new file/table is creating, without keeping
anything from the existing version.
You could probably just blank your target with
ogrinfo target.shp -sql "DELETE FROM target" -dialect SQLITE
and then ogr2ogr -append target.shp PG: -nln target
Even
Le 06
Hi list,
I've a script that uses ogr2ogr to copy, actually overwrite, tables from
PG to shapfiles.
The PG fields are all text (without a specified length) and the target
shapefile that will be overwritten have all text field length equals to 254.
When overwriting the length is changes to 80
12 matches
Mail list logo