Changeset 12039
- Timestamp:
- 09/03/07 12:52:01 (1 year ago)
- Files:
-
- trunk/gdal/ogr (modified) (1 prop)
- trunk/gdal/ogr/ogr_api.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/ogr
- Property svn:ignore changed from
*.lo
*.obj
.libs
.deps
test1
test2
test_ogrsf
ogrinfo
ogrtindex
ogr2ogr
man
html
data
*.bin
*.txt
SFDUMP
dlldata.c
geometryidl.h
geometryidl_i.c
geometryidl_p.c
spatialreferenceidl.h
spatialreferenceidl_i.c
spatialreferenceidl_p.c
*.pdb
*.ilk
*.lib
*.exp
sdts2mi
epsgtest
sfcdump*
*.opt
*.exe
*.exe.manifest
testepsg
to
*.lo
*.obj
*.swp
.libs
.deps
test1
test2
test_ogrsf
ogrinfo
ogrtindex
ogr2ogr
man
html
data
*.bin
*.txt
SFDUMP
dlldata.c
geometryidl.h
geometryidl_i.c
geometryidl_p.c
spatialreferenceidl.h
spatialreferenceidl_i.c
spatialreferenceidl_p.c
*.pdb
*.ilk
*.lib
*.exp
sdts2mi
epsgtest
sfcdump*
*.opt
*.exe
*.exe.manifest
testepsg
- Property svn:ignore changed from
trunk/gdal/ogr/ogr_api.cpp
r10645 r12039 635 635 636 636 { 637 VALIDATE_POINTER1( hGeom, "OGR_G_GetArea", 0 ); 638 639 double fArea = 0.0; 640 637 641 switch( wkbFlatten(((OGRGeometry *) hGeom)->getGeometryType()) ) 638 642 { 639 643 case wkbPolygon: 640 return((OGRPolygon *) hGeom)->get_Area();644 fArea = ((OGRPolygon *) hGeom)->get_Area(); 641 645 break; 642 646 643 647 case wkbMultiPolygon: 644 return((OGRMultiPolygon *) hGeom)->get_Area();648 fArea = ((OGRMultiPolygon *) hGeom)->get_Area(); 645 649 break; 646 650 647 651 case wkbLinearRing: 648 return ((OGRLinearRing *) hGeom)->get_Area(); 649 break; 650 651 default: 652 return 0.0; 653 } 654 } 655 652 case wkbLineString: 653 /* This test below is required to filter out wkbLineString geometries 654 * not being of type of wkbLinearRing. 655 */ 656 if( EQUAL( ((OGRGeometry*) hGeom)->getGeometryName(), "LINEARRING" ) ) 657 { 658 fArea = ((OGRLinearRing *) hGeom)->get_Area(); 659 } 660 break; 661 662 default: 663 CPLError( CE_Warning, CPLE_AppDefined, 664 "OGR_G_GetArea() called against non-surface geometry type." ); 665 666 fArea = 0.0; 667 } 668 669 return fArea; 670 } 671
