Number of centroids outside area: difficulty with reprojecting

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Number of centroids outside area: difficulty with reprojecting

RichardCooper
This post was updated on .
Hi,

I'm trying to remove a 'Number of centroids outside area' after re-projecting a file.

I've tried v.clean with various tools. including breaklines/boundaries, break polygons, snap lines/boundaries.

The intial imported shapefile did not display any errors, but the following errors appeared on re-projecting the latter file:

Building topology for vector map <as_bas_shp>...
Registering primitives...
44546 primitives registered
1680359 vertices registered
Building areas...
13602 areas built
2828 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 33748
Number of primitives: 44546
Number of points: 0
Number of lines: 0
Number of boundaries: 30931
Number of centroids: 13615
Number of areas: 13602
Number of isles: 2828
Number of centroids outside area: 13
Number of duplicate centroids: 108
Number of areas without centroid: 108


I can remove the duplicate centroids with v.clean (using bpol) but not the centroids outside area.

What would be the easiest way to remove, or at least to identify (filter for) and manually assess?

I've also tried outputting the errors using the error= command, but no geometries are visible in the latter.

Cheers,
Richard
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

hamish-2
Richard:
> I can remove the duplicate centroids with v.clean (using
> bpol) but not the centroids outside area.
>
> What would be the easiest way to remove, or at least to
> identify (filter for) and manually assess?

perhaps v.extract, to pull only the areas?


Hamish
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

hamish-2
Richard:
> > I can remove the duplicate centroids with v.clean (using
> > bpol) but not the centroids outside area.
> >
> > What would be the easiest way to remove, or at least to
> > identify (filter for) and manually assess?

Hamish:
> perhaps v.extract, to pull only the areas?

(note the reason the centroids are outside an area is that
the area boundaries are broken, in which case..)


H
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

Markus Metz-3
In reply to this post by RichardCooper
On Sun, Apr 14, 2013 at 11:02 AM, RichardC <[hidden email]> wrote:

> Hi,
>
> I'm trying to remove a 'Number of centroids outside area' after
> re-projecting a file.
>
> I've tried v.clean with various tools. including breaklines/boundaries,
> break polygons, snap lines/boundaries.
>
> The intial imported shapefile did not display any errors, but the following
> errors appeared on re-projecting the latter file:
>
> Building topology for vector map <as_bas_shp>...
> Registering primitives...
> 44546 primitives registered
> 1680359 vertices registered
> Building areas...
> 13602 areas built
> 2828 isles built
> Attaching islands...
> Attaching centroids...
> Number of nodes: 33748
> Number of primitives: 44546
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 30931
> Number of centroids: 13615
> Number of areas: 13602
> Number of isles: 2828
> *Number of centroids outside area: 13
> Number of duplicate centroids: 108
> Number of areas without centroid: 108*
>
> I can remove the duplicate centroids with v.clean (using bpol) but not the
> centroids outside area.
>
> What would be the easiest way to remove, or at least to identify (filter
> for) and manually assess?

The reason for these problems is one step earlier. Try to densify the
vector boundaries with v.split, optionally followed by
v.build.polylines before reprojecting it. See [0] for an example of
the effect on reprojection.

Markus M

[0] http://trac.osgeo.org/grass/attachment/ticket/1918/dense_points_effect.png

>
> I've also tried outputting the errors using the error= command, but no
> geometries are visible in the latter.
>
> Cheers,
> Richard
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Number-of-centroids-outside-area-difficulty-with-cleaning-tp5046717.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

Markus Neteler
On Sun, Apr 14, 2013 at 1:06 PM, Markus Metz
<[hidden email]> wrote:
> On Sun, Apr 14, 2013 at 11:02 AM, RichardC <[hidden email]> wrote:
> > I'm trying to remove a 'Number of centroids outside area' after
> > re-projecting a file.
> >
> > I've tried v.clean with various tools. including breaklines/boundaries,
> > break polygons, snap lines/boundaries.
> >
> > The intial imported shapefile did not display any errors, but the following
> > errors appeared on re-projecting the latter file:
...
> The reason for these problems is one step earlier. Try to densify the
> vector boundaries with v.split, optionally followed by
> v.build.polylines before reprojecting it. See [0] for an example of
> the effect on reprojection.
>
> Markus M
>
> [0] http://trac.osgeo.org/grass/attachment/ticket/1918/dense_points_effect.png

This would be a nice addition for:

http://grasswiki.osgeo.org/wiki/Vector_topology_cleaning

markusN
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

RichardCooper
This post was updated on .
In reply to this post by hamish-2
Hi,

> (note the reason the centroids are outside an area is that the area boundaries are broken, in which case..)

I tried with various snap thresholds but no outcome was satisfactory.


> perhaps v.extract, to pull only the areas?
After deleting and re-adding categories (v.category), v.extract (type=area) works partially in that all centroids outside area are gone and the layer is topologically correct, but the number of areas reported  drops from 13602 to 13504.

Perhaps I'll try working with a smaller region of the layer and then re-project, instead of the entire layer, unless there is some other option I could try?

Richard

NOTE: just saw Markus's comment - will try that and report soon.
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

RichardCooper
This post was updated on .
> The reason for these problems is one step earlier. Try to densify the vector boundaries with v.split, optionally followed by v.build.polylines before reprojecting it. See [0] for an example of the effect on reprojection.

I tried v.split and v.build.polyline, but after re-projecting I'm still getting the issue with duplicate centroids and centroids outside area.

I'll try repeating the process but on a smaller region and see how that goes.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

Markus Metz-3
On Sun, Apr 14, 2013 at 3:27 PM, RichardC <[hidden email]> wrote:
>> The reason for these problems is one step earlier. Try to densify the
> vector boundaries with v.split, optionally followed by v.build.polylines
> before reprojecting it. See [0] for an example of the effect on
> reprojection.
>
> I tried v.split and v.build.polyline but after re-projecting I'm still
> getting the issue with duplicate centroids and centroids outside area.

Did you use v.split with the length option and a fairly small value for length?

>
> I'll try repeatiug the process but on a smaller region and see how that
> goes.
>
> Thanks.
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Number-of-centroids-outside-area-difficulty-with-cleaning-tp5046717p5046742.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

RichardCooper
This post was updated on .
I tried with a length of 1000 (which should represent 1000m given the projection is Lambert Azimuthal Equal Area),  and also with a length of 500 as shown below in more detail. The file I'm working with is quite a large shapefile (50MB).

Topology of original imported shapefile (Lambert Azimuthal Equal Area):
Attaching centroids...
Number of nodes: 33748
Number of primitives: 44546
Number of points: 0
Number of lines: 0
Number of boundaries: 30931
Number of centroids: 13615
Number of areas: 13615
Number of isles: 2817


Topology after v.split length=500
Attaching centroids...
Number of nodes: 3274443
Number of primitives: 3285241
Number of points: 0
Number of lines: 0
Number of boundaries: 3271626
Number of centroids: 13615
Number of areas: 1218
Number of isles: 0
Number of incorrect boundaries: 3271358
Number of centroids outside area: 12397

Topology after v.build.polylines
v.build.polylines input=as_bas_shp_vsplit500@PERMANENT output=as_bas_shp_vsplit500_vpoly
Attaching centroids...
Number of nodes: 33748
Number of primitives: 44546
Number of points: 0
Number of lines: 0
Number of boundaries: 30931
Number of centroids: 13615
Number of areas: 13615
Number of isles: 2817

Topology after importing into CRS WGS84 (lat long)
Attaching centroids...
Number of nodes: 33748
Number of primitives: 44546
Number of points: 0
Number of lines: 0
Number of boundaries: 30931
Number of centroids: 13615
Number of areas: 13601
Number of isles: 2828
Number of incorrect boundaries: 26
Number of centroids outside area: 14


