Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jts-dev] Remove line from within another line

Martin,

The main problem here is that the smaller line (B) has different precision to the larger line (A).  So precisely speaking they are different geometries, and "removing B from A" actually has no meaning.  Accordingly, there is no function in JTS to "remove B from A".  

Ahh, of course, the old mixed precision problem. <Slap>head</Slap>

What can be done is to snap B to A, or alternatively reduce B's precision to match that of A.  If this is done then Geometry.different() can be used to carry out the desired operation.

I applied GeometryPrecisionReducer.reduce() using a PrecisionModel set to the largest tolerance ie 1 cm, then did a difference and it worked.

Ok, dumb question, what is the purpose of LineDissolver?

--
Regards
Simon
--------------------------------------------------------------------------------------------------------
Spatial Advice & Solutions Architecture
Database Spatial Stored Procedure Designer

Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE FME
Awarded "2011 Oracle Spatial Excellence Award for Education and Research"
A: 39 Cliff View Drive, Allens Rivulet, 7150, Tas, Aust
W: www.spdba.com.au
E: simon@xxxxxxxxxxxx
V: +61 362 396 397
M: +61 418 396 391
GITC Supplier: T1005
Skype: sggreener
Long: 147.20515 (147° 12' 18" E)
Lat: -43.01530 (43° 00' 55" S)
GeoHash: r22em9r98wg
NAC:W80CK 7SWP3

Back to the top