I need to identify vector lines (like roads, rivers) crossed by a transect and get distance from the beginning of the transect. For the moment I'm using v.profile but it returns only the first item. Is there any way to get all crossed lines ?
Hello Frank,
Could you elaborate on „first item“ as I just digitized a vector map
with three lines and crossed them with a profile and got back three
distances.
Things to check – do all lines have a CAT value in specified layer?
If you have a problem with a specific data set, you can send me it
off-list so I can take a look.
Māris.
otrd., 2022. g. 26. apr., plkst. 21:08 — lietotājs Frank David
(<frank.david@geophom.fr>) rakstīja:
Hello,
I need to identify vector lines (like roads, rivers) crossed by a
transect and get distance from the beginning of the transect. For the
moment I'm using v.profile but it returns only the first item. Is there
any way to get all crossed lines ?
My general approach would be like this:
v.overay to intersect transects and lines
v.to.points use=start to get transect start points
v.distance to get distance from transect start point to point where lines cross
With v.distance you need to try whether it is sufficient to compute distance to the nearest point only or if you need to compute distance to all intersection points within the distance equal to the length of the transect...
If the latter is the case you would need to filter out lines with distances that are not along a transect.
Hope that helps.
v.distance can produce lines, so you could check visually if the approach works as expected.
Just a suggestion.
Cheers
Stefan
-----Original Message-----
From: grass-user <grass-user-bounces@lists.osgeo.org> On Behalf Of Frank David
Sent: tirsdag 26. april 2022 20:01
To: GRASS user list <grass-user@lists.osgeo.org>
Subject: [GRASS-user] multiple
Hello,
I need to identify vector lines (like roads, rivers) crossed by a transect and get distance from the beginning of the transect. For the moment I'm using v.profile but it returns only the first item. Is there any way to get all crossed lines ?
If the lines (road or rivers) makes laces and the transect line cross them several times at different distances, only the first intersection is reported by v.profil. I have only one CAT by vector lines. You can download a data set here > https://we.tl/t-X8GVhWxgW6
The projection is french Lambert93 EPSG 2154. The data comes from IGN (French national geographic board)
and you can try this command :
On my Grass 7.8.3 (on debian) the command does not return all intersection, not even the fisrt one. I don’t know why…
Reagrds,
Frank
Le 27/04/2022 à 07:34, Maris Nartiss a écrit :
Hello Frank,
Could you elaborate on „first item“ as I just digitized a vector map
with three lines and crossed them with a profile and got back three
distances.
Things to check – do all lines have a CAT value in specified layer?
If you have a problem with a specific data set, you can send me it
off-list so I can take a look.
Māris.
otrd., 2022. g. 26. apr., plkst. 21:08 — lietotājs Frank David
([<frank.david@geophom.fr>](mailto:frank.david@geophom.fr)) rakstīja:
Hello,
I need to identify vector lines (like roads, rivers) crossed by a
transect and get distance from the beginning of the transect. For the
moment I'm using v.profile but it returns only the first item. Is there
any way to get all crossed lines ?
Thank for your help,
Frank
_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)
I’m not very used to v.overlay, but it seems to be used with area and not with lines crossing lines, isn’t it ?
Frank
···
Le 27/04/2022 à 09:14, Stefan Blumentrath a écrit :
Hi Frank,
My general approach would be like this:
v.overay to intersect transects and lines
v.to.points use=start to get transect start points
v.distance to get distance from transect start point to point where lines cross
With v.distance you need to try whether it is sufficient to compute distance to the nearest point only or if you need to compute distance to all intersection points within the distance equal to the length of the transect...
If the latter is the case you would need to filter out lines with distances that are not along a transect.
Hope that helps.
v.distance can produce lines, so you could check visually if the approach works as expected.
Just a suggestion.
Cheers
Stefan
-----Original Message-----
From: grass-user [<grass-user-bounces@lists.osgeo.org>](mailto:grass-user-bounces@lists.osgeo.org) On Behalf Of Frank David
Sent: tirsdag 26. april 2022 20:01
To: GRASS user list [<grass-user@lists.osgeo.org>](mailto:grass-user@lists.osgeo.org)
Subject: [GRASS-user] multiple
Hello,
I need to identify vector lines (like roads, rivers) crossed by a transect and get distance from the beginning of the transect. For the moment I'm using v.profile but it returns only the first item. Is there any way to get all crossed lines ?
Thank for your help,
Frank
_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user&data=05%7C01%7CStefan.Blumentrath%40nina.no%7Caf69c18ee50c48d0e93508da27afbd3a%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637865933270370389%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&sdata=nldQo6FwP%2FW2SFmeQdPQCw2GKnR%2B2Dr%2FbyaTrjuteg8%3D&reserved=0](https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user&data=05%7C01%7CStefan.Blumentrath%40nina.no%7Caf69c18ee50c48d0e93508da27afbd3a%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637865933270370389%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&sdata=nldQo6FwP%2FW2SFmeQdPQCw2GKnR%2B2Dr%2FbyaTrjuteg8%3D&reserved=0)
Yes, you are right. To get the intersection point you patch the line maps (v.patch), use v.clean on the patched maps and sve the intersection points (errors option in v.clean). Then you add categories to the generated points with v.category…
That just for correction of my earlier suggestion. Your approach with v.profile seems way more appropriate.
If all your lines have the same cat value, you could create new, induvial cat values with v.category, before you run v.profile (I have not looked at your dataset yet…)?
I’m not very used to v.overlay, but it seems to be used with area and not with lines crossing lines, isn’t it ?
Frank
Le 27/04/2022 à 09:14, Stefan Blumentrath a écrit :
Hi Frank,
My general approach would be like this:
v.overay to intersect transects and lines
v.to.points use=start to get transect start points
v.distance to get distance from transect start point to point where lines cross
With v.distance you need to try whether it is sufficient to compute distance to the nearest point only or if you need to compute distance to all intersection points within the distance equal to the length of the transect...
If the latter is the case you would need to filter out lines with distances that are not along a transect.
Hope that helps.
v.distance can produce lines, so you could check visually if the approach works as expected.
Just a suggestion.
Cheers
Stefan
-----Original Message-----
From: grass-user [<grass-user-bounces@lists.osgeo.org>](mailto:grass-user-bounces@lists.osgeo.org) On Behalf Of Frank David
Sent: tirsdag 26. april 2022 20:01
To: GRASS user list [<grass-user@lists.osgeo.org>](mailto:grass-user@lists.osgeo.org)
Subject: [GRASS-user] multiple
Hello,
I need to identify vector lines (like roads, rivers) crossed by a transect and get distance from the beginning of the transect. For the moment I'm using v.profile but it returns only the first item. Is there any way to get all crossed lines ?
Thanks for your message. I got intersection point with your method. I did not succeed to add cat to the error v.clean with v.category (database connection is missing ?). Anyway, another problem is I cannot copy attribute table v.patch. So I have to do a v.what on my original river lines to get its name and v.to.db to get coordinates. It’s quite a long process, and my data counts numerous lines (river our roads, between 500 upto 2000 lines)… I will try
Another way could be to use v.buffer for transect lines and use this buffer as transect with v.overlay. I keep the attribute table and I can get coordinate with v.to.db. Do you think it is suitable ?
I think v.profile should be the way, but this function is not available yet.
Regards,
Frank
···
Le 27/04/2022 à 23:02, Stefan Blumentrath a écrit :
Hi Frank,
Yes, you are right. To get the intersection point you patch the line maps (v.patch), use v.clean on the patched maps and sve the intersection points (errors option in v.clean). Then you add categories to the generated points with v.category…
That just for correction of my earlier suggestion. Your approach with v.profile seems way more appropriate.
If all your lines have the same cat value, you could create new, induvial cat values with v.category, before you run v.profile (I have not looked at your dataset yet…)?
I’m not very used to v.overlay, but it seems to be used with area and not with lines crossing lines, isn’t it ?
Frank
Le 27/04/2022 à 09:14, Stefan Blumentrath a écrit :
Hi Frank,
My general approach would be like this:
v.overay to intersect transects and lines
v.to.points use=start to get transect start points
v.distance to get distance from transect start point to point where lines cross
With v.distance you need to try whether it is sufficient to compute distance to the nearest point only or if you need to compute distance to all intersection points within the distance equal to the length of the transect...
If the latter is the case you would need to filter out lines with distances that are not along a transect.
Hope that helps.
v.distance can produce lines, so you could check visually if the approach works as expected.
Just a suggestion.
Cheers
Stefan
-----Original Message-----
From: grass-user [<grass-user-bounces@lists.osgeo.org>](mailto:grass-user-bounces@lists.osgeo.org) On Behalf Of Frank David
Sent: tirsdag 26. april 2022 20:01
To: GRASS user list [<grass-user@lists.osgeo.org>](mailto:grass-user@lists.osgeo.org)
Subject: [GRASS-user] multiple
Hello,
I need to identify vector lines (like roads, rivers) crossed by a transect and get distance from the beginning of the transect. For the moment I'm using v.profile but it returns only the first item. Is there any way to get all crossed lines ?
otrd., 2022. g. 26. apr., plkst. 21:08 — lietotājs Frank David
(<frank.david@geophom.fr>) rakstīja:
Hello,
I need to identify vector lines (like roads, rivers) crossed by a
transect and get distance from the beginning of the transect. For the
moment I'm using v.profile but it returns only the first item. Is there
any way to get all crossed lines ?
Hello Frank,
Sorry for being so late. The problem with v.profile is fixed in git
main [1]. It will be released as a part of 8.4.0. In the mean time you
can try to compile GRASS from git yourself to get the fix.
otrd., 2022. g. 26. apr., plkst. 21:08 — lietotājs Frank David
(<frank.david@geophom.fr>) rakstīja:
>
> Hello,
>
> I need to identify vector lines (like roads, rivers) crossed by a
> transect and get distance from the beginning of the transect. For the
> moment I'm using v.profile but it returns only the first item. Is there
> any way to get all crossed lines ?
>
> Thank for your help,
>
> Frank
>
> _______________________________________________
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user