[GRASSLIST:479] measure lenght of vector

Hi all:

First, thanks for the help on Flightgear and GPS. I think I am getting to
understand it, but right now I'm not doing it. I'll let you know if I get
it to work.

Right now, I have a question: how can I measure the lenght of a segment of
a vector? I read the docs, but I just don't get it.

TIA

Gustavo

--

Clave pública GPG para gacp / GPG public key for gacp:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.7 (GNU/Linux)

mQGiBD5c/XARBADRrT8X4B3lH+nRlTZz96Qrg7DBiIIOXvVKcUQZN5Mf1g60a8Sq
14NK6w+nL/CHWwV8Ebl0lS5mQBAkvCk6bEpU0TYVEqkX2x0c0WNwGD2qY3XIegrO
AziTOs+a0ttJnh9pDFSWtb5kg1OZSZ9HzuS67zOWhlMn2O/kmoCs8LFLCwCgxpwD
I2uKF8GdvNWuCT91TR27MkED/A2MPecRNydFJIaAFmAnCOLrzmvjTU0tXDsNoui0
kyVOzodDkPIJN/HNco1eF0uomHNpHHEqFXszk7+B2wQ6r+3xdI9RKBRQcoDO2+5T
5hMJdZZme3GnyzAAHeojevNCm79IyT4Oqt5hTnFjB8iF/islD62UROVqnW1TcMRP
5ZU5A/0ccjpac8VD4doM+Yj/lmf15UfJI7R5JTdh1Rg2HyptxMeUX+vJiacjwUR8
Z1L2vxBqlZfW5PMw6y+ZAc7go39FKSclcI0L6BAyg6SP5l/M9mbncYMSdG/ZDZiW
lcTVGU8usfnmp36gFDP+0AKHIa8by31UOZ6UHyZr3gyfWUpYN7RBR3VzdGF2byBB
bGNpZGVzIENvbmNoZWlybyBQw6lyZXogKGdhY3ApIDxnYWNwQGQta29uc3RydWt0
b3JzLm9yZz6IWQQTEQIAGQUCPlz9cAQLBwMCAxUCAwMWAgECHgECF4AACgkQ68B5
f74Je7XCaQCfSKAhuF9rHRxG5GryI9+6dWTpX2gAoJuMr7TcYFIPQUgwP82A/EqQ
uvLguQENBD5c/XcQBAC7NVeTaQTe1T3Td/aBuX/YytJtveddXeOTmtx/wPbDceSQ
PCFQoQ8KtO8a+WjkVjAJwTDcaDP7xc9NpfEuKy+DttXEa3l0rJUJ46aJo6mkQ7xY
dk1jtD/El2ETZbVhER55LJYnEC7LnNTpbfyl1yh5RXbtP6SGk6hZv1P5rLh6EwAD
BQP/ZdGyA6EI14R91g3/QLJArIa0+lKUlsylQeO2RHJa4wfy2krY98rOjYeAX4Pn
o3K2py3FkVCCgWf4CPHPd7AHrs9ZmaggUNDUSLR6oi1Lol6PfseYGisQv4WPjn5u
AcEn2lO+FROXPJ7KVARJYqOjRTQwE3ZvwBzJJ0R82/QY3MiIRgQYEQIABgUCPlz9
dwAKCRDrwHl/vgl7tbNbAKC05KLNGx5fUiuONE51l4I30lYxmACbBVBpFRcmhRWU
npjTizDAhO9/uNM=
=AuyO
-----END PGP PUBLIC KEY BLOCK-----

On Tuesday 24 June 2003 02:31, # Sets domain part of From: and local addresses in outgoing mail. wrote:

Right now, I have a question: how can I measure the lenght of a segment of
a vector? I read the docs, but I just don't get it.

What do you mean by 'segment', one line, a part of the line (defined by 2 points
or start/end offset) or something else?
Do you want to measure few segments interactively on monitor or
many segments noninteractively?

