Skip to content

Commit bad5b99

Browse files
authored
Merge pull request #1917 from Esri/sedf_guide_updates
Working with SeDF guide update
2 parents 6a0310e + c41df9a commit bad5b99

File tree

1 file changed

+46
-48
lines changed

1 file changed

+46
-48
lines changed

guide/05-working-with-the-spatially-enabled-dataframe/spatially-enabled-dataframe-advanced-topics.ipynb

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@
809809
}
810810
],
811811
"source": [
812-
"m = gis.map(\"San Diego, CA\", 8)\n",
812+
"m = gis.map(\"San Diego, CA\")\n",
813813
"m"
814814
]
815815
},
@@ -820,7 +820,7 @@
820820
"outputs": [],
821821
"source": [
822822
"# draw the camp `point`\n",
823-
"m.draw(camp_pendleton_s_geodefn)"
823+
"m.content.draw(camp_pendleton_s_geodefn)"
824824
]
825825
},
826826
{
@@ -868,7 +868,7 @@
868868
}
869869
],
870870
"source": [
871-
"midx = gis.map(\"United States\", 3)\n",
871+
"midx = gis.map(\"United States\")\n",
872872
"midx"
873873
]
874874
},
@@ -879,7 +879,7 @@
879879
"outputs": [],
880880
"source": [
881881
"midx.center = [39, -98]\n",
882-
"midx.basemap = \"gray-vector\""
882+
"midx.basemap.basemap = 'gray-vector'"
883883
]
884884
},
885885
{
@@ -939,6 +939,7 @@
939939
"source": [
940940
"import time\n",
941941
"from arcgis.geometry import Geometry, Polygon\n",
942+
"from arcgis.map.symbols import SimpleFillSymbolEsriSFS\n",
942943
"\n",
943944
"# define a symbol to visualize the spatial index quadrants\n",
944945
"sym = {\n",
@@ -967,16 +968,13 @@
967968
" miny = child.center[1] - height_factor\n",
968969
" maxx = child.center[0] + width_factor\n",
969970
" maxy = child.center[1] + height_factor\n",
970-
" child_geom = Geometry(\n",
971-
" {\n",
972-
" \"rings\": [\n",
973-
" [[minx, miny], [minx, maxy], [maxx, maxy], [maxx, miny], [minx, miny]]\n",
974-
" ],\n",
975-
" \"spatialReference\": sp_ref,\n",
976-
" }\n",
977-
" )\n",
978-
" # child_extent = Polygon(child_geom)\n",
979-
" midx.draw(shape=child_geom, symbol=sym)\n",
971+
" child_geom = Geometry({\n",
972+
" 'rings':[[[minx,miny], [minx, maxy], [maxx, maxy], [maxx, miny], [minx, miny]]],\n",
973+
" 'spatialReference': sp_ref})\n",
974+
" #child_extent = Polygon(child_geom)\n",
975+
" \n",
976+
" sym = SimpleFillSymbolEsriSFS(**sym)\n",
977+
" midx.content.draw(shape = child_geom, symbol = sym)\n",
980978
" time.sleep(2)"
981979
]
982980
},
@@ -1493,7 +1491,7 @@
14931491
}
14941492
],
14951493
"source": [
1496-
"m1 = gis.map(\"United States\", 3)\n",
1494+
"m1 = gis.map(\"United States\")\n",
14971495
"m1"
14981496
]
14991497
},
@@ -1512,20 +1510,19 @@
15121510
"metadata": {},
15131511
"outputs": [],
15141512
"source": [
1515-
"sym_poly = {\n",
1516-
" \"type\": \"esriSFS\",\n",
1517-
" \"style\": \"esriSFSSolid\",\n",
1518-
" \"color\": [0, 0, 0, 0], # hollow, no fill\n",
1513+
"sym_poly = SimpleFillSymbolEsriSFS(**{\n",
1514+
" \"type\": \"esriSFS\",\n",
1515+
" \"style\": \"esriSFSSolid\",\n",
1516+
" \"color\": [0,0,0,0], # hollow, no fill\n",
15191517
" \"outline\": {\n",
1520-
" \"type\": \"esriSLS\",\n",
1521-
" \"style\": \"esriSLSSolid\",\n",
1522-
" \"color\": [255, 0, 0, 255], # red border\n",
1523-
" \"width\": 3,\n",
1524-
" },\n",
1525-
"}\n",
1518+
" \"type\": \"esriSLS\",\n",
1519+
" \"style\": \"esriSLSSolid\",\n",
1520+
" \"color\": [255,0,0,255], # red border\n",
1521+
" \"width\": 3}\n",
1522+
"})\n",
15261523
"\n",
15271524
"# draw the dataframe extent with AOI\n",
1528-
"m1.draw(shape=df_geoextent_geom, symbol=sym_poly)"
1525+
"m1.content.draw(shape = df_geoextent_geom, symbol = sym_poly)"
15291526
]
15301527
},
15311528
{
@@ -1563,19 +1560,18 @@
15631560
" {\"rings\": area_of_interest_ring, \"spatialReference\": sp_ref}\n",
15641561
")\n",
15651562
"\n",
1566-
"sym_poly_aoi = {\n",
1567-
" \"type\": \"esriSFS\",\n",
1568-
" \"style\": \"esriSFSSolid\",\n",
1569-
" \"color\": [0, 0, 0, 0], # hollow, no fill\n",
1563+
"sym_poly_aoi = SimpleFillSymbolEsriSFS(**{\n",
1564+
" \"type\": \"esriSFS\",\n",
1565+
" \"style\": \"esriSFSSolid\",\n",
1566+
" \"color\": [0,0,0,0], # hollow, no fill\n",
15701567
" \"outline\": {\n",
1571-
" \"type\": \"esriSLS\",\n",
1572-
" \"style\": \"esriSLSSolid\",\n",
1573-
" \"color\": [0, 255, 0, 255], # green border\n",
1574-
" \"width\": 3,\n",
1575-
" },\n",
1576-
"}\n",
1568+
" \"type\": \"esriSLS\",\n",
1569+
" \"style\": \"esriSLSSolid\",\n",
1570+
" \"color\": [0,255,0,255], # green border\n",
1571+
" \"width\": 3}\n",
1572+
"})\n",
15771573
"\n",
1578-
"m1.draw(shape=area_of_interest_geom, symbol=sym_poly_aoi)"
1574+
"m1.content.draw(shape = area_of_interest_geom, symbol = sym_poly_aoi)"
15791575
]
15801576
},
15811577
{
@@ -1864,7 +1860,7 @@
18641860
}
18651861
],
18661862
"source": [
1867-
"m2 = gis.map(\"Los Angeles, CA\", 7)\n",
1863+
"m2 = gis.map(\"Los Angeles, CA\")\n",
18681864
"m2"
18691865
]
18701866
},
@@ -1883,7 +1879,7 @@
18831879
"metadata": {},
18841880
"outputs": [],
18851881
"source": [
1886-
"m2.draw(shape=area_of_interest_geom, symbol=sym_poly_aoi)"
1882+
"m2.content.draw(shape = area_of_interest_geom, symbol = sym_poly_aoi)"
18871883
]
18881884
},
18891885
{
@@ -1892,20 +1888,24 @@
18921888
"metadata": {},
18931889
"outputs": [],
18941890
"source": [
1895-
"pt_sym = {\n",
1891+
"from arcgis.map.symbols import SimpleMarkerSymbolEsriSMS\n",
1892+
"\n",
1893+
"pt_sym = SimpleMarkerSymbolEsriSMS(**{\n",
18961894
" \"type\": \"esriSMS\",\n",
18971895
" \"style\": \"esriSMSDiamond\",\n",
18981896
" \"color\": [255, 140, 0, 255], # yellowish\n",
18991897
" \"size\": 8,\n",
19001898
" \"angle\": 0,\n",
19011899
" \"xoffset\": 0,\n",
19021900
" \"yoffset\": 0,\n",
1903-
" \"outline\": {\"color\": [255, 140, 0, 255], \"width\": 1},\n",
1904-
"}\n",
1905-
"\n",
1901+
" \"outline\": {\n",
1902+
" \"color\": [255,140,0,255],\n",
1903+
" \"width\": 1}\n",
1904+
" })\n",
1905+
" \n",
19061906
"# draw the AOI that intersects\n",
19071907
"for pt_index in index_of_features:\n",
1908-
" m2.draw(shape=df.iloc[pt_index][\"SHAPE\"], symbol=pt_sym)"
1908+
" m2.content.draw(shape = df.iloc[pt_index]['SHAPE'], symbol = pt_sym) "
19091909
]
19101910
},
19111911
{
@@ -4143,7 +4143,7 @@
41434143
}
41444144
],
41454145
"source": [
4146-
"m3 = gis.map(\"Wyoming\", 6)\n",
4146+
"m3 = gis.map(\"Wyoming\")\n",
41474147
"m3"
41484148
]
41494149
},
@@ -4162,11 +4162,9 @@
41624162
"metadata": {},
41634163
"outputs": [],
41644164
"source": [
4165-
"from arcgis.geometry import Geometry\n",
4166-
"\n",
41674165
"# draw the spatial join results on Wyoming state\n",
41684166
"for idx, row in sdf2.iterrows():\n",
4169-
" m3.draw(row[\"SHAPE\"], symbol=pt_sym)"
4167+
" m3.content.draw(row['SHAPE'], symbol=pt_sym)"
41704168
]
41714169
},
41724170
{

0 commit comments

Comments
 (0)