[R-sig-Geo] "invalid" geometries in shape data

chris english englishchristophera at gmail.com
Thu Feb 9 01:34:09 CET 2017


Michael,

I'll forward to rgis/toposhop/issues some 'flat' triangles (i.e. co-linear)
that come up in my neuro
data. Even Roualt says that TRIANGLE will be in GDAL 2.2 release in May and
has been
wrestling with it since Nov/Dec last.

PostGIS tests first three points of polygon for co-linearity but doesn't
detail precision,
presumably at level provided. stryk seems generally pragmatic in these
things. Even was
miffed in a Dec tweet about triangle having four points (.."and its called
Simple Features),
but coming where it does in the polygon hierarchy, it is going to be
closed.

geophys::TriangleInfo tests for co-linearity using sign of determinant
through the dt function,
though determinant (proper) would likely be quicker for evaluating lots of
them as it is direct call to
.Internal.

I am still trying to wrap my head around RTriangle. I think it must be
sturdy for triangle(s), but in
some sense its goal of mesh propagation upon/within a polygon system is
seemingly time travel
compared to my 'this thing is a triangle, aren't it?" None of the methods
I've seen so far seem to test
for 'no internal boundary', including CGAL. And none of this addresses
'automatic fixing tool' that
you or Delft suggests.

My data, from the wild, seems amenable to a jitter after a test by either
atan2 or determinant to
establish candidates for jittering. determinant seems like it would work
best with sf approach to
st_geometry(sfc) as they are lists and one can discern, following geophys'
approach building out
(adding 1s to a 3rd col of) a 2x4 triangle/polygon matrix to 3x4 and
evaluating on first 3x3 square.

I've said as much as I know to this point, triangles are coming.

Chris

On Wed, Feb 8, 2017 at 1:47 PM, Barry Rowlingson <
b.rowlingson at lancaster.ac.uk> wrote:

> Searching GIS StackExchange for [r] and TopologyException might find you a
> few:
>
> http://gis.stackexchange.com/search?q=%5Br%5D+topologyexception
>
> [answered one of these just today:
> http://gis.stackexchange.com/questions/227569/r-error-
> fortifying-dataframe-from-shapefile]
>
> Barry
>
> On Tue, Feb 7, 2017 at 9:46 PM, Michael Sumner <mdsumner at gmail.com> wrote:
> > Hi,
> >
> > I'm interested in exploring the details of kinds of errors and warnings
> > that are seen from the underlying geometry lib (GEOS) for spatial data in
> > R.
> >
> > I would like to also have a collection of  examples with actual data and
> > reproducible code.
> >
> > (The underlying theory and definitions and source code are all open and
> > available, I'm looking for examples).
> >
> > The kinds of errors I'm talking about come from the GEOS library under
> the
> > hood, and this is more or less the same in the sp/rgdal as well as the
> new
> > sf family.
> >
> > Here's one example, this data set is not valid because of at least one
> > "polygon self intersection", basically the ring winds back on itself:
> >
> > library(maptools)
> > data(wrld_simpl)
> > rgeos::gIsValid(wrld_simpl)
> > [1] FALSE
> > Warning message:
> > In RGEOSUnaryPredFunc(spgeom, byid, "rgeos_isvalid") :
> >   Ring Self-intersection at or near point -95.902496339999999
> > 66.946641920000005
> >
> > I'd appreciate if you could send me similar examples, preferably
> > reproducible with code but links to existing emails and online posts are
> > welcome too. Feel free to construct examples from scratch that reproduce
> a
> > particular warning/error.
> >
> > If you like, you can use the Github Issues mechanism here, or just email
> > them in reply.
> >
> > https://github.com/r-gris/toposhop/issues
> >
> > Cheers, Mike.
> >
> >
> > --
> > Dr. Michael Sumner
> > Software and Database Engineer
> > Australian Antarctic Division
> > 203 Channel Highway
> > Kingston Tasmania 7050 Australia
> >
> >         [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list