Skip to content

how to get Alighnment value for all buildings #411

Answered by martinfleis
cdkang asked this question in Q&A
Discussion options

You must be logged in to vote

Hello! Since you have created Queen weights based on buildings, the resulting weights matrix will be composed mostly of islands. With Queen contiguity, two buildings are considered neighbours if they share at least one vertex (point). You will need to find another way of defining spatial weights matrix to get a proper result of Alignment.

One option is to create tessellation (see the docs) and use the Queen weights matrix derived from that but it may be tricky for such a large number of buildings. Other option is to create KNN or DistanceBand weights instead of Queen. Then you don't need to do the higher order.

W = libpysal.weights.KNN.from_dataframe(df=buildings, ids=buildings['uID'], k=10

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by martinfleis
Comment options

You must be logged in to vote
1 reply
@jGaboardi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants