Re: [GRASS-user] Not matching categories/line IDs

2018-09-13 Thread Markus Metz
On Thu, Sep 13, 2018 at 10:50 AM Johannes Radinger <
johannesradin...@gmail.com> wrote:
>
> Hi all,
>
> I am a little bit puzzled about the actual number of lines/categories of
a specific vector map (river network). As discussed yesterday, the output
of v.category with the report option provides a column 'count' which is a
feature count. Running v.category option=report on my vector provides me
following:
>
> v.category input=Ebro_river_vector_poly_clean_tmp@Ebro2_alien_spread
option=report
> Layer/table: 1/Ebro_river_vector_poly_clean_tmp
> type   countminmax
> point  0  0  0
> line 804  1   1053
> 
>
> This would indicate that I have 804 line features. However, using the
tool v.info on the same vector I get following different result regarding
the number of lines:
> v.info map=Ebro_river_vector_poly_clean_tmp@Ebro2_alien_spread

>
 ++
>  | Name:Ebro_river_vector_poly_clean_tmp
 |
>  ...
>  |   Number of points:   0   Number of centroids:  0
 |
>  |   Number of lines:799 Number of boundaries: 0
 |
> ...
>
> And even more puzzling, I then added a table to this vector map and the
output of v.db.addtable is:
> v.db.addtable map=Ebro_river_vector_poly_clean_tmp@Ebro2_alien_spread

> Reading features...
> Updating database...
> 803 categories read from vector map (layer 1)
> 803 categories read from vector map don't exist in selection from table
> 803 records updated/inserted (layer 1)

If there are 804 features, 2 features must have the same category value,
resulting in 803 updates to the database
>
> So, is it 804,799 or 803??

The output of v.info and v.category option=report must be identical with
regard to the count of features.
>
> The map I am using is a polyline river network (cat=first) that has gone
trough the tool v.clean with the options:
break,rmdupl,rmline,rmsa,rmdangle. The number of lines and cats before the
cleaning tool is 805 (consistent output among all tools).
>
> So I am wondering what happens during cleaning and how to get a clean map
with a corresponding table that has entries for each cat, and were each cat
represents one line feature (i.e. that the number of cats/line features is
consistent over the multiple tools).
>
> Please let me know if I should share the vector map (and how, which
format).

Ideal would be a stripped down GRASS mapset with only this vector
Ebro_river_vector_poly_clean_tmp. Exporting the vector would change the
geometry representation and it would no longer be possible to reproduce the
problem.

Markus M
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Defect v.edit tool=break with multiple coordinates

2018-09-13 Thread Johannes Radinger
Hi all,

I presumably detected an problem/bug with v.edit and its tool "break". I
wanted to break a line at multiple coordinates. But the result is an
overlay of multiple lines instead of the original line that is broken into
segments. Here a small reproducible example using the NC dataset:

from grass.script import core as grass

# Copy data from PERMANENT mapset
grass.run_command("g.copy",
overwrite=True,
vector="railroads@PERMANENT,railroads")
grass.run_command("v.extract",
overwrite=True,
input="firestations@PERMANENT",
cat="58,66,29,35,31,32",
output="firestations")

# Connectors to find exact break points coords
grass.run_command("v.distance",
overwrite=True,
to="railroads",
from_="firestations",
output="firestations_connectors")
firestations_connectors_coors = grass.read_command("v.to.db",
flags="p",
map="firestations_connectors",
option="end",
separator="comma").splitlines()
firestations_connectors_coors = [[",".join(x.split(",")[1:3])] for x
in firestations_connectors_coors[1:]]

# Break at point coords
grass.run_command("v.edit",
  tool="break",
  map="railroads",
  coords=firestations_connectors_coors,
  threshold=50,
  layer=1,
  cats="1-")


My system:
GRASS version: 7.4.1

GRASS SVN revision: r72807M

Build date: 2018-06-13

Build platform: x86_64-apple-darwin17.6.0

GDAL: 2.0.0

PROJ.4: 5.1.0

GEOS: 3.6.2

SQLite: 3.19.3

Python: 2.7.15

wxPython: 4.0.0

Platform: Darwin-17.7.0-x86_64-i386-64bit

I seems that this issue has already been detected long time ago (see
https://trac.osgeo.org/grass/ticket/2903). I extended the bug ticket with
my experience and details using the new GRASS versions. Interestingly, all
people that reported about this problem were working on MacOS?!

Can anybody else reproduce this problem? Or does someone know a solution?

Cheers,
Johannes
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Not matching categories/line IDs

2018-09-13 Thread Johannes Radinger
Hi all,

I am a little bit puzzled about the actual number of lines/categories of a
specific vector map (river network). As discussed yesterday, the output of
v.category with the report option provides a column 'count' which is a
feature count. Running v.category option=report on my vector provides me
following:

v.category input=Ebro_river_vector_poly_clean_tmp@Ebro2_alien_spread
option=report
Layer/table: 1/Ebro_river_vector_poly_clean_tmp
type   countminmax
point  0  0  0
line 804  1   1053


This would indicate that I have 804 line features. However, using the tool
v.info on the same vector I get following different result regarding the
number of lines:
v.info map=Ebro_river_vector_poly_clean_tmp@Ebro2_alien_spread

 ++
 | Name:Ebro_river_vector_poly_clean_tmp
  |
 ...
 |   Number of points:   0   Number of centroids:  0
  |
 |   Number of lines:799 Number of boundaries: 0
  |
...

And even more puzzling, I then added a table to this vector map and the
output of v.db.addtable is:
v.db.addtable map=Ebro_river_vector_poly_clean_tmp@Ebro2_alien_spread

Reading features...
Updating database...
803 categories read from vector map (layer 1)
803 categories read from vector map don't exist in selection from table
803 records updated/inserted (layer 1)

So, is it 804,799 or 803??

The map I am using is a polyline river network (cat=first) that has gone
trough the tool v.clean with the
options: break,rmdupl,rmline,rmsa,rmdangle. The number of lines and cats
before the cleaning tool is 805 (consistent output among all tools).

So I am wondering what happens during cleaning and how to get a clean map
with a corresponding table that has entries for each cat, and were each cat
represents one line feature (i.e. that the number of cats/line features is
consistent over the multiple tools).

Please let me know if I should share the vector map (and how, which format).

Cheers,
Johannes
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user