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

Scenic quality allowing line vector structures #1245

Closed
dcdenu4 opened this issue Mar 12, 2023 · 4 comments · Fixed by #1266
Closed

Scenic quality allowing line vector structures #1245

dcdenu4 opened this issue Mar 12, 2023 · 4 comments · Fixed by #1266
Assignees
Labels
bug Something isn't working in progress This issue is actively being worked on

Comments

@dcdenu4
Copy link
Member

dcdenu4 commented Mar 12, 2023

@jesssilver mentioned

The scenic quality model - it used to require points for the input called 'Features Impacting Scenic Quality', and the user's guide still indicates that's the case. A person who I'm working with in Alaska input a polyline network and the model seems to have taken it and produced outputs, but I'm trying to replicate their work and getting an error that would lead me to believe that I need to convert to points.

She's right, currently the model does not validate for Point Vector type and will run on a polyline. I reproduced this by creating a polyline in QGIS around the point vector provided in the sample data. The model ran and completed successfully.

Looking at the model, it very much assumes point vector type and doesn't do any fancy line handling that I could see.

@dcdenu4 dcdenu4 added the bug Something isn't working label Mar 12, 2023
@phargogh
Copy link
Member

@dcdenu4 could you attach your polyline vector here? I agree, the model is only intended to run on points, so the fact that the model is somehow extracting points from a polyline is a little bit surprising. I'm curious which points the model is extracting in this case.

@jesssilver
Copy link

jesssilver commented Mar 13, 2023 via email

@dcdenu4
Copy link
Member Author

dcdenu4 commented Mar 16, 2023

@jesssilver shared the data with me, I'll upload here.

I'm curious which points the model is extracting in this case.

Good question. The model is just iterating over those line features and extracting a point from the geometry. I do get a nice list of points, but I'm not sure if it's just returning the first point of the line geometry...

from osgeo import ogr, gdal
structure_path ='NAC_Anthropogenic_12012022l.shp'
vector = gdal.OpenEx(structure_path)
layer = vector.GetLayer(0)
for point in layer:
    geom = point.GetGeometryRef()
    viewpoint = (geom.GetX(), geom.GetY())
    print(viewpoint)
...
(435752.73330000043, 1432924.1162999999)
(469712.45109999925, 1304662.856899999)
(465154.60639999993, 1298408.638699999)
(437119.62209999934, 1407142.2459999993)
(438037.83999999985, 1399165.9740999993)
(463563.5987999998, 1335260.3095999993)
(462564.66080000065, 1327714.1539999992)

viewpoint = (geometry.GetX(), geometry.GetY())

NAC_Anthropogenic_12012022l.zip

@phargogh phargogh added the in progress This issue is actively being worked on label Mar 16, 2023
@phargogh
Copy link
Member

I just cracked the vector open and yes, it looks like GDAL is pulling the coordinates of the first point as its X and Y. Kind of an arbitrary choice if you ask me.

phargogh added a commit to phargogh/invest that referenced this issue Mar 17, 2023
@phargogh phargogh self-assigned this Mar 20, 2023
phargogh added a commit to phargogh/invest that referenced this issue Mar 20, 2023
phargogh added a commit to phargogh/invest that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress This issue is actively being worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants