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

document installation / cli usage? #18

Open
cholmes opened this issue Jul 18, 2023 · 7 comments
Open

document installation / cli usage? #18

cholmes opened this issue Jul 18, 2023 · 7 comments

Comments

@cholmes
Copy link
Contributor

cholmes commented Jul 18, 2023

I attempted to use this, and am not a python expert, and wasn't sure how to install it and run it? Tried a few different things (pip, poetry, flit), and tried doing python stac_geoparquet/stac_geoparquet.py and python stac_geoparquet/cli.py. Both complained about ModuleNotFoundError: No module named 'stac_geoparquet.utils'; 'stac_geoparquet' is not a package

I'm guessing I'm just not installing it right. The CLI looks cool and I'd be psyched to use it, but not sure how.

Feel free to just give me brief instructions here and I'm happy to try and then make PR to the readme.

Thanks!

@m-mohr
Copy link
Contributor

m-mohr commented Jul 18, 2023

pip install stac_geoparquet installs the package., but I think this is primarily a library although there's a cli.py, right?
The CLI seems to be for only a limited part of the code anyway.
You can try my stactools package for the more general stuff, I think.: https://github.com/stactools-packages/geoparquet-items

@TomAugspurger
Copy link
Collaborator

TomAugspurger commented Jul 19, 2023

I'll have to check on the CLI stuff. I haven't had a chance to use https://github.com/stactools-packages/geoparquet-items. I actually didn't realize you were implementing it outside of the stac-geoparquet repo. IMO they'd be best developed together.


As for the usage, I'll put together some examples. Does https://github.com/stac-utils/stac-geoparquet#usage work for you? A full shell session would be something like

# Make a virtual environment
$ python3 -m venv .venv  # assuming you have python, pip, and venv. brew install python3 gives this I think
$ . .venv/bin/activate  # assuming you're using bash
# Install stuff into the virtual environment
$ pip install stac-geoparquet requests
(.venv) $ python
Python 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:26:04) [GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> import stac_geoparquet
>>> item = requests.get("https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ia_m_4209150_sw_15_060_20190828_20191105").json()
>>> df = stac_geoparquet.to_geodataframe([item])
>>> df.to_parquet("naip.parquet")

I can add more examples. Right now I'm working on #11. But I can add other inputs as necessary.

@m-mohr
Copy link
Contributor

m-mohr commented Jul 19, 2023

I'm not sure whether the CLI should be developed here or separate. Keeping this as just a library with separate CLI ensures it's a clean interface and stactools may give it a bit more expsoure. Also, I'm starting to add a bit more to it than just using this library for conversion (although that could also be separate), see https://github.com/stactools-packages/geoparquet-items#command-line-usage

@gadomski
Copy link
Member

gadomski commented Aug 4, 2023

Keeping this as just a library with separate CLI ensures it's a clean interface and stactools may give it a bit more expsoure.

Maybe, but I've been doing the opposite pattern with stac-asset, where cli is an optional extra set of dependencies (e.g. click, https://github.com/stac-utils/stac-asset#installation). The issue w/ depending on stactools is that it's pretty heavy and might have dependencies you don't need.

@scottyhq
Copy link
Contributor

I just ran into this, trying to install via conda-forge pixi search stac-geoparquet but noticed the PRs there haven't been merged for a while https://github.com/conda-forge/stac-geoparquet-feedstock/pulls so it's a few versions behind pypi currently (0.4.1 vs 0.6). @TomAugspurger looks like you have permissions on the feedstock, not sure why the CI's not passing.

@TomAugspurger
Copy link
Collaborator

Taking a look.

@TomAugspurger
Copy link
Collaborator

The 0.6 PR is merged in conda-forge/stac-geoparquet-feedstock#7 now. It should be available through conga-forge soon.

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

5 participants