I am used to R, and am switching to python for some geo transformations. For one task, I need to group polygons in a geopandas dataframe by intersection. However, I can only find geopandas arguments that can do this between two dataframes. For example, these two polygons in the dataframe: should get the same group ..
I am using this shapefile with polygons containing a variable z. According to the sf package in R, the maximum value of the z-column is 43, according to geopandas in Python the maximum value of the z-column is 7. How on earth is this possible? in R: library(sf) theshapefile <- read_sf("z_mystery.shp") summary(theshapefile$z) Min. 1st Qu. ..
I created gis environment using anaconda propmt and I installed geopandas using : conda install -c conda-forge geopandas I tried to import geopandas as gpd and I get this error Source: Python..
Hello I have a table with several fields, and I would like to make complex filters, like IF S1 = 1 and date = 01/06/21 OR S1 = 2 and date = 07/06/21 I can filter on a field df_mask = (gdf [‘RANGE_DE_S’] == ‘VSR’) positions = np.flatnonzero (df_mask) gdf = gdf.iloc [positions] but as ..
I have GeodataFrames and i want to do, what seems to be an easy step def get_a(f): if f == doctors | f == clinic | f == hospital | f == pharmacy | f == station: a = 5 elif f == bus_stop | f == tram_stop | f == subway_entrance | f == ..
I have a long list of multi polygons in GeoPandas dataframe (Sample below) covering a large area As you can see each Polygon has a value assigned to it Name value geometry A 12 POLYGON ((77.68348564872542 12.99627120468158, 77.68342242070528 12.99622571412862, 77.68330368855688 12.99612312693776, 77.68318850133652 12.99598589207154, 77.68314046359954 12.99589410727104, 77.6831038964277 12.9957752894096, 77.68308734514889 12.99569471232377, 77.68308259730425 12.99561785917489, 77.68307797577933 12.99555254016757, 77.68307739733692 12.9954987148256, ..
I have a GeoDataFrame in which the geometry column consists of polygons. Zones = id geometry 0 A1 POLYGON ((119.82334 28.35047, 119.79008 28.350… 1 A2 POLYGON ((138.79141 26.48802, 141.92247 26.261… 2 A3 POLYGON ((65.42208 48.14785, 65.42208 48.14785… 3 A4 POLYGON ((152.14557 25.88444, 155.50298 26.186… and the geometry column is actually a geometry-type obejct: <class ‘geopandas.geodataframe.GeoDataFrame’> ..
I am fairly new to using geopandas and more generally GIS methods and I am a little confused about how objects are being defined and represented and mostly because some of the solutions I find for solving issues I have demand that the input data be in an other form than the one I manage ..
I have two geo-coordinates points and would like to draw a line between them. from shapely.geometry import LineString line = LineString([ (25.187500,56.579722), (24.400000,61.333333)] ) I also have another shapeFile Polygon, which I read through shp = gpd.read_file(shapeFolder+’Alpha.shp’) I need to find the first intersection point between shp and the line but I’m not sure how ..
I have this issue with dataframes with more than one column of type geometry. My dataframe looks like this: New_zone_short_edges = id vertex_id point1 1 A1 2 POINT (119.79008 28.35047) 3 A1 4 POINT (122.85067 44.85106) 5 A2 1 POINT (138.79141 26.48802) 7 A2 3 POINT (141.73386 44.89716) 13 A3 5 POINT (68.47770 44.07370) 11 ..