[Gdal-dev] OGR/GEOS Geometry Operators

Frank Warmerdam warmerdam at pobox.com
Fri Sep 17 12:12:32 EDT 2004


Paul,

I was wrong earlier when I said that some of the GEOS geometry bindings
were missing in ogr.py.  They all seem to be there.

eg.

 >>> import ogr
 >>> x = ogr.CreateGeometryFromWkt( 'Point(10 10)' )
 >>> y = x.Buffer( 1.0 )
 >>> print y.ExportToWkt()
POLYGON ((11 10,10.99862953 9.94766404,10.99452190 9.89547154,10.98768834 9.84356553,10.97814760 9.79208831,10.96592583 
9.74118095,10.95105652 9.69098301,10.93358043 9.64163205,10.91354546 9.59326336,10.89100652 9.54600950,10.86602540 
9.50000000,10.83867057 9.45536096,10.80901699 9.41221475,10.77714596 9.37067961,10.74314483 9.33086939,10.70710678 
9.29289322,10.66913061 9.25685517,10.62932039 9.22285404,10.58778525 9.19098301,10.54463904 9.16132943,10.50000000 
9.13397460,10.45399050 9.10899348,10.40673664 9.08645454,10.35836795 9.06641957,10.30901699 9.04894348,10.25881905 
9.03407417,10.20791169 9.02185240,10.15643447 9.01231166,10.10452846 9.00547810,10.05233596 9.00137047,10.00000000 
9.00000000,9.94766404 9.00137047,9.89547154 9.00547810,9.84356554 9.01231166,9.79208831 9.02185240,9.74118095 
9.03407417,9.69098301 9.04894348,9.64163205 9.06641957,9.59326336 9.08645454,9.54600950 9.10899348,9.50000000 
9.13397460,9.45536097 9.16132943,9.41221475 9.19098301,9.37067961 9.22285404,9.33086939 9.25685517,9.29289322 
9.29289322,9.25685517 9.33086939,9.22285404 9.37067961,9.19098301 9.41221475,9.16132943 9.45536096,9.13397460 
9.50000000,9.10899348 9.54600950,9.08645454 9.59326336,9.06641957 9.64163205,9.04894348 9.69098301,9.03407417 
9.74118095,9.02185240 9.79208831,9.01231166 9.84356553,9.00547810 9.89547154,9.00137047 9.94766404,9.00000000 
10.00000000,9.00137047 10.05233596,9.00547810 10.10452846,9.01231166 10.15643446,9.02185240 10.20791169,9.03407417 
10.25881905,9.04894348 10.30901699,9.06641957 10.35836795,9.08645454 10.40673664,9.10899348 10.45399050,9.13397460 
10.50000000,9.16132943 10.54463903,9.19098301 10.58778525,9.22285404 10.62932039,9.25685517 10.66913061,9.29289322 
10.70710678,9.33086939 10.74314483,9.37067961 10.77714596,9.41221475 10.80901699,9.45536096 10.83867057,9.50000000 
10.86602540,9.54600950 10.89100652,9.59326336 10.91354546,9.64163205 10.93358043,9.69098301 10.95105652,9.74118095 
10.96592583,9.79208831 10.97814760,9.84356553 10.98768834,9.89547154 10.99452190,9.94766404 10.99862953,10.00000000 
11.00000000,10.05233596 10.99862953,10.10452846 10.99452190,10.15643446 10.98768834,10.20791169 10.97814760,10.25881904 
10.96592583,10.30901699 10.95105652,10.35836795 10.93358043,10.40673664 10.91354546,10.45399050 10.89100652,10.50000000 
10.86602540,10.54463903 10.83867057,10.58778525 10.80901699,10.62932039 10.77714596,10.66913061 10.74314483,10.70710678 
10.70710678,10.74314483 10.66913061,10.77714596 10.62932039,10.80901699 10.58778525,10.83867057 10.54463904,10.86602540 
10.50000000,10.89100652 10.45399050,10.91354546 10.40673664,10.93358043 10.35836795,10.95105652 10.30901699,10.96592583 
10.25881905,10.97814760 10.20791169,10.98768834 10.15643447,10.99452190 10.10452846,10.99862953 10.05233596,11 10))

Also, I have now implemented the get_Area() method on OGRPolygon, OGRLinearRing
and OGRMultiPolygon and added a GetArea() method in Python on the OGRGeometry.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list