Opened 5 years ago

Closed 4 years ago

#5212 closed defect (wontfix)

Dataset with "name" and "Name" attributes result in no-attributes KML

Reported by: strk Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version:
Severity: normal Keywords:
Cc:

Description

ogr2ogr -f kml /dev/stdout PG: -sql "SELECT 'a' as name,  'b' as \"Name\""
<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document><Folder><name>sql_statement</name>
  <Placemark>
  </Placemark>
</Folder>
</Document></kml>

Neither 'a' nor 'b' are in output

See #5208

Change History (2)

comment:1 Changed 5 years ago by Even Rouault

Version: 1.10.0

This behaviour should be pretty general in OGR. Fields with identical names (case insensitive comparison) will cause all sort of problems due to various name <--> index mapping in drivers, in OGR core, etc. This has likely never worked, and I doubt there's an interest in changing that behaviour in practice.

For the record, in 1.9.X, 1.10 and trunk behave exactly the same :

$ ogrinfo pg:dbname=autotest -sql "select 'a' as name, 'b' as \"Name\""
INFO: Open of `pg:dbname=autotest'
      using driver `PostgreSQL' successful.

Layer name: sql_statement
Geometry: Unknown (any)
Feature Count: 1
Layer SRS WKT:
(unknown)
name: String (0.0)
OGRFeature(sql_statement):1
  name (String) = (null)

1.8.X behaves a bit differently :

$ ogrinfo pg:dbname=autotest -sql "select 'a' as name, 'b' as \"Name\""
INFO: Open of `pg:dbname=autotest'
      using driver `PostgreSQL' successful.

Layer name: sql_statement
Geometry: Unknown (any)
Feature Count: 1
Layer SRS WKT:
(unknown)
name: String (0.0)
Name: String (0.0)
OGRFeature(sql_statement):0
  name (String) = b
  Name (String) = (null)

comment:2 Changed 4 years ago by Jukka Rahkonen

Resolution: wontfix
Status: newclosed

I interpret that Even said "wontfix". Closing.

Note: See TracTickets for help on using tickets.