apply ( getPointCoords, geom = 'geometry', coord_type = 'y', axis = 1 ) # Let's see what we have now In : points. apply ( getPointCoords, geom = 'geometry', coord_type = 'x', axis = 1 ) # Calculate y coordinates In : points = points. # Calculate x coordinates In : points = points. Where the first one should be a Shapely geometry object and coord_type should be either 'x' or 'y'. It shall have two parameters: geom and coord_type Thus, let’s create our own function called getPointCoords() which will return the x or y coordinate of a given geometry. Unfortunately there is not a ready made function in geopandas to do that. Now, as a second step, we need to calculate the x and y coordinates of those points. Okey, so we have several columns plus the geometry column as attributes. head () Out: id name Aadress X y geometry 0 13376 Aakre Lasteaed-Algkool Valga maakond, Puka vald, Aakre küla, Mõisa te.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |