[GRASS-user] v.select error: point array must contain 0 or >1 elements

I have two shapefiles that I imported into GRASS 6.4.5 using v.in.ogr. One is a polygon file of building footprints. The second is a polyline of the pavement edges of urban streets. I am trying to convert this into street area. I used v.clean, v.type (to switch from line to boundaries), and v.centroids. This conversion process gives me street areas but also creates doughnut holes corresponding to the area inside of a city block outlined by the streets. For the most part the doughnut holes contain buildings, so I am trying to use v.select to select the areas that do not contain buildings. I have not been able to get anything besides “overlap” to work. Overlap is not good enough though because many of the buildings have shared nodes with the streets, for example where a driveway runs along one side of a house. I checked and my version of GRASS was compiled with the following GEOS details:
–with-geos=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config

Below is an example of an error that I am getting when I try anything besides overlap:

v.select --overwrite ainput=EdgePav_cent@PERMANENT binput=Bldg@PERMANENT output=Pav_sel operator=contains
WARNING: Vector map <Pav_sel> already exists and will be overwritten
Building spatial index…
Processing features…
ERROR: IllegalArgumentException: point array must contain 0 or >1 elements

A similar question appears to have previously gone unanswered:
grass-development-gis - [GRASS-dev] v.select - ERROR: IllegalArgumentException: point array must contain 0 or >1 elements - msg#00289 - Recent Discussion OSDir.com

grass-development-gis - [GRASS-dev] v.select - ERROR: IllegalArgumentException: point array mus…
hi, I’ve tried v.select of a line vector by an area vector: GEOS-based selection v.select ainput=geav150@rstreamanalysis binput=mgoutlet@rstreamanalysis output=test operator=overlaps

View on osdir.com

Preview by Yahoo

Thanks for any advice you can provide.

-Thayer

On Sat, Jan 17, 2015 at 10:12 PM, Thayer Young <thayeray@yahoo.com> wrote:

I have two shapefiles that I imported into GRASS 6.4.5 using v.in.ogr. One is a polygon file of building footprints. The second is a polyline of the pavement edges of urban streets. I am trying to convert this into street area. I used v.clean, v.type (to switch from line to boundaries), and v.centroids. This conversion process gives me street areas but also creates doughnut holes corresponding to the area inside of a city block outlined by the streets. For the most part the doughnut holes contain buildings, so I am trying to use v.select to select the areas that do not contain buildings. I have not been able to get anything besides "overlap" to work. Overlap is not good enough though because many of the buildings have shared nodes with the streets, for example where a driveway runs along one side of a house. I checked and my version of GRASS was compiled with the following GEOS details:
   --with-geos=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config

Below is an example of an error that I am getting when I try anything besides overlap:

v.select --overwrite ainput=EdgePav_cent@PERMANENT binput=Bldg@PERMANENT output=Pav_sel operator=contains
WARNING: Vector map <Pav_sel> already exists and will be overwritten
Building spatial index...
Processing features...
ERROR: IllegalArgumentException: point array must contain 0 or >1 elements

