New answers tagged

1

For GIS analysis in R I recommend the sf package. One of the great advantages of this package is that, once you loaded a file into your enviroment with read_sf(), you can manipulate your data using the regular data.frame methods commonly used in R. # read your data into your environment, make sure your data is stored in your working directory meow <- ...


5

As an addition to the solution above (@babel): you can do it also only with the field calculator, without doing the intersection with the processing tools. The expression is something like this one to get the area for the blue ones: area(intersection($geometry,aggregate('orange','collect', $geometry, intersects($geometry, geometry(@parent)))))


3

Use Menu Vector / Geoprocessing tools / Intersection, set the two polygon layers you use (named orange and blue in my case) as input and you get the intersecting area (outlined in red on the screenshot) as a output in a new polygon layer intersection. On this layer, open field calculator to calculate the area using either area ($geometry) or $area.


2

It may be a wrong assumption that WKT and WKB are identical. Computing with floating point numbers is inaccurate. Here is a test made with PostGIS select ST_AsText( ST_GeomFromText( 'POLYGON ((-45.70072144031528 70.79588950876575,-45.70072144031528 -32.671894242015554,202.6781848096847 -32.671894242015554,202.6781848096847 70.79588950876575,-45....


2

One solution is to basically take the difference between the multipoints and the resulting intersection between the multipoints and the polygon, i.e.: multipoints.difference(multipoints.intersection(polygon)) Here is a piece of commented code for understanding: import matplotlib.pyplot as plt from shapely.geometry import Polygon, MultiPoint import geopandas ...


2

I think I figured it out. I just hadn't done a spatial join with SQL until now. I ended up doing the spatial join on a line FC instead of a point FC (but I convert the lines to midpoints in the subquery). --Spatial join between line midpoints and and a polygon FC. --Returns the zone ID from the intersecting polygon. select ba.ba_id, z.zone from ...


2

So to create simple polygons from a complex polygon (self-intersecting), is to use turf.unkink() for Javascript turf.js. The area can also be found using the polygon area equation. Example code below. Firstly, join the end point of the first curve with end of second curve, then join the start point of the second curve with start point of the first point. ...


1

If you have a point layer and a line layer, then you can count the lines near by the points using field calculator: Open the attribute table of point layer Open the field calculator dialog (abacus icon) Enter the following expression aggregate( layer:='line', aggregate:='count', expression:="ATTR",filter:= intersects( buffer(geometry(@parent)...


1

I think the issue is the you buffer the locations while using the EPSG 4326 projection. This doesn't use meters as the unit so the buffer zones might not all be 2km. Here I re-project the data to the WGS 84 / Pseudo-Mercator projection. Depending on where you're points are located there might be a more suitable projection also. locations = [[54.156014, 53....


0

I bumped in to same problem. Then I found https://gis.stackexchange.com/a/243490/173422 and realized with Intersects-filter, there is a requirement of ValueReference (see: https://docs.geoserver.org/stable/en/user/filter/filter_reference.html). Example, the GeoServer I'm working with will return geometry in WFS-response field <geom> and I need to match ...


1

Reproject to a projected coordinate system in meters, for example EPSG:32634. Then the buffer distance will be in meters: import geopandas as gpd import pandas as pd events = pd.DataFrame([ {'id': 1, 'longitude': 54.606402, 'latitude': 18.347709}, {'id': 2, 'longitude': 54.604681, 'latitude': 18.346534}, {'id': 3, '...


Top 50 recent answers are included