[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jts-dev] Remove line from within another line
|
Martin,
> This seems like surprising behaviour.
Boundary vs interior?
> Do you have an example showing this?
Here is an example (image attached):
public static void Dissolve()
{
int _numDecPlaces = 2;
try
{
double scale = Math.pow(10, _numDecPlaces);
PrecisionModel pm = new PrecisionModel(scale);
WKTReader wktr = new WKTReader();
Geometry line1 = wktr.read("LINESTRING (548845.37 3956342.94, 548840.24 3956243.07, 548861.63 3956241.98, 548881.28 3956242.9, 548900.36 3956247.66, 548918.14 3956256.06, 548933.94 3956267.77, 548947.13 3956282.36, 548957.22 3956299.24, 548963.81 3956317.77, 548966.65 3956337.23, 548965.62 3956356.87, 548960.77 3956375.93, 548952.28 3956393.67, 548940.48 3956409.4, 548925.83 3956422.53, 548825.48 3956496.01,548766.41 3956415.33, 548866.75 3956341.84, 548845.37 3956342.94)");
Geometry line2 = wktr.read("LINESTRING (548845.371 3956342.942, 548866.753 3956341.844, 548766.411 3956415.332)");
line1 = GeometryPrecisionReducer.reduce(line1,pm);
line2 = GeometryPrecisionReducer.reduce(line2,pm);
Geometry rLine = line1.difference(line2);
WKTWriter wktw = new WKTWriter(2);
String rLineWkt = wktw.write(rLine);
System.out.println(rLineWkt);
} catch (Exception e) {
}
}
regards
Simon
--
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
Attachment:
2018-10-11_7-47-22.png
Description: PNG image