[GRASS-user] Grass 6.4, Opensuse 13.1/13.2

Dear all,

A couple of weeks ago I made the mistake of upgrading Opensuse on this 32 Toshiba Laptop to 13.2. Grass failed to work with error messages indicating NumPy had not been installed. It had been installed but did not contain the files Grass was looking for. Attempts at removing and re-installing NumPy all produced the same incomplete file set. (i586 installation)

I have reverted to Opensuse 13.1 and now have another non working version Grass 6.4

Traceback (most recent call

GRASS 6.4.3 (South_Oxfordshire):~ > Traceback (most recent call last):

File “/opt/grass/etc/wxpython/wxgui.py”, line 139, in

sys.exit(main())

File “/opt/grass/etc/wxpython/wxgui.py”, line 132, in main

app = GMApp(workspaceFile)

File “/opt/grass/etc/wxpython/wxgui.py”, line 45, in init

wx.App.init(self, False)

File “/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py”, line 7981, in init

self._BootstrapApp()

File “/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py”, line 7555, in _BootstrapApp

return core.PyApp__BootstrapApp(*args, **kwargs)

File “/opt/grass/etc/wxpython/wxgui.py”, line 78, in OnInit

workspace = self.workspaceFile)

File “/opt/grass/etc/wxpython/lmgr/frame.py”, line 111, in init

self.toolbars = { ‘workspace’ : LMWorkspaceToolbar(parent = self),

File “/opt/grass/etc/wxpython/lmgr/toolbars.py”, line 40, in init

self.InitToolbar(self._toolbarData())

File “/opt/grass/etc/wxpython/gui_core/toolbars.py”, line 96, in InitToolbar

self.CreateTool(*tool)

File “/opt/grass/etc/wxpython/gui_core/toolbars.py”, line 120, in CreateTool

shortHelp, longHelp)

File “/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py”, line 3764, in AddLabelTool

shortHelp, longHelp, clientData)

File “/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py”, line 3686, in DoAddTool

return controls.ToolBarBase_DoAddTool(*args, **kwargs)

ValueError: invalid null reference in method ‘ToolBarBase_DoAddTool’, expected argument 4 of type ‘wxBitmap const &’

I am assuming both the errors in 13.2 and now in 13.1 are due to installation issues. Grass 6.4 worked well in 13.1 until I upgraded. Can anyone help?

Thanks

Tim

Tim Southern
17, Park Close,
Sonning Common,
Oxfordshire
RG4 9RY

On 25 Nov 2014, at 20:00, grass-user-request@lists.osgeo.org wrote:

Send grass-user mailing list submissions to
grass-user@lists.osgeo.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.osgeo.org/mailman/listinfo/grass-user
or, via email, send a message with subject or body ‘help’ to
grass-user-request@lists.osgeo.org

You can reach the person managing the list at
grass-user-owner@lists.osgeo.org

When replying, please edit your Subject line so it is more specific
than “Re: Contents of grass-user digest…”

Today’s Topics:

  1. Re: Computing major and minor axes for polygons (Benjamin Ducke)
  2. Re: Computing major and minor axes for polygons (S?ren Gebbert)
  3. Re: Computing major and minor axes for polygons (Nikos Alexandris)

Message: 1
Date: Mon, 24 Nov 2014 22:50:46 +0100
From: Benjamin Ducke benducke@fastmail.fm
To: grass-user grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID: 5473A836.5030305@fastmail.fm
Content-Type: text/plain; charset=utf-8

Right, a PCA of the polygon vertices, I assume?
Maybe “v.to.db” could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1

  1. Rotate polygon by 10? (v.transform)
  2. Fit region to polygon (g.region vect=).
  3. Get width of region. If it is greater than major axis length,
    set “major axis length = width”
  4. Repeat from 1, until polygon has been rotated 350?
  5. Minor axis length = height of current region.

Like I said, it’s just a crude approximation (precision can
be increased by using smaller rotation steps) and slow, too.
But it’s good enough for my purposes, which is basically to
calculate “elongation=len(major)/len(min)”.

Best,

Ben

On 24/11/14 19:27, S?ren Gebbert wrote:

IIRC is the code to compute the major and minor axes already in GRASS.
You need to perform a Karhunen-Loewe-Transformation for each Polygon.
This is also known as principal components analysis.

Best regards
Soeren

Am 21.11.2014 23:33 schrieb “Benjamin Ducke” <benducke@fastmail.fm
mailto:benducke@fastmail.fm>:

Hi All –

Does anybody here know of an existing GRASS modules that
will compute the major and minor axes for the polygons of
a vector map?

Thanks and best,

Ben


grass-user mailing list
grass-user@lists.osgeo.org mailto:grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Dr. Benjamin Ducke
{} Geospatial Consultant
{
} GIS Developer

Spatial technology for the masses, not the classes:
experience free and open source GIS at http://gvsigce.org


Message: 2
Date: Mon, 24 Nov 2014 23:44:29 +0100
From: S?ren Gebbert soerengebbert@googlemail.com
To: Benjamin Ducke benducke@fastmail.fm
Cc: grass-user grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID:
CAPHDReJy+aLKPEZThfCd+8M935qGiLD1f-yNhrjemZ-s8RUmog@mail.gmail.com
Content-Type: text/plain; charset=UTF-8

Hi Ben,

2014-11-24 22:50 GMT+01:00 Benjamin Ducke benducke@fastmail.fm:

Right, a PCA of the polygon vertices, I assume?

Exactly, create a covariance matrix from the vertices coordinates of
each polygon
and compute the eigenvectors and eigenvalues of these matrices.

Best regards
Soeren

Maybe “v.to.db” could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1

  1. Rotate polygon by 10? (v.transform)
  2. Fit region to polygon (g.region vect=).
  3. Get width of region. If it is greater than major axis length,
    set “major axis length = width”
  4. Repeat from 1, until polygon has been rotated 350?
  5. Minor axis length = height of current region.

Like I said, it’s just a crude approximation (precision can
be increased by using smaller rotation steps) and slow, too.
But it’s good enough for my purposes, which is basically to
calculate “elongation=len(major)/len(min)”.

Best,

Ben

On 24/11/14 19:27, S?ren Gebbert wrote:

IIRC is the code to compute the major and minor axes already in GRASS.
You need to perform a Karhunen-Loewe-Transformation for each Polygon.
This is also known as principal components analysis.

Best regards
Soeren

Am 21.11.2014 23:33 schrieb “Benjamin Ducke” <benducke@fastmail.fm
mailto:benducke@fastmail.fm>:

Hi All –

Does anybody here know of an existing GRASS modules that
will compute the major and minor axes for the polygons of
a vector map?

Thanks and best,

Ben


grass-user mailing list
grass-user@lists.osgeo.org mailto:grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Dr. Benjamin Ducke
{} Geospatial Consultant
{
} GIS Developer

Spatial technology for the masses, not the classes:
experience free and open source GIS at http://gvsigce.org


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Message: 3
Date: Tue, 25 Nov 2014 19:10:38 +0200
From: Nikos Alexandris nik@nikosalexandris.net
To: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID: 5db8e3e250d0adde57c6a9628ba5611f@nikosalexandris.net
Content-Type: text/plain; charset=UTF-8; format=flowed

On 24.11.2014 23:50, Benjamin Ducke wrote:

Right, a PCA of the polygon vertices, I assume?
Maybe “v.to.db” could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1

  1. Rotate polygon by 10? (v.transform)
  2. Fit region to polygon (g.region vect=).
  3. Get width of region. If it is greater than major axis length,
    set “major axis length = width”
  4. Repeat from 1, until polygon has been rotated 350?
  5. Minor axis length = height of current region.

Wow, What a smart approach! :slight_smile:

Nikos



grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

End of grass-user Digest, Vol 103, Issue 42


Hi Tim,

I will have a look at this and report back.

Cheers,
Angelos

On 11/29/2014 03:32 PM, Tim Southern wrote:

Dear all,

