Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Shapefile to csv/kmz/json failed #63

Closed
zuoqichen opened this issue May 9, 2020 · 7 comments
Closed

Export Shapefile to csv/kmz/json failed #63

zuoqichen opened this issue May 9, 2020 · 7 comments

Comments

@zuoqichen
Copy link

  • geemap version: 0.6.10
  • Python version: 3.7.4
  • Operating System: Win

The 'us-states.shp' was added into geemap, then converted to ee object. But the export is failed, error info is: "Generating URL ...
An error occurred while downloading.
'str' object has no attribute 'select'"

Code:
states_shp = r"/JupyterSpace/Data/geemap-master/examples/data/us-states.shp"
states = geemap.shp_to_ee(states_shp)
Map.addLayer(states,{},"States")
geemap.ee_export_vector(states,filename='/JupyterSpace/Data/states.csv')

@zuoqichen
Copy link
Author

Same error was occurred when using zonal statistic.

@giswqs
Copy link
Member

giswqs commented May 9, 2020

It appears that the recent Earth Engine API update broke the .getDonwloadURL() function. We will have to wait for Google to fix it.

import ee
ee.Initialize()
states = ee.FeatureCollection('TIGER/2018/States')
url = states.getDownloadURL(filetype="csv", selectors=['NAME', 'STATEFP', 'STUSPS'], filename="states")
print(url)

@giswqs
Copy link
Member

giswqs commented May 10, 2020

See this GEE Issue tracker https://issuetracker.google.com/issues/156139602

@zuoqichen
Copy link
Author

See this GEE Issue tracker https://issuetracker.google.com/issues/156139602

Got it. Thanks.

@giswqs
Copy link
Member

giswqs commented May 13, 2020

The GEE team is aware of this issue and a fix is under way.

https://issuetracker.google.com/issues/156139602

@UjjwalGarai
Copy link

Dear Sir,
my zonal stat file is downloaded but I see only two columns, system:index and .geo.
please help me what is the problem. I run your example code
https://github.com/giswqs/geemap/blob/master/examples/notebooks/13_zonal_statistics_by_group.ipynb

giswqs added a commit that referenced this issue Jul 21, 2020
@giswqs
Copy link
Member

giswqs commented Jul 21, 2020

Earth Engine no longer supports downloading featureCollection as shapefile or json using the getDownloadURL() function. Please use geemap.ee_export_vector_to_drive() to export featureCollection to Google Drive if you want to use shp or json format.

See https://issuetracker.google.com/issues/159926579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants