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

Allow import of a feature class or table from a file geodatabase for EA builder #181

Open
ColinTalbert opened this issue Aug 6, 2024 · 0 comments

Comments

@ColinTalbert
Copy link
Contributor

ColinTalbert commented Aug 6, 2024

Email [email protected] if you wish to contact the USGS Science Data Management (SDM) team’s application support inbox directly with bugs or feature requests. Otherwise, use the template below.

Is your feature request related to a problem? Please describe.
Now that the ArcGIS version of the tool is no longer supported it would be useful to allow a data from a file geodatabase (.gdb) to be used to populate the entity and attribute and potentially spatial import.

Describe the solution you'd like
The current distribution includes copies of Geopandas and Fiona that can be used to read the required information from a file geodatabase. One issue that would need to be solved is that navigating to a feature class or table in the .gdb structure will need a two step process where you first use a folder browser to navigate to the .gdb folder, and then a custom 'file' picker to select the feature layer or table to import. This would likely require a second custom button "import from file gdb" and a custom widget to handle this process.

Describe alternatives you've considered
None

Additional context

#This is exploratory code showing how this might be accomplished...
import fiona
import geopandas as gpd
import pandas as pd

gdb_path = "SomeFileGeodatabase.gdb"

layers = fiona.listlayers(gdb_path)
# these would be used to populate a second picklist of available layers
print("Layers in the geodatabase:")
for layer in layers:
    print(layer)
    
layer_name = 'selected_layer'
gdf = gpd.read_file(gdb_path, layer=layer_name)
df = pd.DataFrame(gdf.drop(columns='geometry'))
# this df can then go directly into the EA builder
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

1 participant