Radim

On Tue, 24 Jun 2003, Radim Blazek wrote:

[I have a question: how can I measure the lenght of a segment of a
vector?]

What do you mean by 'segment', one line, a part of the line (defined by 2 points
or start/end offset) or something else?
Do you want to measure few segments interactively on monitor or
many segments noninteractively?

Sorry if my wording was vague. By ``segment'' I meant the second, a
fraction of ONE line in a vector map, defined between two points. And
there is only need to measure a few of them, perhaps interactively. I
thought of `cropping' the vector map (a shoreline from GMT) by setting the
region and <vector utility similar to r.resample>, but then how can I measure the
length of that vector?

TIA

--

Clave pública GPG para gacp / GPG public key for gacp:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.7 (GNU/Linux)

mQGiBD5c/XARBADRrT8X4B3lH+nRlTZz96Qrg7DBiIIOXvVKcUQZN5Mf1g60a8Sq
14NK6w+nL/CHWwV8Ebl0lS5mQBAkvCk6bEpU0TYVEqkX2x0c0W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AKC05KLNGx5fUiuONE51l4I30lYxmACbBVBpFRcmhRWU
npjTizDAhO9/uNM=
=AuyO
-----END PGP PUBLIC KEY BLOCK-----

> Do you want to measure few segments interactively on monitor or
> many segments noninteractively?

Sorry if my wording was vague. By ``segment'' I meant the second, a
fraction of ONE line in a vector map, defined between two points. And
there is only need to measure a few of them, perhaps interactively. I
thought of `cropping' the vector map (a shoreline from GMT) by setting
the region and <vector utility similar to r.resample>, but then how
can I measure the length of that vector?

mind the fractal problem, best to compare coastline length as compared
to other areas or as percentage of total length, but all at the same
sample resolution.

see
http://www.iemar.tuwien.ac.at/modul23/Fractals/pages/221rugged.html

A brute force way might be
v.to.sites -a
s.out.ascii
crop as needed, and sum distances between each pair of points
  sqrt(dx*dx + dy*dy)

H.

On Tuesday 24 June 2003 10:18, # Sets domain part of From: and local addresses in outgoing mail. wrote:

On Tue, 24 Jun 2003, Radim Blazek wrote:

[I have a question: how can I measure the lenght of a segment of a
vector?]

> What do you mean by 'segment', one line, a part of the line (defined by 2
> points or start/end offset) or something else?
> Do you want to measure few segments interactively on monitor or
> many segments noninteractively?

Sorry if my wording was vague. By ``segment'' I meant the second, a
fraction of ONE line in a vector map, defined between two points. And
there is only need to measure a few of them, perhaps interactively. I
thought of `cropping' the vector map (a shoreline from GMT) by setting the
region and <vector utility similar to r.resample>, but then how can I
measure the length of that vector?

5.0:
1) v.digit
   Create cutting area for each segment.
In the loop for each segment {
   2) v.extract
      To get the area for one segment
   3) v.cutter
      Cut the segment by area.
   4) v.report
      To get the length.
}

5.1 (devel version):
1) v.digit -n map=pnt
    - create new table with columns cat int, id int, along double
    - digitize points and assign the same id to each pair defining the segment
2) v.distance from=pnt to=coast upload=to_along column=along
    This uploads the distance from the beginning of the line to pnt attribute table.
3) db.select -c sql="select catar, min(along), max(along) from catar_hand_pnt group by catar" \
     | gawk -F '|' '{ printf ("L 1 %d %f %f\n",$1,$2,$3) } ' \
     | v.segment input=coast output=seg
    This creates new vector containing segments.
4) echo "create table seg (cat int, l float)" | db.execute
5) v.db.connect map=seg driver=pg key=cat table=seg
6) v.to.db map=seg option=cat col1=cat
7) v.to.db map=seg option=length col1=l

Oh, its more complicated in 5.1! :slight_smile: OK, but it is less work if you have points already as a vector.
Anyway, digitize 2 points is less work than to digitize area with about 7 points.

Radim

Hello All,
I am having problems with a local data set. Seems as if our county started
off a digitization project sober, and ended it drunk. With this in mind,
does anyone have any advice on an easy way to rubber sheet or rectify a
vector dataset. All areas look good locally, and the center and eastern
portion of the dataset are correct. As the data goes west, (and the beers
started flowing???) the data starts getting pretty consitantly skewed.

Is there an easy way to rectify, or rubber sheet vector data in grass that
I am missing? If not, and recommendations?

Thanks,
Daniel Fuka

Dear GRASS users

Firstly, Thanks Daniel, Alexpanton@btopenworld.com, Gonzalo for your kindly advice to looking for a Free Setallite Image).

I am just downloaded a file named “V1KRNS10__19980601_NDVI__W-Asia” from the “Free Vegetation Products”.
After extract I got files
" 0001_LOG.TXT
0001_NDV.HDF
0001_QL.TIF
0001_RIG.TXT
0001_SM.HDF "
For introduce into GRASS, I used “r.in.gdal” to 0001_QL.TIF, but it said
"PROJ_INFO & PROJ_UNITS file not found for location ‘mylocation’ ";
For “r.in.gdal” to 0001_NDV.HDF file, it said:
"0001_NDV.HDF not recognised as a supported file format.
For command "r.in.hdf " which I got a help typing " man r.in.hdf ",
it said :
“Command not found”

What I should do for import this file into GRASS?

Heartfull Thanks,


Alipu Yasen, Tsukuba Un., Ibaraki Pre., Japan
e-mail: s01k154@shako.sk.tsukuba.ac.jp


On Wed, Jun 25, 2003 at 01:41:29PM +0900, Alip.Yasin wrote:

Dear GRASS users

Firstly, Thanks Daniel, Alexpanton@btopenworld.com, Gonzalo for your kindly
advice to looking for a Free Setallite Image).

I am just downloaded a file named "V1KRNS10__19980601_NDVI__W-Asia" from the
"Free Vegetation Products".
After extract I got files
    " 0001_LOG.TXT
       0001_NDV.HDF
       0001_QL.TIF
       0001_RIG.TXT
       0001_SM.HDF "
For introduce into GRASS, I used "r.in.gdal" to 0001_QL.TIF, but it said
    "PROJ_INFO & PROJ_UNITS file not found for location 'mylocation' ";
For "r.in.gdal" to 0001_NDV.HDF file, it said:
    "0001_NDV.HDF not recognised as a supported file format.

Could you send me the URL to the file? Then I'll try.

For command "r.in.hdf " which I got a help typing " man r.in.hdf ",
it said :
   "Command not found"

Right: the r.in.hdf is not completely updated. r.in.gdal is much better,
in case it doesn't work with above data the GDAL lib might be upgraded.
I could try to help here.

Markus Neteler

On Wed, Jun 25, 2003 at 01:41:29PM +0900, Alip.Yasin wrote:

I am just downloaded a file named "V1KRNS10__19980601_NDVI__W-Asia" from the
"Free Vegetation Products".
After extract I got files
    " 0001_LOG.TXT
       0001_NDV.HDF
       0001_QL.TIF
       0001_RIG.TXT
       0001_SM.HDF "
For introduce into GRASS, I used "r.in.gdal" to 0001_QL.TIF, but it said
    "PROJ_INFO & PROJ_UNITS file not found for location 'mylocation' ";
For "r.in.gdal" to 0001_NDV.HDF file, it said:
    "0001_NDV.HDF not recognised as a supported file format.

It seems your GDAL library compiled without HDF support.
Does `hdf4' format listed in

$ gdal-config --formats

output? If not you should recompile GDAL with HDF support. Build
instructions for GDAL available here:

http://www.remotesensing.org/gdal/gdal_building.html

--
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517