|
202 | 202 | },
|
203 | 203 | {
|
204 | 204 | "cell_type": "code",
|
205 |
| - "execution_count": 16, |
| 205 | + "execution_count": null, |
206 | 206 | "metadata": {},
|
207 |
| - "outputs": [ |
208 |
| - { |
209 |
| - "data": { |
210 |
| - "application/vnd.jupyter.widget-view+json": { |
211 |
| - "model_id": "1a51d8d0698e41cc8204a3e1f93fc55c", |
212 |
| - "version_major": 2, |
213 |
| - "version_minor": 1 |
214 |
| - }, |
215 |
| - "text/plain": [ |
216 |
| - "Map(center=[4035818.471878221, -13162788.84377388], extent={'xmin': -13195962.052030275, 'ymin': 3995849.73900…" |
217 |
| - ] |
218 |
| - }, |
219 |
| - "execution_count": 16, |
220 |
| - "metadata": {}, |
221 |
| - "output_type": "execute_result" |
222 |
| - } |
223 |
| - ], |
| 207 | + "outputs": [], |
224 | 208 | "source": [
|
225 | 209 | "# create a map of our area of interest\n",
|
226 |
| - "m = gis.map('Los Angeles', 9)\n", |
| 210 | + "m = gis.map('Los Angeles')\n", |
227 | 211 | "m"
|
228 | 212 | ]
|
229 | 213 | },
|
|
239 | 223 | ""
|
240 | 224 | ]
|
241 | 225 | },
|
| 226 | + { |
| 227 | + "cell_type": "code", |
| 228 | + "execution_count": null, |
| 229 | + "metadata": {}, |
| 230 | + "outputs": [], |
| 231 | + "source": [ |
| 232 | + "m.zoom = 9" |
| 233 | + ] |
| 234 | + }, |
242 | 235 | {
|
243 | 236 | "cell_type": "code",
|
244 | 237 | "execution_count": 17,
|
|
278 | 271 | "outputs": [],
|
279 | 272 | "source": [
|
280 | 273 | "# create a map of our area of interest\n",
|
281 |
| - "m1 = gis.map('Los Angeles', 9)\n", |
| 274 | + "m1 = gis.map('Los Angeles')\n", |
282 | 275 | "m1"
|
283 | 276 | ]
|
284 | 277 | },
|
|
294 | 287 | ""
|
295 | 288 | ]
|
296 | 289 | },
|
| 290 | + { |
| 291 | + "cell_type": "code", |
| 292 | + "execution_count": null, |
| 293 | + "metadata": {}, |
| 294 | + "outputs": [], |
| 295 | + "source": [ |
| 296 | + "m1.zoom = 9" |
| 297 | + ] |
| 298 | + }, |
297 | 299 | {
|
298 | 300 | "cell_type": "code",
|
299 | 301 | "execution_count": 21,
|
|
439 | 441 | "cell_type": "code",
|
440 | 442 | "execution_count": null,
|
441 | 443 | "metadata": {},
|
442 |
| - "outputs": [{ |
| 444 | + "outputs": [ |
| 445 | + { |
443 | 446 | "data": {
|
444 | 447 | "text/html": [
|
445 | 448 | "<div>\n",
|
|
727 | 730 | "execution_count": 17,
|
728 | 731 | "metadata": {},
|
729 | 732 | "output_type": "execute_result"
|
730 |
| - }], |
| 733 | + } |
| 734 | + ], |
731 | 735 | "source": [
|
732 | 736 | "at_risk_facilities = riskinfra.layers[0]\n",
|
733 | 737 | "df = at_risk_facilities.query(as_df=True) # read the returned features as a Pandas dataframe\n",
|
|
745 | 749 | "cell_type": "code",
|
746 | 750 | "execution_count": null,
|
747 | 751 | "metadata": {},
|
748 |
| - "outputs": [{ |
| 752 | + "outputs": [ |
| 753 | + { |
749 | 754 | "data": {
|
750 | 755 | "text/html": [
|
751 | 756 | "<div>\n",
|
|
841 | 846 | "execution_count": 18,
|
842 | 847 | "metadata": {},
|
843 | 848 | "output_type": "execute_result"
|
844 |
| - }], |
| 849 | + } |
| 850 | + ], |
845 | 851 | "source": [
|
846 | 852 | "# view simplified risk facilities table\n",
|
847 | 853 | "df1_simplified = df[['name', 'cat1', 'post_id']]\n",
|
|
875 | 881 | "outputs": [],
|
876 | 882 | "source": [
|
877 | 883 | "# create new map over aoi\n",
|
878 |
| - "m2 = gis.map('Los Angeles', 9)\n", |
| 884 | + "m2 = gis.map('Los Angeles')\n", |
879 | 885 | "m2"
|
880 | 886 | ]
|
881 | 887 | },
|
|
891 | 897 | ""
|
892 | 898 | ]
|
893 | 899 | },
|
| 900 | + { |
| 901 | + "cell_type": "code", |
| 902 | + "execution_count": null, |
| 903 | + "metadata": {}, |
| 904 | + "outputs": [], |
| 905 | + "source": [ |
| 906 | + "m2.zoom = 9" |
| 907 | + ] |
| 908 | + }, |
894 | 909 | {
|
895 | 910 | "cell_type": "code",
|
896 | 911 | "execution_count": null,
|
|
988 | 1003 | "source": [
|
989 | 1004 | "# read the operational layers in our webmap\n",
|
990 | 1005 | "for lyr in webmap.content.layers:\n",
|
991 |
| - " if webmap.content.layers[0].properties['name'].startswith('At_Risk_Infrastructure'):\n", |
| 1006 | + " if lyr.properties['name'].startswith('At_Risk_Infrastructure'):\n", |
992 | 1007 | " print(lyr.url)"
|
993 | 1008 | ]
|
994 | 1009 | },
|
|
1019 | 1034 | "# update the url of the 'At Risk Infrastructure' layer in the web map\n",
|
1020 | 1035 | "\n",
|
1021 | 1036 | "for lyr in webmap.content.layers:\n",
|
1022 |
| - " if webmap.content.layers[0].properties['name'].startswith('At_Risk_Infrastructure'):\n", |
| 1037 | + " if lyr.properties['name'].startswith('At_Risk_Infrastructure'):\n", |
1023 | 1038 | " lyr.url = new_url"
|
1024 | 1039 | ]
|
1025 | 1040 | },
|
|
1046 | 1061 | "metadata": {},
|
1047 | 1062 | "outputs": [],
|
1048 | 1063 | "source": [
|
1049 |
| - "m3 = gis.map('Los Angeles', 9)\n", |
| 1064 | + "m3 = gis.map('Los Angeles')\n", |
1050 | 1065 | "m3"
|
1051 | 1066 | ]
|
1052 | 1067 | },
|
|
1062 | 1077 | ""
|
1063 | 1078 | ]
|
1064 | 1079 | },
|
| 1080 | + { |
| 1081 | + "cell_type": "code", |
| 1082 | + "execution_count": null, |
| 1083 | + "metadata": {}, |
| 1084 | + "outputs": [], |
| 1085 | + "source": [ |
| 1086 | + "m3.zoom = 9" |
| 1087 | + ] |
| 1088 | + }, |
1065 | 1089 | {
|
1066 | 1090 | "cell_type": "code",
|
1067 | 1091 | "execution_count": 9,
|
|
1150 | 1174 | "name": "python",
|
1151 | 1175 | "nbconvert_exporter": "python",
|
1152 | 1176 | "pygments_lexer": "ipython3",
|
1153 |
| - "version": "3.11.0" |
| 1177 | + "version": "3.11.10" |
1154 | 1178 | },
|
1155 | 1179 | "toc": {
|
1156 | 1180 | "base_numbering": 1,
|
|
0 commit comments