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

sam_feature_history[-1][0] error #19

Open
4del-Yousefi opened this issue Sep 4, 2023 · 15 comments
Open

sam_feature_history[-1][0] error #19

4del-Yousefi opened this issue Sep 4, 2023 · 15 comments
Labels
bug Something isn't working needs detail Further information is requested

Comments

@4del-Yousefi
Copy link

image

using version 1.2.1 I am loading features folder and trying to work on it but this errors shows up.

@Fanchengyan
Copy link
Collaborator

Could you please provide a detailed description of the scenario in which this issue is triggered? Does it occur when finishing a labeling session and labeling after loading new features?

@Fanchengyan Fanchengyan added bug Something isn't working needs detail Further information is requested labels Sep 5, 2023
@4del-Yousefi
Copy link
Author

I launch QGIS and open the Geo SAM tool. The demo image appears and works fine in both hover and selection modes. However, when I attempt to work with the features folder, the tool becomes buggy. Based on my observations, I suspect that the issue is related to the shapefile, or something related to it. I also tried loading a previously worked-on shapefile, but it didn’t work either.

I think it's better to add a create new shapefile button maybe the automate system that creates shapefiles gets bugged I am not sure.

I will try to record a video and share it with you.

"C:\Users/ASUS/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Geo SAM\tools\widgetTool.py", line 609, in save_shp_file if self.sam_feature_history[-1][0] IndexError: list index out of rang

@Fanchengyan
Copy link
Collaborator

Fanchengyan commented Sep 7, 2023

Thank you for your feedback. I look forward to your video. The previous testing primarily focused on labeling. We will conduct new tests specifically for loading new shapefiles and features in the future.

@4del-Yousefi
Copy link
Author

Hello here an example of my workflow:

bug.mp4

@Fanchengyan
Copy link
Collaborator

Hi @4del-Yousefi . In the video, it seems like you were using a very early dev version. Could you please conduct the testing on the latest dev version?

@4del-Yousefi
Copy link
Author

I encoded new image then worked on it saved the shapefile then reloaded the feature folder and shape file. Thats when its stop working
The issue happens when we reload the feature folder and shape file.

I tried with almost all versions same issue. I will try again to see if one of dev builds work.

@Fanchengyan
Copy link
Collaborator

Can the stable version run properly? It appears the issue may be caused by the inability to convert the projection of the features to the projection of the shapefile. Additionally, could you please help test if the problem occurs when creating a new shapefile by clicking the "From file" button?

@4del-Yousefi
Copy link
Author

Okay an update, creating a new shapefile using "from file" makes a new shp file where the selection hovering and saving works. However, loading a saved shp doesn't.

@4del-Yousefi
Copy link
Author

when i close QGIS it shows this crash i dont know if its related.

image
on latest dev version.

@Fanchengyan
Copy link
Collaborator

Hi @4del-Yousefi. Could you please share the projection details for both the previous and current shapefiles? The projection files have the same name as the shapefile, with the extension ".prj", and can be opened with a text editor. We did not encounter this issue during our testing on our own dataset. Your case can help us further improve the code.

@4del-Yousefi
Copy link
Author

4del-Yousefi commented Sep 9, 2023

prj file with issues:

PROJCS["WGS_1984_UTM_Zone_40N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",57.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

PROJCS["WGS_1984_UTM_Zone_40N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",57.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

newly created prj that works:
1)
PROJCS["WGS_1984_UTM_Zone_40N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",57.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]

I don't think the issue is from that.

@4del-Yousefi
Copy link
Author

When working with shp files that are bugged or previously saved it shows this error on saving (pressing S).
image

While it doesnt show on newly created shp files.

@Fanchengyan
Copy link
Collaborator

According to this log, it seems that the newly added feature IDs (FID) are smaller than the ones previously saved. It appears that QGIS did not add the FIDs in chronological order. In the future, we will try customizing the FIDs in the attribute table instead of relying on QGIS's automatic generation. However, this will take some time. For now, please work with the new shapefile for your remaining work, and merge it after finishing all the work. Besides, if possible, could you share your shapefile with issues so that we can further investigate the cause of the error, debug the code, and resolve the issue.

@4del-Yousefi
Copy link
Author

BuggedShp.zip

I have attached the bugged shapefiles. take a look.

@Fanchengyan
Copy link
Collaborator

Thank you for sharing. We will use this shapefile to determine the source of the issue, but it may take some time to resolve it and publish a new version.

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

No branches or pull requests

2 participants