In the past few days Markus Metz has fixed some topology issues in
GRASS GIS 7 (potentially to be backported while that's a big task).
Do you have any chance to try this in GRASS 7, downloading a version
newer than RC1 (fixes will go into RC2)?

markusN

On Sun, Jan 18, 2015 at 11:23 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Sat, Jan 17, 2015 at 10:12 PM, Thayer Young <thayeray@yahoo.com> wrote:

I have two shapefiles that I imported into GRASS 6.4.5 using v.in.ogr. One is a polygon file of building footprints. The second is a polyline of the pavement edges of urban streets. I am trying to convert this into street area. I used v.clean, v.type (to switch from line to boundaries), and v.centroids. This conversion process gives me street areas but also creates doughnut holes corresponding to the area inside of a city block outlined by the streets. For the most part the doughnut holes contain buildings, so I am trying to use v.select to select the areas that do not contain buildings. I have not been able to get anything besides "overlap" to work. Overlap is not good enough though because many of the buildings have shared nodes with the streets, for example where a driveway runs along one side of a house. I checked and my version of GRASS was compiled with the following GEOS details:
   --with-geos=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config

Below is an example of an error that I am getting when I try anything besides overlap:

v.select --overwrite ainput=EdgePav_cent@PERMANENT binput=Bldg@PERMANENT output=Pav_sel operator=contains
WARNING: Vector map <Pav_sel> already exists and will be overwritten
Building spatial index...
Processing features...
ERROR: IllegalArgumentException: point array must contain 0 or >1 elements

In the past few days Markus Metz has fixed some topology issues in
GRASS GIS 7 (potentially to be backported while that's a big task).
Do you have any chance to try this in GRASS 7, downloading a version
newer than RC1 (fixes will go into RC2)?

This seems to be a GEOS problem, not a GRASS problem, because
operator=overlap seems to work, and this the GRASS-internal operator.
All other operators (anything besides overlap) use GEOS, if those do
not work, it is a GEOS problem or the way GEOS is used by v.select.

Markus M

There is no reason for me not to use 7, I will give it a try. I thought 6 might be more stable so I started with that.

-Thayer


From: Markus Neteler neteler@osgeo.org
To: Thayer Young thayeray@yahoo.com
Cc: GRASS LIST grass-user@lists.osgeo.org
Sent: Sunday, January 18, 2015 5:23 PM
Subject: Re: [GRASS-user] v.select error: point array must contain 0 or >1 elements

On Sat, Jan 17, 2015 at 10:12 PM, Thayer Young <thayeray@yahoo.com> wrote:

I have two shapefiles that I imported into GRASS 6.4.5 using v.in.ogr. One is a polygon file of building footprints. The second is a polyline of the pavement edges of urban streets. I am trying to convert this into street area. I used v.clean, v.type (to switch from line to boundaries), and v.centroids. This conversion process gives me street areas but also creates doughnut holes corresponding to the area inside of a city block outlined by the streets. For the most part the doughnut holes contain buildings, so I am trying to use v.select to select the areas that do not contain buildings. I have not been able to get anything besides “overlap” to work. Overlap is not good enough though because many of the buildings have shared nodes with the streets, for example where a driveway runs along one side of a house. I checked and my version of GRASS was compiled with the following GEOS details:
–with-geos=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config

Below is an example of an error that I am getting when I try anything besides overlap:

v.select --overwrite ainput=EdgePav_cent@PERMANENT binput=Bldg@PERMANENT output=Pav_sel operator=contains
WARNING: Vector map <Pav_sel> already exists and will be overwritten
Building spatial index…
Processing features…
ERROR: IllegalArgumentException: point array must contain 0 or >1 elements

In the past few days Markus Metz has fixed some topology issues in
GRASS GIS 7 (potentially to be backported while that’s a big task).
Do you have any chance to try this in GRASS 7, downloading a version
newer than RC1 (fixes will go into RC2)?

markusN

Thank you for this response. I have looked into GEOS, it appears to be a C/C++ version of the Java Topology Suite, and there does not seem to be much documentation for GEOS, but I have found the Java Docs for JTS.

Is it correct to say that GEOS does not have a command line interface? It seems like it may be easiest to try this in UDig and see if JTS works, as I can tell you that I have not been successful in doing what I want to do with GEOS in either QGIS or GRASS.

-Thayer


From: Markus Metz markus.metz.giswork@gmail.com
To: Markus Neteler neteler@osgeo.org
Cc: Thayer Young thayeray@yahoo.com; GRASS LIST grass-user@lists.osgeo.org
Sent: Sunday, January 18, 2015 5:36 PM
Subject: Re: [GRASS-user] v.select error: point array must contain 0 or >1 elements

On Sun, Jan 18, 2015 at 11:23 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Sat, Jan 17, 2015 at 10:12 PM, Thayer Young <thayeray@yahoo.com> wrote:

I have two shapefiles that I imported into GRASS 6.4.5 using v.in.ogr. One is a polygon file of building footprints. The second is a polyline of the pavement edges of urban streets. I am trying to convert this into street area. I used v.clean, v.type (to switch from line to boundaries), and v.centroids. This conversion process gives me street areas but also creates doughnut holes corresponding to the area inside of a city block outlined by the streets. For the most part the doughnut holes contain buildings, so I am trying to use v.select to select the areas that do not contain buildings. I have not been able to get anything besides “overlap” to work. Overlap is not good enough though because many of the buildings have shared nodes with the streets, for example where a driveway runs along one side of a house. I checked and my version of GRASS was compiled with the following GEOS details:
–with-geos=/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config

Below is an example of an error that I am getting when I try anything besides overlap:

v.select --overwrite ainput=EdgePav_cent@PERMANENT binput=Bldg@PERMANENT output=Pav_sel operator=contains
WARNING: Vector map <Pav_sel> already exists and will be overwritten
Building spatial index…
Processing features…
ERROR: IllegalArgumentException: point array must contain 0 or >1 elements

In the past few days Markus Metz has fixed some topology issues in
GRASS GIS 7 (potentially to be backported while that’s a big task).
Do you have any chance to try this in GRASS 7, downloading a version
newer than RC1 (fixes will go into RC2)?

This seems to be a GEOS problem, not a GRASS problem, because
operator=overlap seems to work, and this the GRASS-internal operator.
All other operators (anything besides overlap) use GEOS, if those do
not work, it is a GEOS problem or the way GEOS is used by v.select.

Markus M