Opened 16 years ago

Closed 15 years ago

#1438 closed defect (fixed)

Error on rendering layers using special OGR attributes

Reported by: szekerest Owned by: warmerdam
Priority: high Milestone:
Component: OGR Support Version: 4.6
Severity: normal Keywords:
Cc: bartvde@…, taatuut@…

Description

Rendering layers with using special OGR attributes such as OGR:LabelText or 
OGR:LabelStyle may fail if the layer file contains different type of 
geometries.
The error message is:
msOGRGetValues(): OGR error. Invalid field index!?!

Attachments (3)

nev.zip (52.2 KB) - added by szekerest 16 years ago.
map file and data to produce the error
ogrfeaturequery.cpp (18.2 KB) - added by szekerest 16 years ago.
simple patch to support filtering by geometry
ogrfeaturequery.2.cpp (18.2 KB) - added by szekerest 16 years ago.
simple patch to support filtering by geometry (ver 2.)

Download all attachments as: .zip

Change History (16)

Changed 16 years ago by szekerest

Attachment: nev.zip added

map file and data to produce the error

comment:1 Changed 16 years ago by szekerest

Cc: warmerdam@… added
Summary: Error on rendering layers using special OGR attributes Error on rendering layers using special OGR attributes
When using layers with multiple geometries there would be useful to have a 
setting for selecting the proper feature type a layer definition applies to.

comment:2 Changed 16 years ago by fwarmerdam

I believe there is already an open feature request to support filtering
on geometry type, but I don't recall the id.

Changed 16 years ago by szekerest

Attachment: ogrfeaturequery.cpp added

simple patch to support filtering by geometry

Changed 16 years ago by szekerest

Attachment: ogrfeaturequery.2.cpp added

simple patch to support filtering by geometry (ver 2.)

comment:3 Changed 16 years ago by szekerest

attachments.isobsolete: 01

comment:4 Changed 16 years ago by szekerest

Owner: changed from mapserverbugs to fwarmerdam
Dear Frank!

Would you mind sending your comments on this patch, because my project highly 
relies on this filtering mode. I have many mapinfo layers with different 
geometries that should be rendered with different layer settings.

Thanks

Tamas Szekeres

comment:5 Changed 16 years ago by fwarmerdam

Cc: warmerdam@… removed
Status: newassigned
Tamas, 

A few points of concern:

 o I am thinking that if the special fields all work in the query (WHERE) 
   clause, then they should also be selectable in an OGR SQL select statement.
   This will require changes to ogr/ogrsf_frmts/generic/ogrdatasource.cpp and 
   ogrgensql.cpp.  I am looking into what would be involved.

 o I am also not sure I like ogr_geometry returning just the short geometry
   type.  I wonder if instead it ought to return the whole geometry for 
   greater generality.  A LIKE comparison against the full (WKT) geometry
   would give you a similar test to what you have now.   Alternatively, 
   perhaps ogr_geometry_wkt and ogr_geometry_type ought to be separate 
   special fields.

In general I am impressed with the patch, and am agreeable to incorporating
a variation on it upstream. 

comment:6 Changed 16 years ago by bartvde@…

Cc: bartvde@… added
Added myself to the cc.

comment:7 Changed 16 years ago by taatuut@…

Cc: taatuut@… added

comment:8 Changed 16 years ago by taatuut@…

Frank,

You mentioned the bug being related to another one.

I think you meant 1129

Regards,

Emil

comment:9 Changed 16 years ago by fwarmerdam

Emil, 

That is right, and if we write "bug 1129" we can follow a link to it. 

comment:10 Changed 16 years ago by szekerest

Frank,

Are you planning this issue to be applied? Since my projects highly depend on
this feature i am continously patching the new releases with it. However it
would be desirable to have a built in functionality to achieve this behaviour.

In addition i am ready to enhance this functionality according to #7 if it is
required.

Best Regards,

Tamas

comment:11 Changed 15 years ago by fwarmerdam

I have suggested that Tamas write a GDAL/OGR RFC on this new feature, and 
once approved commit the changes himself. 

comment:12 Changed 15 years ago by szekerest

Added GDAL RFC 6 describing the proposed changes.
The corresponding tracking bug can be found at:

http://bugzilla.remotesensing.org/show_bug.cgi?id=1333


comment:13 Changed 15 years ago by szekerest

Resolution: fixed
Status: assignedclosed
This feature has been implemented and released with gdal 1.4.0
Closing the bug
Note: See TracTickets for help on using tickets.