Closed mpayson closed 6 years ago
@mpayson
save
functionality is appropriate and I like the idea of saving to other formats in the challenge sectionpyshp
for IO with shape files and fiona
for fgdb. The fiona part is still under dev, not available in production at 1.3. So you might want to show saving to shape file now and update it to fgdb laterThere are multiple ways to export feature data to shp or fgdb:
I think we should promote the first two approaches for exporting to shp and fgdb as they don't need pyshp or arcpy on the client. The third approach is mainly to get data into a SpatialDataFrame. Saving the spatial dataframe to a file could be a separate lab.
I find getting a dataframe out of a layer the most valuable for analysis.
The simplified code could be:
from arcgis.gis import GIS
from arcgis.features import SpatialDataFrame
gis = GIS(username="<USERNAME>")
items = gis.content.search(query='Griffith', 'Feature Layer')
feature_layer_item = items[0]
feature_layer = feature_layer_item.layers[0]
sdf = SpatialDataFrame.from_layer(layer)
sdf.head()
appreciate the feedback @rohitgeo @AtmaMani ! Should I change this lab to just get a dataframe per Rohit's snippet?
Yes, let's do that. We can then write the SpatialDataFrame to disk using the to_featureclass() method.
Creating a devlab per:
A few questions:
save
function is on afeature_set
? We could then leave it as a challenge to create the dataframe and maybe a simple operation on that dataframe?ArcPy
is required for shape files?Pushing here
Thanks!
@AtmaMani @jyaistMap