A couple of weeks ago I made the mistake of upgrading Opensuse on this 32 Toshiba Laptop to 13.2. Grass failed to work with error messages indicating NumPy had not been installed. It had been installed but did not contain the files Grass was looking for. Attempts at removing and re-installing NumPy all produced the same incomplete file set. (i586 installation)

I have reverted to Opensuse 13.1 and now have another non working version Grass 6.4

Traceback (most recent call
GRASS 6.4.3 (South_Oxfordshire):~ > Traceback (most recent call last):
File "/opt/grass/etc/wxpython/wxgui.py", line 139, in <module>
sys.exit(main())
File "/opt/grass/etc/wxpython/wxgui.py", line 132, in main
app = GMApp(workspaceFile)
File "/opt/grass/etc/wxpython/wxgui.py", line 45, in __init__
wx.App.__init__(self, False)
File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7981, in __init__
self._BootstrapApp()
File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7555, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "/opt/grass/etc/wxpython/wxgui.py", line 78, in OnInit
workspace = self.workspaceFile)
File "/opt/grass/etc/wxpython/lmgr/frame.py", line 111, in __init__
self.toolbars = { 'workspace' : LMWorkspaceToolbar(parent = self),
File "/opt/grass/etc/wxpython/lmgr/toolbars.py", line 40, in __init__
self.InitToolbar(self._toolbarData())
File "/opt/grass/etc/wxpython/gui_core/toolbars.py", line 96, in InitToolbar
self.CreateTool(*tool)
File "/opt/grass/etc/wxpython/gui_core/toolbars.py", line 120, in CreateTool
shortHelp, longHelp)
File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py", line 3764, in AddLabelTool
shortHelp, longHelp, clientData)
File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py", line 3686, in DoAddTool
return _controls_.ToolBarBase_DoAddTool(*args, **kwargs)
ValueError: invalid null reference in method 'ToolBarBase_DoAddTool', expected argument 4 of type 'wxBitmap const &'

I am assuming both the errors in 13.2 and now in 13.1 are due to installation issues. Grass 6.4 worked well in 13.1 until I upgraded. Can anyone help?

Thanks

Tim
Tim Southern
17, Park Close,
Sonning Common,
Oxfordshire
RG4 9RY

On 25 Nov 2014, at 20:00, grass-user-request@lists.osgeo.org wrote:

Send grass-user mailing list submissions to
  grass-user@lists.osgeo.org

To subscribe or unsubscribe via the World Wide Web, visit
  http://lists.osgeo.org/mailman/listinfo/grass-user
or, via email, send a message with subject or body 'help' to
  grass-user-request@lists.osgeo.org

You can reach the person managing the list at
  grass-user-owner@lists.osgeo.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of grass-user digest..."

Today's Topics:

   1. Re: Computing major and minor axes for polygons (Benjamin Ducke)
   2. Re: Computing major and minor axes for polygons (S?ren Gebbert)
   3. Re: Computing major and minor axes for polygons (Nikos Alexandris)

----------------------------------------------------------------------

Message: 1
Date: Mon, 24 Nov 2014 22:50:46 +0100
From: Benjamin Ducke <benducke@fastmail.fm>
To: grass-user <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID: <5473A836.5030305@fastmail.fm>
Content-Type: text/plain; charset=utf-8

Right, a PCA of the polygon vertices, I assume?
Maybe "v.to.db" could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1
1. Rotate polygon by 10? (v.transform)
2. Fit region to polygon (g.region vect=).
3. Get width of region. If it is greater than major axis length,
   set "major axis length = width"
4. Repeat from 1, until polygon has been rotated 350?
5. Minor axis length = height of current region.

Like I said, it's just a crude approximation (precision can
be increased by using smaller rotation steps) and slow, too.
But it's good enough for my purposes, which is basically to
calculate "elongation=len(major)/len(min)".

Best,

Ben

On 24/11/14 19:27, S?ren Gebbert wrote:

IIRC is the code to compute the major and minor axes already in GRASS.
You need to perform a Karhunen-Loewe-Transformation for each Polygon.
This is also known as principal components analysis.

Best regards
Soeren

Am 21.11.2014 23:33 schrieb "Benjamin Ducke" <benducke@fastmail.fm
<mailto:benducke@fastmail.fm>>:

    Hi All --

    Does anybody here know of an existing GRASS modules that
    will compute the major and minor axes for the polygons of
    a vector map?

    Thanks and best,

    Ben
    _______________________________________________
    grass-user mailing list
    grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/grass-user

--
Dr. Benjamin Ducke
{*} Geospatial Consultant
{*} GIS Developer

Spatial technology for the masses, not the classes:
experience free and open source GIS at http://gvsigce.org

------------------------------

Message: 2
Date: Mon, 24 Nov 2014 23:44:29 +0100
From: S?ren Gebbert <soerengebbert@googlemail.com>
To: Benjamin Ducke <benducke@fastmail.fm>
Cc: grass-user <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID:
  <CAPHDReJy+aLKPEZThfCd+8M935qGiLD1f-yNhrjemZ-s8RUmog@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi Ben,

2014-11-24 22:50 GMT+01:00 Benjamin Ducke <benducke@fastmail.fm>:

Right, a PCA of the polygon vertices, I assume?

Exactly, create a covariance matrix from the vertices coordinates of
each polygon
and compute the eigenvectors and eigenvalues of these matrices.

Best regards
Soeren

Maybe "v.to.db" could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1
1. Rotate polygon by 10? (v.transform)
2. Fit region to polygon (g.region vect=).
3. Get width of region. If it is greater than major axis length,
   set "major axis length = width"
4. Repeat from 1, until polygon has been rotated 350?
5. Minor axis length = height of current region.

Like I said, it's just a crude approximation (precision can
be increased by using smaller rotation steps) and slow, too.
But it's good enough for my purposes, which is basically to
calculate "elongation=len(major)/len(min)".

Best,

Ben

On 24/11/14 19:27, S?ren Gebbert wrote:

IIRC is the code to compute the major and minor axes already in GRASS.
You need to perform a Karhunen-Loewe-Transformation for each Polygon.
This is also known as principal components analysis.

Best regards
Soeren

Am 21.11.2014 23:33 schrieb "Benjamin Ducke" <benducke@fastmail.fm
<mailto:benducke@fastmail.fm>>:

    Hi All --

    Does anybody here know of an existing GRASS modules that
    will compute the major and minor axes for the polygons of
    a vector map?

    Thanks and best,

    Ben
    _______________________________________________
    grass-user mailing list
    grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/grass-user

--
Dr. Benjamin Ducke
{*} Geospatial Consultant
{*} GIS Developer

Spatial technology for the masses, not the classes:
experience free and open source GIS at http://gvsigce.org
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

------------------------------

Message: 3
Date: Tue, 25 Nov 2014 19:10:38 +0200
From: Nikos Alexandris <nik@nikosalexandris.net>
To: <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID: <5db8e3e250d0adde57c6a9628ba5611f@nikosalexandris.net>
Content-Type: text/plain; charset=UTF-8; format=flowed

On 24.11.2014 23:50, Benjamin Ducke wrote:

Right, a PCA of the polygon vertices, I assume?
Maybe "v.to.db" could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1
1. Rotate polygon by 10? (v.transform)
2. Fit region to polygon (g.region vect=).
3. Get width of region. If it is greater than major axis length,
   set "major axis length = width"
4. Repeat from 1, until polygon has been rotated 350?
5. Minor axis length = height of current region.

Wow, What a smart approach! :slight_smile:

Nikos

------------------------------

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

End of grass-user Digest, Vol 103, Issue 42
*******************************************

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
Angelos Tzotsos
Remote Sensing Laboratory
National Technical University of Athens
http://users.ntua.gr/tzotsos

Problem fixed on both openSUSE 13.1 and 13.2
Can you please confirm?

On 11/30/2014 01:43 AM, Angelos Tzotsos wrote:

Hi Tim,

I will have a look at this and report back.

Cheers,
Angelos

On 11/29/2014 03:32 PM, Tim Southern wrote:

Dear all,

