fixing overlapping areas with snap and min_area

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

fixing overlapping areas with snap and min_area

Tyler Smith-2
Hello,

I am trying to import a shapefile that contains polygons. Using v.in.ogr with default settings works, but generates overlapping areas:

```
v.in.ogr input=~/path/to/data/ output=soils_omafra

...

-----------------------------------------------------
139375 input polygons
Total area: 1.87116E+11 (713211 areas)
Overlapping area: 465.913 (142064 areas)
Area without category: 1.0631E+09 (137984 areas)
-----------------------------------------------------
Copying features...

Building topology for vector map <soils_omafra@PERMANENT>...
Registering primitives...
Building areas...
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
WARNING: Area of size = 0.0 ignored
```

After several hours testing different values of snap and min_area, I have come up with the following:

```
v.in.ogr input=~/path/to/data/ output=soils_omafra snap=4.52e-07 min_area=10.0

...

-----------------------------------------------------
138109 input polygons
Total area: 1.87116E+11 (138565 areas)
Overlapping area: 34.3593 (4 areas)
Area without category: 1.0631E+09 (421 areas)
-----------------------------------------------------

[no warnings reported]
```

If I increase snap any more I start creating additional areas, so I don't think I can automatically get rid of the remaining 4 areas.

However, when I plot those areas and look at them, they are below the min_area threshold I've set:

```
d.what.vect map=soils_omafra

...
soils_omafra@PERMANENT:
Type: Area
Sq_Meters: 6.307
Hectares: 0.001
Acres: 0.002
Sq_Miles: 0.0
Layer: 2
Category: 2
...
```

My map is in a lat-long projection, and the map unit is meters. I thought setting min_area=10.0 would drop all areas smaller than 10 sq meters, but my problem areas here are only 6.3 sq meters?

Have I misunderstood what min_area does, or am I setting it incorrectly? I notice that the default is 0.0001, which seems really small if the units is actually meters.

More generally, I'm not sure how critical these overlapping areas are, or when I can safely ignore them. For my current project, I'm going to use the imported polygons to create rasters for analysis in R.

Thank you for your time,

Tyler

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

Re: fixing overlapping areas with snap and min_area

Markus Metz-3


On Tue, May 14, 2019 at 12:26 AM Tyler Smith <[hidden email]> wrote:

>
> Hello,
>
> I am trying to import a shapefile that contains polygons. Using v.in.ogr with default settings works, but generates overlapping areas:
>
> ```
> v.in.ogr input=~/path/to/data/ output=soils_omafra
>
> ...
>
> -----------------------------------------------------
> 139375 input polygons
> Total area: 1.87116E+11 (713211 areas)
> Overlapping area: 465.913 (142064 areas)
> Area without category: 1.0631E+09 (137984 areas)
> -----------------------------------------------------
> Copying features...
>
> Building topology for vector map <soils_omafra@PERMANENT>...
> Registering primitives...
> Building areas...
> WARNING: Area of size = 0.0 ignored
> WARNING: Area of size = 0.0 ignored
> WARNING: Area of size = 0.0 ignored
> ```
>
> After several hours testing different values of snap and min_area, I have come up with the following:
>
> ```
> v.in.ogr input=~/path/to/data/ output=soils_omafra snap=4.52e-07 min_area=10.0
>
> ...
>
> -----------------------------------------------------
> 138109 input polygons
> Total area: 1.87116E+11 (138565 areas)
> Overlapping area: 34.3593 (4 areas)
> Area without category: 1.0631E+09 (421 areas)
> -----------------------------------------------------
>
> [no warnings reported]
> ```
>
> If I increase snap any more I start creating additional areas, so I don't think I can automatically get rid of the remaining 4 areas.
>
> However, when I plot those areas and look at them, they are below the min_area threshold I've set:
>
> ```
> d.what.vect map=soils_omafra
>
> ...
> soils_omafra@PERMANENT:
> Type: Area
> Sq_Meters: 6.307
> Hectares: 0.001
> Acres: 0.002
> Sq_Miles: 0.0
> Layer: 2
> Category: 2
> ...
> ```
>
> My map is in a lat-long projection, and the map unit is meters. I thought setting min_area=10.0 would drop all areas smaller than 10 sq meters, but my problem areas here are only 6.3 sq meters?

Maybe the documentation needs some clarification: the min_area applies to input polygons, not to output areas, i.e. input polygons smaller than min_area are dropped. If you want to get rid off output areas smaller than min_area=10, you need to use v.clean tool=rmarea threshold=10.
>
> Have I misunderstood what min_area does, or am I setting it incorrectly? I notice that the default is 0.0001, which seems really small if the units is actually meters.

The purpose of min_area is to filter out noise in the input.
>
> More generally, I'm not sure how critical these overlapping areas are, or when I can safely ignore them. For my current project, I'm going to use the imported polygons to create rasters for analysis in R.

There is no general answer if these overlapping areas are critical or not, it depends mostly on whether overlapping areas are allowed at all.

Markus M
>
> Thank you for your time,
>
> Tyler
>
> --
> plantarum.ca
> _______________________________________________
> grass-user mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/grass-user

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

Re: fixing overlapping areas with snap and min_area

Tyler Smith-2
Markus Metz writes:

> Maybe the documentation needs some clarification: the min_area applies to
> input polygons, not to output areas, i.e. input polygons smaller than
> min_area are dropped. If you want to get rid off output areas smaller than
> min_area=10, you need to use v.clean tool=rmarea threshold=10.

I see, thank you for the clarification.

> There is no general answer if these overlapping areas are critical or not,
> it depends mostly on whether overlapping areas are allowed at all.

Ok. I'll have to play around with my analysis to see if it causes any
problems.

Best,

Tyler

_______________________________________________
grass-user mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-user