hellik
1
hi devs,
is there a way to get bboxes of vector geometries (polygones) in a vector
layer by pygrass/python grassscript and to loop through the bboxes?
thanks
-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/bbox-of-a-vector-geometry-tp5280283.html
Sent from the Grass - Dev mailing list archive at Nabble.com.
On Wed, Aug 10, 2016 at 2:01 PM, Helmut Kudrnovsky <hellik@web.de> wrote:
hi devs,
is there a way to get bboxes of vector geometries (polygones) in a vector
layer by pygrass/python grassscript and to loop through the bboxes?
I would say, loop through the geometries and use .bbox():
https://grass.osgeo.org/grass70/manuals/libpython/pygrass.vector.html#pygrass.vector.geometry.Line.bbox
thanks
-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/bbox-of-a-vector-geometry-tp5280283.html
Sent from the Grass - Dev mailing list archive at Nabble.com.
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
hellik
3
Anna Petrášová wrote
On Wed, Aug 10, 2016 at 2:01 PM, Helmut Kudrnovsky <
hellik@
> wrote:
hi devs,
is there a way to get bboxes of vector geometries (polygones) in a vector
layer by pygrass/python grassscript and to loop through the bboxes?
I would say, loop through the geometries and use .bbox():
https://grass.osgeo.org/grass70/manuals/libpython/pygrass.vector.html#pygrass.vector.geometry.Line.bbox
thanks!
after some poking around the programming manual and testing with the NC
sample dataset:
from grass.pygrass.vector import VectorTopo
from grass.pygrass.vector.geometry import Area
lake = VectorTopo('lakes')
lake.open(mode = 'r')
lake.bbox()
Bbox(258302.909848, 196084.815242, 677118.419101, 610760.703857)
lake.read(1)
LINEARRING (635797.5422910848900000 258138.3288798251600000,
635788.3098806196400000 258130.5942595548700000, 635783.6369824736600000
258136.4080263839000000, 635779.2935737869700000 258145.4350012375500000,
635776.6213868428000000 258154.4351536379500000, 635774.5834899671600000
258160.7990855638100000, 635770.6960629925600000 258166.9905003495200000,
635776.6043180087600000 258172.6283972222000000, 635782.4570993143100000
258168.6745237157400000, 635786.8794513597400000 258161.4946405562500000,
635790.4419608837900000 258153.9965455597800000, 635794.4360680728000000
258144.5449834555900000, 635797.5422910848900000 258138.3288798251600000)
area1 = Area(v_id = 1, c_mapinfo = lake.c_mapinfo)
area1.bbox()
Bbox(258172.628397, 258130.59426, 635797.542291, 635770.696063)
nice feature of pygrass!
-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/bbox-of-a-vector-geometry-tp5280283p5280307.html
Sent from the Grass - Dev mailing list archive at Nabble.com.
hellik
4
Helmut Kudrnovsky wrote
area1.bbox()
Bbox(258172.628397, 258130.59426, 635797.542291, 635770.696063)
as mentioned in
https://grass.osgeo.org/grass73/manuals/libpython/pygrass_vector.html#more-examples
this means:
area.bbox() # north, south, east, west
-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/bbox-of-a-vector-geometry-tp5280283p5280308.html
Sent from the Grass - Dev mailing list archive at Nabble.com.