Opened 7 years ago

Closed 5 years ago

#6983 closed enhancement (wontfix)

GeoPackage vector | geometry type

Reported by: hansw Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: 2.2.1
Severity: minor Keywords: GeoPackage vector geometry type column
Cc:

Description

Currently the geometry type of a geometry column in a newly created GeoPackage is always "GEOMETRY". The driver should automagically detect the correct geometry type (e.g. MULTILINESTRING) and set it in the appropriate column "geometry_type_name". See: http://www.geopackage.org/spec/#table_column_data_types

Additional there should be a layer creation option to be able to set the geometry type as for the column name of the geometry ("GEOMETRY_NAME").

Change History (6)

comment:1 by Even Rouault, 7 years ago

If you use properly the OGR API CreateLayer() you can specify the geometry type. Or with ogr2ogr this can be done with the -nlt option.

comment:2 by hansw, 7 years ago

Thank you for the hint! To force the geometry type with the -nlt option works as expected and is a nice workaround.

The idea/request to determine the geometry type automagically by the GeoPackage driver still stands. As I can't implement this function in GDAL myself.

comment:3 by Even Rouault, 7 years ago

I'm not sure of your worflow, but there is no particular reason to put it in the GeoPackage driver itself. Could perhaps make sense in ogr2ogr itself. How would you imagine that to work: from the geometry type of the first feature to be inserted in the new layer ?

comment:4 by hansw, 7 years ago

If possible I would check all Features to "copy". For the case only one geometry type exists, the new geometry type is clear. If multiple geometry types exist use the "GEOMETRY" type.

For the case it is not possible to check all Features to "copy", before creating the new FeatureClass: you could use the first Feature as you described. But it might also be OK to just use the "GEOMETRY" type.

comment:5 by Even Rouault, 6 years ago

Related ticket #5254

comment:6 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.