[R-sig-Geo] rgeos: gOverlaps not working properly?
zbynek.janoska at centrum.cz
zbynek.janoska at centrum.cz
Mon Oct 15 14:20:06 CEST 2012
Hello,
I have following problem with gOverlaps function:
I have two lines, A and B.
line A has 57 vertexes, all identical with vertexes of line B
yet, gOverlaps(A,B) gives FALSE
the code follows...
> CooA # coordinates of line A
[,1] [,2]
[1,] -506157.4 -1122381
[2,] -506046.4 -1122297
[3,] -506021.4 -1122279
[4,] -505984.9 -1122253
[5,] -505953.7 -1122230
[6,] -505910.2 -1122200
[7,] -505883.4 -1122182
[8,] -505840.1 -1122152
[9,] -505800.2 -1122126
[10,] -505771.7 -1122107
[11,] -505735.4 -1122084
[12,] -505701.9 -1122062
[13,] -505651.2 -1122031
[14,] -505614.7 -1122009
[15,] -505545.8 -1121969
[16,] -505484.8 -1121934
[17,] -505430.2 -1121904
[18,] -505328.7 -1121850
[19,] -505275.9 -1121821
[20,] -505239.0 -1121803
[21,] -505194.5 -1121782
[22,] -505155.1 -1121763
[23,] -505111.1 -1121741
[24,] -505042.7 -1121710
[25,] -504996.2 -1121690
[26,] -504932.4 -1121662
[27,] -504898.4 -1121648
[28,] -504869.2 -1121636
[29,] -504825.2 -1121618
[30,] -504787.7 -1121603
[31,] -504719.1 -1121577
[32,] -504695.1 -1121568
[33,] -504616.5 -1121539
[34,] -504558.2 -1121519
[35,] -504523.9 -1121508
[36,] -504448.2 -1121482
[37,] -504299.8 -1121434
[38,] -504220.0 -1121409
[39,] -504128.7 -1121380
[40,] -503978.4 -1121333
[41,] -503909.8 -1121311
[42,] -503865.9 -1121297
[43,] -503774.8 -1121267
[44,] -503671.5 -1121231
[45,] -503524.9 -1121177
[46,] -503413.4 -1121133
[47,] -503314.5 -1121092
[48,] -503240.0 -1121059
[49,] -503162.6 -1121023
[50,] -503113.6 -1120999
[51,] -503045.5 -1120966
[52,] -502922.0 -1120903
[53,] -502782.1 -1120826
[54,] -502649.1 -1120748
[55,] -502509.2 -1120661
[56,] -502390.5 -1120584
[57,] -502364.9 -1120567
> CooB # coordinates of line B
[,1] [,2]
[1,] -506157.4 -1122381
[2,] -506046.4 -1122297
[3,] -506021.4 -1122279
[4,] -505984.9 -1122253
[5,] -505953.7 -1122230
[6,] -505910.2 -1122200
[7,] -505883.4 -1122182
[8,] -505840.1 -1122152
[9,] -505800.2 -1122126
[10,] -505771.7 -1122107
[11,] -505735.4 -1122084
[12,] -505701.9 -1122062
[13,] -505651.2 -1122031
[14,] -505614.7 -1122009
[15,] -505545.8 -1121969
[16,] -505484.8 -1121934
[17,] -505430.2 -1121904
[18,] -505328.7 -1121850
[19,] -505275.9 -1121821
[20,] -505239.0 -1121803
[21,] -505194.5 -1121782
[22,] -505155.1 -1121763
[23,] -505111.1 -1121741
[24,] -505042.7 -1121710
[25,] -504996.2 -1121690
[26,] -504932.4 -1121662
[27,] -504898.4 -1121648
[28,] -504869.2 -1121636
[29,] -504825.2 -1121618
[30,] -504787.7 -1121603
[31,] -504719.1 -1121577
[32,] -504695.1 -1121568
[33,] -504616.5 -1121539
[34,] -504558.2 -1121519
[35,] -504523.9 -1121508
[36,] -504448.2 -1121482
[37,] -504299.8 -1121434
[38,] -504220.0 -1121409
[39,] -504128.7 -1121380
[40,] -503978.4 -1121333
[41,] -503909.8 -1121311
[42,] -503865.9 -1121297
[43,] -503774.8 -1121267
[44,] -503671.5 -1121231
[45,] -503524.9 -1121177
[46,] -503413.4 -1121133
[47,] -503314.5 -1121092
[48,] -503240.0 -1121059
[49,] -503162.6 -1121023
[50,] -503113.6 -1120999
[51,] -503045.5 -1120966
[52,] -502922.0 -1120903
[53,] -502782.1 -1120826
[54,] -502649.1 -1120748
[55,] -502509.2 -1120661
[56,] -502390.5 -1120584
[57,] -502364.9 -1120567
[58,] -502271.7 -1120505
[59,] -502251.2 -1120492
nrow(CooA)*ncol(CooA) # number of values in CooA
length(which(CooA %in% CooB)) # all values of CooA are also in CooB (and
ordering is the same)
A <- SpatialLines(list(Lines(list(Line(CooA)),ID=1)))
B <- SpatialLines(list(Lines(list(Line(CooB)),ID=2)))
gOverlaps(A,B) # gives FALSE
I can not see the reason why this returns FALSE (or does it on your
computer?)
Even if I specify the coordinate system, returned value is still FALSE.
Any help would be appreciated,
Thanks
Zbynek
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/rgeos-gOverlaps-not-working-properly-tp7581278.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list