A couple of weeks ago I made the mistake of upgrading Opensuse on this 32 Toshiba Laptop to 13.2. Grass failed to work with error messages indicating NumPy had not been installed. It had been installed but did not contain the files Grass was looking for. Attempts at removing and re-installing NumPy all produced the same incomplete file set. (i586 installation)

I have reverted to Opensuse 13.1 and now have another non working version Grass 6.4

Traceback (most recent call
GRASS 6.4.3 (South_Oxfordshire):~ > Traceback (most recent call last):
File "/opt/grass/etc/wxpython/wxgui.py", line 139, in <module>
sys.exit(main())
File "/opt/grass/etc/wxpython/wxgui.py", line 132, in main
app = GMApp(workspaceFile)
File "/opt/grass/etc/wxpython/wxgui.py", line 45, in __init__
wx.App.__init__(self, False)
File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7981, in __init__
self._BootstrapApp()
File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7555, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "/opt/grass/etc/wxpython/wxgui.py", line 78, in OnInit
workspace = self.workspaceFile)
File "/opt/grass/etc/wxpython/lmgr/frame.py", line 111, in __init__
self.toolbars = { 'workspace' : LMWorkspaceToolbar(parent = self),
File "/opt/grass/etc/wxpython/lmgr/toolbars.py", line 40, in __init__
self.InitToolbar(self._toolbarData())
File "/opt/grass/etc/wxpython/gui_core/toolbars.py", line 96, in InitToolbar
self.CreateTool(*tool)
File "/opt/grass/etc/wxpython/gui_core/toolbars.py", line 120, in CreateTool
shortHelp, longHelp)
File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py", line 3764, in AddLabelTool
shortHelp, longHelp, clientData)
File "/usr/lib/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py", line 3686, in DoAddTool
return _controls_.ToolBarBase_DoAddTool(*args, **kwargs)
ValueError: invalid null reference in method 'ToolBarBase_DoAddTool', expected argument 4 of type 'wxBitmap const &'

I am assuming both the errors in 13.2 and now in 13.1 are due to installation issues. Grass 6.4 worked well in 13.1 until I upgraded. Can anyone help?

Thanks

Tim
Tim Southern
17, Park Close,
Sonning Common,
Oxfordshire
RG4 9RY

On 25 Nov 2014, at 20:00, grass-user-request@lists.osgeo.org wrote:

Send grass-user mailing list submissions to
    grass-user@lists.osgeo.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.osgeo.org/mailman/listinfo/grass-user
or, via email, send a message with subject or body 'help' to
    grass-user-request@lists.osgeo.org

You can reach the person managing the list at
    grass-user-owner@lists.osgeo.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of grass-user digest..."

Today's Topics:

   1. Re: Computing major and minor axes for polygons (Benjamin Ducke)
   2. Re: Computing major and minor axes for polygons (S?ren Gebbert)
   3. Re: Computing major and minor axes for polygons (Nikos Alexandris)

----------------------------------------------------------------------

Message: 1
Date: Mon, 24 Nov 2014 22:50:46 +0100
From: Benjamin Ducke <benducke@fastmail.fm>
To: grass-user <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID: <5473A836.5030305@fastmail.fm>
Content-Type: text/plain; charset=utf-8

Right, a PCA of the polygon vertices, I assume?
Maybe "v.to.db" could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1
1. Rotate polygon by 10? (v.transform)
2. Fit region to polygon (g.region vect=).
3. Get width of region. If it is greater than major axis length,
   set "major axis length = width"
4. Repeat from 1, until polygon has been rotated 350?
5. Minor axis length = height of current region.

Like I said, it's just a crude approximation (precision can
be increased by using smaller rotation steps) and slow, too.
But it's good enough for my purposes, which is basically to
calculate "elongation=len(major)/len(min)".

Best,

Ben

On 24/11/14 19:27, S?ren Gebbert wrote:

IIRC is the code to compute the major and minor axes already in GRASS.
You need to perform a Karhunen-Loewe-Transformation for each Polygon.
This is also known as principal components analysis.

Best regards
Soeren

