Opened 19 years ago

Closed 17 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 19 years ago.
map file and data to produce the error
ogrfeaturequery.cpp (18.2 KB ) - added by szekerest 19 years ago.
simple patch to support filtering by geometry
ogrfeaturequery.2.cpp (18.2 KB ) - added by szekerest 19 years ago.
simple patch to support filtering by geometry (ver 2.)

Download all attachments as: .zip

Change History (16)

by szekerest, 19 years ago

Attachment: nev.zip added

map file and data to produce the error

comment:1 by szekerest, 19 years ago

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 by fwarmerdam, 19 years ago

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

by szekerest, 19 years ago

Attachment: ogrfeaturequery.cpp added

simple patch to support filtering by geometry

by szekerest, 19 years ago

Attachment: ogrfeaturequery.2.cpp added

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

comment:3 by szekerest, 19 years ago

attachments.isobsolete: 01

comment:4 by szekerest, 19 years ago

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 by fwarmerdam, 19 years ago

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 by bartvde@…, 19 years ago

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

comment:7 by taatuut@…, 19 years ago

Cc: taatuut@… added

comment:8 by taatuut@…, 19 years ago

Frank,

You mentioned the bug being related to another one.

I think you meant 1129

Regards,

Emil

comment:9 by fwarmerdam, 19 years ago

Emil, 

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

comment:10 by szekerest, 18 years ago

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 by fwarmerdam, 18 years ago

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

comment:12 by szekerest, 18 years ago

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 by szekerest, 17 years ago

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.