{"id":308,"date":"2011-09-01T14:00:47","date_gmt":"2011-09-01T14:00:47","guid":{"rendered":"http:\/\/www.geoplanit.co.uk\/?page_id=308"},"modified":"2011-09-15T16:22:56","modified_gmt":"2011-09-15T16:22:56","slug":"function-sidewalk-wdith","status":"publish","type":"page","link":"https:\/\/www.geoplanit.co.uk\/?page_id=308","title":{"rendered":"SideWalk Widths"},"content":{"rendered":"<p>Let&#8217;s suppose you have imported a graph\/streetnetwork (from a shapefile) with some attributes that define what type of line it is.<\/p>\n<p>In this example I am using the graph network for water features as well as roads. \u00a0 Obviously not all rivers have sidewalks (pavements in the UK) so I want to set them to zero.<\/p>\n<p>First add your New Map Layer as a function and make sure the map layer is covering your data. \u00a0I change the colour from white to another colour, so I can see how big the function layer is and where it is (you need to look in the Inspector window for this).<\/p>\n<p>Now this is what I have used to set the sidewalkwidths to zero using an imported graphs attributes. Copy and paste then amend this code to your data:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre>sww = getObjectAttr(\"Surface\") \/\/read from your imported graph the appropriate attribute\r\nclass = getObjectAttr(\"Class\")\r\n\/\/the following performs a test that if the attribute is any of the following then the width is zero\r\nattr sidewalkWidthRight =\r\n\tcase sww == \"Unmade\":\r\n\t\t0\r\n\tcase sww == \"water\":\r\n\t\t0\r\n\tcase class == \"Arterial\":\r\n\t\t0\r\n\tcase class == \"CityCoverageBoundary\":\r\n\t\t0\r\n\telse:\r\n\t\t2\r\n\r\nattr sidewalkWidthLeft =\r\n\tcase sww == \"Unmade\":\r\n\t\t0\r\n\tcase sww == \"water\":\r\n\t\t0\r\n\tcase class == \"Arterial\":\r\n\t\t0\r\n\tcase class == \"CityCoverageBoundary\":\r\n\t\t0\r\n\telse:\r\n\t\t2<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s suppose you have imported a graph\/streetnetwork (from a shapefile) with some attributes that define what type of line it is. In this example I am using the graph network for water features as well as roads. \u00a0 Obviously not all rivers have sidewalks (pavements in the UK) so I want to set them to [&hellip;]<\/p>\n","protected":false},"author":161,"featured_media":0,"parent":303,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-308","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/users\/161"}],"replies":[{"embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=308"}],"version-history":[{"count":6,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/308\/revisions"}],"predecessor-version":[{"id":364,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/308\/revisions\/364"}],"up":[{"embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/303"}],"wp:attachment":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}