Giter VIP home page Giter VIP logo

Comments (4)

AtmaMani avatar AtmaMani commented on August 28, 2024 1

@mpayson

  1. yes, showing save functionality is appropriate and I like the idea of saving to other formats in the challenge section
  2. You can save on OSX, Linux. We need pyshp 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 later
  3. 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.

rohitgeo avatar rohitgeo commented on August 28, 2024

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.

mpayson avatar mpayson commented on August 28, 2024

appreciate the feedback @rohitgeo @AtmaMani ! Should I change this lab to just get a dataframe per Rohit's snippet?

from arcgis-python-api.

rohitgeo avatar rohitgeo commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.