Skip to content

reading coordinate data #26

Answered by hawklorry
nfraehr asked this question in Q&A
Feb 4, 2022 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Hi @nfraehr , yes. List below is a function I'm using to get the coordinate of all nodes and create a GeoDataFrame. You will need to get all the node with res1d.data.Nodes.

`def get_node_geometry(nodes):
allnodes = [[n.ID, Point(n.XCoordinate, n.YCoordinate)] for n in nodes]
allnode_df = pd.DataFrame(allnodes, columns=['MUID', 'geometry'])
allnode_df.set_index('MUID', inplace = True)

return gpd.GeoDataFrame(allnode_df, geometry = 'geometry')`

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@nfraehr
Comment options

@Prebbish
Comment options

@Prebbish
Comment options

Answer selected by nfraehr
Comment options

You must be logged in to vote
1 reply
@Snowthe
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
4 participants