Am 21.11.2014 23:33 schrieb "Benjamin Ducke" <benducke@fastmail.fm
<mailto:benducke@fastmail.fm>>:

    Hi All --

    Does anybody here know of an existing GRASS modules that
    will compute the major and minor axes for the polygons of
    a vector map?

    Thanks and best,

    Ben
    _______________________________________________
    grass-user mailing list
    grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/grass-user

--
Dr. Benjamin Ducke
{*} Geospatial Consultant
{*} GIS Developer

Spatial technology for the masses, not the classes:
experience free and open source GIS at http://gvsigce.org

------------------------------

Message: 2
Date: Mon, 24 Nov 2014 23:44:29 +0100
From: S?ren Gebbert <soerengebbert@googlemail.com>
To: Benjamin Ducke <benducke@fastmail.fm>
Cc: grass-user <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID:
    <CAPHDReJy+aLKPEZThfCd+8M935qGiLD1f-yNhrjemZ-s8RUmog@mail.gmail.com>

Content-Type: text/plain; charset=UTF-8

Hi Ben,

2014-11-24 22:50 GMT+01:00 Benjamin Ducke <benducke@fastmail.fm>:

Right, a PCA of the polygon vertices, I assume?

Exactly, create a covariance matrix from the vertices coordinates of
each polygon
and compute the eigenvectors and eigenvalues of these matrices.

Best regards
Soeren

Maybe "v.to.db" could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1
1. Rotate polygon by 10? (v.transform)
2. Fit region to polygon (g.region vect=).
3. Get width of region. If it is greater than major axis length,
   set "major axis length = width"
4. Repeat from 1, until polygon has been rotated 350?
5. Minor axis length = height of current region.

Like I said, it's just a crude approximation (precision can
be increased by using smaller rotation steps) and slow, too.
But it's good enough for my purposes, which is basically to
calculate "elongation=len(major)/len(min)".

Best,

Ben

On 24/11/14 19:27, S?ren Gebbert wrote:

IIRC is the code to compute the major and minor axes already in GRASS.
You need to perform a Karhunen-Loewe-Transformation for each Polygon.
This is also known as principal components analysis.

Best regards
Soeren

Am 21.11.2014 23:33 schrieb "Benjamin Ducke" <benducke@fastmail.fm
<mailto:benducke@fastmail.fm>>:

    Hi All --

    Does anybody here know of an existing GRASS modules that
    will compute the major and minor axes for the polygons of
    a vector map?

    Thanks and best,

    Ben
    _______________________________________________
    grass-user mailing list
    grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/grass-user

--
Dr. Benjamin Ducke
{*} Geospatial Consultant
{*} GIS Developer

Spatial technology for the masses, not the classes:
experience free and open source GIS at http://gvsigce.org
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

------------------------------

Message: 3
Date: Tue, 25 Nov 2014 19:10:38 +0200
From: Nikos Alexandris <nik@nikosalexandris.net>
To: <grass-user@lists.osgeo.org>
Subject: Re: [GRASS-user] Computing major and minor axes for polygons
Message-ID: <5db8e3e250d0adde57c6a9628ba5611f@nikosalexandris.net>
Content-Type: text/plain; charset=UTF-8; format=flowed

On 24.11.2014 23:50, Benjamin Ducke wrote:

Right, a PCA of the polygon vertices, I assume?
Maybe "v.to.db" could be enhanced to allow it to upload
the lengths of the first two/three components to the
attribute table?

For a quick fix, I solved the problem in a shell script using
a crude approximation. FWIW:
0. Set major axis length=-1
1. Rotate polygon by 10? (v.transform)
2. Fit region to polygon (g.region vect=).
3. Get width of region. If it is greater than major axis length,
   set "major axis length = width"
4. Repeat from 1, until polygon has been rotated 350?
5. Minor axis length = height of current region.

Wow, What a smart approach! :slight_smile:

Nikos

------------------------------

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

End of grass-user Digest, Vol 103, Issue 42
*******************************************

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
Angelos Tzotsos
Remote Sensing Laboratory
National Technical University of Athens
http://users.ntua.gr/tzotsos