greppo-io / greppo

Build & deploy geospatial applications quick and easy.
https://greppo.io
Apache License 2.0
388 stars 34 forks source link

file not found error #45

Closed shantanuo closed 1 year ago

shantanuo commented 2 years ago

I am able to install greppo package. But getting this error:


# greppo serve app.py --host 172.31.38.540
INFO:     Started server process [10836]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://172.31.38.540:8080 (Press CTRL+C to quit)
INFO:     18.209.195.135:54298 - "GET / HTTP/1.1" 200 OK
INFO:     18.209.195.135:54298 - "GET /css/app.a14da775.css HTTP/1.1" 200 OK
INFO:     18.209.195.135:54297 - "GET /css/chunk-vendors.db50bcea.css HTTP/1.1" 200 OK
INFO:     18.209.195.135:54301 - "GET /js/chunk-vendors.526a29f2.js HTTP/1.1" 200 OK
INFO:     18.209.195.135:54300 - "GET /js/app.7529265e.js HTTP/1.1" 200 OK
ERROR:fiona._env:geospatial_data.geojson: No such file or directory
INFO:     18.209.195.135:54301 - "GET /api HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "fiona/_shim.pyx", line 83, in fiona._shim.gdal_open_vector
  File "fiona/_err.pyx", line 291, in fiona._err.exc_wrap_pointer
fiona._err.CPLE_OpenFailedError: geospatial_data.geojson: No such file or directory
krish-adi commented 2 years ago

Can you check if you have specified the path of the file properly? It is best to pass the absolute path of the file.

shantanuo commented 2 years ago

Tried. Same error. Is there a docker image for this?

krish-adi commented 2 years ago

Here is a Dockerfile: https://github.com/greppo-io/greppo-demo/blob/main/Dockerfile

shantanuo commented 2 years ago

Even docker did not work:

#0 6.641       Failed to get options via gdal-config: [Errno 2] No such file or                                                                              directory: 'gdal-config'
#0 6.641       A GDAL API version must be specified. Provide a path to gdal-conf                                                                             ig using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment va                                                                             riable.

I am using ARM processor. May be that is not compatible with this.

krish-adi commented 2 years ago

The Dockerfile was tested both on a M1 and on an Intel chip. Do you have your code somewhere, that I could debug?

shantanuo commented 2 years ago

I was not using the app.py file from tests folder. I used cd library/tests

then used this command: greppo serve app.py --host 172.31.38.540

and got this error:

fiona.errors.DriverError: tests/data/us-states.geojson: No such file or directory

When I tried this command it worked as expected: greppo serve v30.py --host 172.31.38.540

I appreciate your help.

shantanuo commented 2 years ago

When I moved the app.py file to /greppo/library/ folder it worked as expected. I think it should be made clear in the documentation. But the problem is that I get "KeyError: EE_EMAIL". I am a member of google earth service. But I do not know my EE_EMAIL

shantanuo commented 2 years ago

I managed to solve the credentials problem. But when I used this code... https://docs.greppo.io/mental-model.html

got this error:

TypeError: overlay_layer() takes 1 positional argument but 2 were given
krish-adi commented 2 years ago

Could you provide me a snippet of the code where you use overlay_layer ?

shantanuo commented 2 years ago

I used all the code mentioned on this page...

https://docs.greppo.io/mental-model.html

This code line did not work:

app.overlay_layer(
    data_gdf_1,
    name="Communes",
    description="Communes in Normandy, France",
    style={"fillColor": "#F87979"},
    visible=True,
)

In fact all the samples in quickstart guide having overlay_layer() method has this problem. May be I have not installed the module correctly.

By the way greppo seems to be awesome. I have seen other high level modules, but it looks like highest level module!

krish-adi commented 1 year ago

I'll take a look into this. In the meanwhile, can you use the vector_layer instead?

import geopandas as gpd
from greppo import app

data_gdf = gpd.read_file("./data/communes.geojson")

app.vector_layer(
    data = data_gdf,
    name = "Communes",
    description = "Communes in Normandy, France",
    style = {"fillColor": "#F87979"},
)

They are both the same. But overlay_layer use vector layer internally.

PavlosDem99 commented 1 year ago

I'll take a look into this. In the meanwhile, can you use the vector_layer instead?

import geopandas as gpd
from greppo import app

data_gdf = gpd.read_file("./data/communes.geojson")

app.vector_layer(
    data = data_gdf,
    name = "Communes",
    description = "Communes in Normandy, France",
    style = {"fillColor": "#F87979"},
)

They are both the same. But overlay_layer use vector layer internally.

I had the same problem yesterday. I just try the vector layer module and as well the overlay layer and all are working perfectly !

image

image

.. and for the record, Greppo is amazing ! Amazing work Adithya Krishnan 😎

shantanuo commented 1 year ago

Yes "vector_layer" works as expected. A novice (like me) may think that those 2 are different. Please update the documentation if required.

srizer commented 1 year ago

For what it's worth, I also had this issue and it seems to have been resolved by explicitly setting data=data_gdf as opposed to just having data_gdf.

shantanuo commented 1 year ago

Yes. Setting data=data_gdf explicitly solved the problem. Thanks @srizer Can someone fix the documentation and examples?

krish-adi commented 1 year ago

You could make a PR to the docs repo: https://github.com/greppo-io/greppo-docs