Comments (4)
- yes, showing
save
functionality is appropriate and I like the idea of saving to other formats in the challenge section - You can save on OSX, Linux. We need
pyshp
for IO with shape files andfiona
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 later - I think it is save to query a subset, this way we don't run out of memory and is generally a good pattern to show case. Additionally, the sample teaches how to specify queries.
from arcgis-python-api.
There are multiple ways to export feature data to shp or fgdb:
- Item.export() - by owner or admin
- extract_data()
- FeatureLayer.query() -> FeatureSet ->(optonally) SpatialDataFrame - >shp (no fgdb yet). These can be saved to shapefiles but need arcpy or pyshp. PyShp doesn't currently support projections though.
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()
from arcgis-python-api.
appreciate the feedback @rohitgeo @AtmaMani ! Should I change this lab to just get a dataframe per Rohit's snippet?
from arcgis-python-api.
Yes, let's do that. We can then write the SpatialDataFrame to disk using the to_featureclass() method.
from arcgis-python-api.
Related Issues (20)
- to_featureset() is not handling fields with null date values correctly HOT 9
- Extract_Changes failing to return proper edit arrays HOT 3
- Feature Layer query() using return_all_records does not return all records HOT 5
- Esri job failed when using content.add() HOT 2
- ArcGIS API for Python StoryMaps v 2.3.0 Issues on StoryMap Publishing ("get" & "node" deprecation and content_list alternative) HOT 12
- _register_extension() method attached to incorrect Class - Service, not ServiceManager HOT 2
- FeatureSet to_geojson misformats MultiPolygons HOT 5
- Exception: Enter only compatible datasets from Labeled_Tiles, MultiLabeled_Tiles HOT 3
- requests > 2.31 breaks this packages connections to GIS(), causes maximum recursion HOT 7
- Feature Service Cloning renames Feature Service URL unnecessarily
- Bug running "Constructing drive time based service areas" python notebook as written HOT 1
- update function for webmap doesn't work (but no error is given) HOT 5
- create_view method does not work on hosted feature layers if layer ids are not in sequential order. HOT 3
- item.usage() returns None when using a custom date range longer than 6 months HOT 1
- How to determine successful authentication? HOT 6
- Specify type in item_properties HOT 2
- User' object has no attribute 'availableCredits' HOT 2
- Error while trying to run Tensorflow backend in FeatureClassifier HOT 1
- clone_items() failing when item it pointing to a specific layer in feature service HOT 7
- ArcGis HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arcgis-python-api.