find_down: Find all elements related to an ID

Description Usage Arguments Details Value See Also Examples

View source: R/osmar-finding.R

Description

For a given ID these functions return all IDs of related elements.

Usage

1
2
3
  find_down(object, ids)

  find_up(object, ids)

Arguments

object

An osmar object

ids

A vector of IDs tagged whether they are node, way, or relation

Details

find_down finds all elements downwards the hierarchy:

node -> node
way -> way + node
relation -> relation + way + node

find_up finds all elements upwards the hierarchy:

node -> node + way + relation
way -> way + relation
relation -> relation

Value

A list with the three elements node_ids, way_ids, relation_ids

See Also

Other finding: find, find_nearest_node

Examples

1
2
3
4
5
data("muc", package = "osmar")
  o1 <- find(muc, way(tags(k == "highway" & v == "pedestrian")))

  find_down(muc, way(o1))
  find_up(muc, way(o1))

Example output

Loading required package: XML
Loading required package: RCurl
Loading required package: bitops
Loading required package: geosphere

Attaching package: 'osmar'

The following object is masked from 'package:utils':

    find

$node_ids
  [1] 1119123666  339957782  594679403  594693368  595060409  594823238
  [7]  594679403  594822140  594822144  594822151  594686324  594822154
 [13]  594822156  594822160  939213698  939213653  939213548  594822170
 [19]  939213722  594683853  594822173  939213559  939213591  939213674
 [25]  664011707  594679397  595060409   18959541   21280142 1244326845
 [31]   19105469    1955016   30959079   18929522 1119123629  332790687
 [37] 1562439663   19105466  750096033   19084925   21280135   19105469
 [43]  656252964  656252947 1119123624  418873515 1119123629  339957783
 [49] 1211172389 1211172591 1211172612 1211172300 1211172780 1211172410
 [55] 1211172331 1211172526 1211172447 1211172660 1211172683 1211172346
 [61] 1211172472 1211172848 1211172468 1211172603 1211172374 1211172658
 [67] 1211172524 1211172569 1211172578 1211172501 1211172733  701279555
 [73] 1211172531 1211172758 1211172395 1211172320 1211172460  701279556
 [79] 1211172512 1211172402 1211172354 1211172503 1211172631 1211172434
 [85] 1211172640 1211172535 1211172382 1211172719 1211172546 1211172807
 [91] 1211172517 1211172830 1211172454 1211172357 1211172384 1211172363
 [97] 1211172568 1211172482 1211172712 1211172594 1211172287 1211172305
[103] 1211172506 1211172352 1211172414 1211172615 1211172530 1211172783
[109] 1211172492 1211172601 1211172667 1211172736 1211172722 1211172336
[115] 1211172661 1211172334 1211172827 1211172451 1211172356 1211172566
[121] 1211172481 1211172764 1211172857 1211172710 1211172735 1211172792
[127] 1211172375 1211172302 1211172504 1211172852 1211172413 1211172613
[133] 1211172527 1211172389  594679397  594693370 1119123658 1555586807
[139]  339957785  418873513 1119123658 1555586881  418873521  301008067
[145]  595025836  418873516 1119123655  656252946 1075266562   21474407
[151]   21474406  312391020 1313365822   20259951   18929510   18961430
[157]   21280140 1119123633   18959566  342243836  701009943   18929515
[163] 1119123657  539181087  418873513 1119123619 1119123660  339957726
[169]  418873515   18929522  418873515 1119123666  418873513  595060409
[175]  595050522  418873513 1119123619  418873516  418873520  418873526
[181] 1368309492 1368355881 1368355873 1368355871 1368355857  418873519
[187] 1119123655   19085332 1119123660  539181087   19085232   19085229
[193] 1119123624  418873520  595005506  595005509  699711844  595005512
[199]  595010339  595005515  595006992  663976955  595005519  595005522
[205]  595020267  595020271  595020277  595020282  595020285  939213651
[211]  939213696  664011706  664011707  594679397  595020297  595025836
[217]  595020300  595020303 1368355866  595020307 1119123630  595020310
[223] 1368355848  595020312  595005525  595005528  595005530  595005532
[229]  595005506 1119123657  339957605 1119123618 1119123630  340081204

$way_ids
 [1]  96619179  46506591  47430746   4016226   3810397 142980388  96619174
 [8] 105070991  46515625  96619169  35829389  35829386   3810479  96619175
[15]  35829390  35829384  46517477  35829383  35829387  46515632  96619172
[22]  96619173

$relation_ids
NULL

$node_ids
NULL

$way_ids
 [1]  96619179  46506591  47430746   4016226   3810397 142980388  96619174
 [8] 105070991  46515625  96619169  35829389  35829386   3810479  96619175
[15]  35829390  35829384  46517477  35829383  35829387  46515632  96619172
[22]  96619173

$relation_ids
[1]   34444  375399   38409 1490831   38227   34432   38365

osmar documentation built on May 1, 2019, 7:33 p.m.

Related to find_down in osmar...