If the length=1000 for v.split (then followed by v.build.polylines), then the topology after importing into WGS84:
Attaching centroids...
Number of nodes: 33748
Number of primitives: 44546
Number of points: 0
Number of lines: 0
Number of boundaries: 30931
Number of centroids: 13615
Number of areas: 13602
Number of isles: 2828
Number of centroids outside area: 13
Number of duplicate centroids: 109
Number of areas without centroid: 109
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

Markus Metz-3
On Mon, Apr 15, 2013 at 5:52 AM, RichardC <[hidden email]> wrote:

> I tried with a length of 1000 (which I guess should represent 1000m given the
> projection is Lambert Azimuthal Equal Area) and the with a length of 500 as
> shown below in more detail. The file I'm working with quite a large
> shapefile (50MB).
>
> Topology of original imported shapefile (Lambert Azimuthal Equal Area):
> Attaching centroids...
> Number of nodes: 33748
> Number of primitives: 44546
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 30931
> Number of centroids: 13615
> Number of areas: 13615
> Number of isles: 2817
>
>
> Topology after v.split length=500
> Attaching centroids...
> Number of nodes: 3274443
> Number of primitives: 3285241
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 3271626
> Number of centroids: 13615
> Number of areas: 1218
> Number of isles: 0
> Number of incorrect boundaries: 3271358
> Number of centroids outside area: 12397

Very strange. v.split on the original imported shapefile (not the
reprojected vector) should not produce topological errors. Can you
make the shapefile available for testing or provide a link?

Markus M

>
> Topology after v.build.polylines
> v.build.polylines input=as_bas_shp_vsplit500@PERMANENT
> output=as_bas_shp_vsplit500_vpoly
> Attaching centroids...
> Number of nodes: 33748
> Number of primitives: 44546
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 30931
> Number of centroids: 13615
> Number of areas: 13615
> Number of isles: 2817
>
> Topology after importing into CRS WGS84 (lat long)
> Attaching centroids...
> Number of nodes: 33748
> Number of primitives: 44546
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 30931
> Number of centroids: 13615
> Number of areas: 13601
> Number of isles: 2828
> *Number of incorrect boundaries: 26
> Number of centroids outside area: 14*
>
> If the length=1000 for v.split (then followed by v.build.polylines), then
> the toplogy after importing into WGS84:
> Attaching centroids...
> Number of nodes: 33748
> Number of primitives: 44546
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 30931
> Number of centroids: 13615
> Number of areas: 13602
> Number of isles: 2828
> Number of centroids outside area: 13
> *Number of duplicate centroids: 109
> Number of areas without centroid: 109*
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Number-of-centroids-outside-area-difficulty-with-cleaning-tp5046717p5046819.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

RichardCooper
This post was updated on .
Here's the file link: http://edcftp.cr.usgs.gov/pub/data/gtopo30hydro/as_bas.tar.gz

I'd be very interested in your findings. When I ran v.build outputting an error file, all of the errors seem to be concentrated along a particular latitude. As a work around, I extracted the area of my interest (SEAsia) and was able to reproject with identical and error free feature geometry.
Reply | Threaded
Open this post in threaded view
|

Re: Number of centroids outside area: difficulty with cleaning

Markus Metz-3
On Mon, Apr 15, 2013 at 11:05 AM, RichardC <[hidden email]> wrote:
> Here's the file link:
> http://edcftp.cr.usgs.gov/pub/data/gtopo30hydro/as_bas.tar.gz
> <http://edcftp.cr.usgs.gov/pub/data/gtopo30hydro/as_bas.tar.gz>
>
> I'd be very interested in your findings. When I ran v.build outputting an
> error file, all of the errors seem to be concentrated along a particular
> latitude. As a work around, I extracted the area of my interest (SEAsia) and
> was able to reproject with identical feature geometry.

You need to use GRASS 7 and there v.proj with the -w flag to tell the
proj4 library to not wrap to -180,180. This produces a clean
reprojected vector map for me.

Markus M

>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Number-of-centroids-outside-area-difficulty-with-reprojecting-tp5046717p5046889.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user