Opened 15 years ago

Last modified 15 years ago

#2949 closed defect

Add OGR_GEOM_AREA special field — at Version 1

Reported by: Daniel Morissette Owned by: Daniel Morissette
Priority: normal Milestone: 1.7.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: warmerdam, Even Rouault

Description (last modified by Daniel Morissette)

I'd like to use a OGR SQL statement to filter features from a shapefile based on their area. e.g. keep only the large lakes in a water layer for instance.

A simple way to allow this would be to add a new OGR_GEOM_AREA special field on OGRFeatures that calls the OGRSurface::getArea() method and would be handled similar to the OGR_GEOM_WKT and other special fields in OGRFeature::GetFieldAsString().

Another option could be to add operators on geometries in the SQL parser but that could be a bit more involved (e.g. "select ST_Area(geom) from ...").

Change History (2)

comment:1 by Daniel Morissette, 15 years ago

Description: modified (diff)

by Daniel Morissette, 15 years ago

Attachment: ticket2949.patch added

Patch against SVN trunk that implements support for OGR_GEOM_AREA

Note: See TracTickets for help on using tickets.