Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find OGR field for Arrow array when converting from GPKG to SHP #8849

Closed
lnicola opened this issue Nov 28, 2023 · 2 comments
Closed
Assignees

Comments

@lnicola
Copy link
Contributor

lnicola commented Nov 28, 2023

$ ogr2ogr 1.shp 1.gpkg 
Warning 6: Normalized/laundered field name: 'SHAPE_Length' to 'SHAPE_Leng'
Warning 6: Normalized/laundered field name: 'GEOMORFOLOGIA' to 'GEOMORFOLO'
ERROR 1: Cannot find OGR field for Arrow array SHAPE_Length
ERROR 1: WriteArrowBatch() failed
ERROR 1: Terminating translation prematurely after failed
translation of layer 1 (use -skipfailures to skip errors)

# works
$ ogr2ogr -select 'geom, OBJECTID, SHAPE_Length, GEOMORFOLOGIA' 1.shp 1.gpkg 
Warning 6: Normalized/laundered field name: 'SHAPE_Length' to 'SHAPE_Leng'
Warning 6: Normalized/laundered field name: 'GEOMORFOLOGIA' to 'GEOMORFOLO'

File provided by @latot, not sure if I can share it, but I wanted to file this earlier given the imminent 3.8.1 release.

This is not the same as #8761, the example there works for me.

$ ogrinfo 1.gpkg
INFO: Open of `1.gpkg'
      using driver `GPKG' successful.

Layer name: 1
Geometry: Line String
Feature Count: 11
Extent: (259699.000500, 5855182.362600) - (296077.116200, 5867398.473500)
Layer SRS WKT:
PROJCRS["SIRGAS 1995 / UTM zone 19S",
    BASEGEOGCRS["SIRGAS 1995",
        DATUM["Sistema de Referencia Geocentrico para America del Sur 1995",
            ELLIPSOID["GRS 1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4170]],
    CONVERSION["UTM zone 19S",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-69,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",10000000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Engineering survey, topographic mapping."],
        AREA["South America between 72°W and 66°W, southern hemisphere, onshore and offshore."],
        BBOX[-59.87,-72,0,-66]],
    ID["EPSG",31994]]
Data axis to CRS axis mapping: 1,2
FID Column = fid
Geometry Column = geom
OBJECTID: Integer64 (0.0)
SHAPE_Length: Real (0.0)
GEOMORFOLOGIA: String (0.0)

Tested with the current ghcr.io/osgeo/gdal:ubuntu-full-3.8.1.

@latot
Copy link

latot commented Nov 28, 2023

@lnicola you can share it! thx posting it!

@lnicola
Copy link
Contributor Author

lnicola commented Nov 28, 2023

1.zip

rouault added a commit to rouault/gdal that referenced this issue Nov 28, 2023
rouault added a commit to rouault/gdal that referenced this issue Nov 28, 2023
@rouault rouault self-assigned this Nov 28, 2023
rouault added a commit that referenced this issue Nov 28, 2023
ogr2ogr: fix GPKG -> Shapefile when field names are truncated (fix #8849, 3.8.0 regression)
rouault added a commit that referenced this issue Nov 28, 2023
ralphraul pushed a commit to 1SpatialGroupLtd/gdal that referenced this issue Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants