That's pretty cool, you just saved me an awful lot of time!
Thanks,
Jan
On Mon, Apr 29, 2024 at 4:31 PM Even Rouault
wrote:
> Hi,
>
> Something like:
>
>
> from osgeo import ogr
> original_field_names = [ "toolongforshapefile1", "toolongforshapefile2"]
> map_to_shp = {}
> tmpfilename = "/vsimem/
Hi,
Something like:
from osgeo import ogr
original_field_names = [ "toolongforshapefile1", "toolongforshapefile2"]
map_to_shp = {}
tmpfilename = "/vsimem/temp.shp"
ds = ogr.GetDriverByName("ESRI Shapefile").CreateDataSource(tmpfilename)
lyr = ds.CreateLayer("temp")
lyr_defn = lyr.GetLayerDefn()
Hi everyone,
I want to make a map of original (let's say postgresql/postgis) column
names to those used in a shapefile after conversion; assuming that at least
some column names in postgis will be over 10 characters in length, and
shortening may produce conflicts. Basically I know how this is done,