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

Error in if (nrow(output) == 1000) when using DEM_request() #100

Open
Nowosad opened this issue Oct 16, 2024 · 6 comments
Open

Error in if (nrow(output) == 1000) when using DEM_request() #100

Nowosad opened this issue Oct 16, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Nowosad
Copy link
Collaborator

Nowosad commented Oct 16, 2024

library(rgugik)
library(sf)
#> Linking to GEOS 3.12.2, GDAL 3.8.5, PROJ 9.3.1; sf_use_s2() is TRUE
polygon_path = system.file("datasets/search_area.gpkg", package = "rgugik")
polygon = read_sf(polygon_path)
req_df = DEM_request(polygon)
#> Error in if (nrow(output) == 1000) {: argument is of length zero

The issue seems to origin here --

output = tryGet(jsonlite::fromJSON(prepared_URL))

@kadyb are you aware of any changes to the geoportal that could cause this problem?

@kadyb
Copy link
Owner

kadyb commented Oct 16, 2024

Thanks for the information, I haven't looked into this yet. The server returns HTTP Error 400 (Bad Request), so something in the API has changed. ortho_request() doesn't work either.

kadyb added a commit that referenced this issue Oct 16, 2024
@kadyb kadyb added the bug Something isn't working label Oct 16, 2024
@kadyb
Copy link
Owner

kadyb commented Oct 16, 2024

It should work now. Dev version can be installed with:

# install.packages("remotes")
remotes::install_github("kadyb/rgugik")

One more issue is not resolved (but it worked before). In the case of ortho_request() the resolution is returned, which should be floating point (in the database it is a single datatype). However, now the values ​​returned are 0 or 1 (integer). Maybe it is because comma is used and there should be a dot (or vice versa) and the decimal part is simply removed. The same applies to the avgElevErr attribute in DEM_request().

@kadyb
Copy link
Owner

kadyb commented Dec 11, 2024

Referring to my previous comment, this will probably not be fixed. I have reported this several times and each time I get negative response as it doesn't apply to the core of Geoportal. Therefore, these two attributes resolution in ortho_request() and avgElevErr in DEM_request() will be incorrect (although it worked fine for several years).

@kadyb
Copy link
Owner

kadyb commented Jan 6, 2025

It looks like they updated the services again and nothing works again.

kadyb added a commit that referenced this issue Jan 6, 2025
@kadyb
Copy link
Owner

kadyb commented Jan 6, 2025

It should work now. The resolution and avgElevErr attributes were also fixed upstream by GUGiK thankfully.

@Nowosad
Copy link
Collaborator Author

Nowosad commented Jan 6, 2025

Great work, @kadyb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants