UNARY Operations on GDFs

Kom i gang. Det er Gratis
eller tilmeld med din email adresse
UNARY Operations on GDFs af Mind Map: UNARY Operations on GDFs

1. Validity

1.1. not all geometries are valid

1.1.1. The making-valid process seeks to resolve internal topological conflicts to ensure the geometry's boundary is properly defined.

1.1.1.1. The shape, area, and distance are generally preserved, but their accuracy depends entirely on the CRS being appropriate for the geometry's location.

1.2. not all valid geometries are free of flaws

1.2.1. slivers!

2. Filtering

2.1. Pandas heritance

2.1.1. Most what works in pandas works in GeoPandas

2.1.1.1. .iloc[]

2.1.1.1.1. .loc[]

2.1.1.2. .query()

2.1.1.2.1. good for complex condition

2.1.1.3. .isin()

2.1.1.3.1. good for list of filters

2.1.1.4. string filtering

2.1.1.4.1. endswith/startswith

2.1.1.4.2. contains

2.1.1.5. complete data/missing values

2.1.1.5.1. Filter rows where specific column has no missing values

2.1.1.5.2. Filter rows where specific column has missing values

2.1.2. Becareful to turn GDF into DF

2.1.2.1. filtering out geometry

2.1.2.1.1. geometry is another column!

2.1.2.2. requesting one row

2.1.2.2.1. a index list to avoid the problem

2.2. using GDF geometry

2.2.1. geometries have some attributes, they can be used for filtering

2.2.1.1. most of these require projected CRS

2.2.1.1.1. area

2.2.1.1.2. geometry type (geom_type)

2.2.1.1.3. bounding box (bounds)

2.2.1.1.4. centroid

2.2.1.1.5. etc

2.2.2. spatial slicing

2.2.2.1. .cx

3. Combining Geometries

3.1. Union_ALL

3.1.1. all original attributes are lost

3.1.1.1. destructive operation

3.1.1.2. returns a _geometry _

3.2. Dissolve

3.2.1. Used as UNION_ALL

3.2.1.1. returns a GDF

3.2.1.1.1. some attributes are kept from lower level. Not all are useful.

3.2.2. Dissolve can combine hierarchically (one more level)

3.2.3. Dissolve can aggregate (as you do in DF)

3.2.3.1. in GEODF

3.2.4. destructive operation

3.2.4.1. EXPLODE operation will not UNDO it!

4. convex hull

4.1. the need for a minimal encasing polygon

4.1.1. given a set of geometries, the convex hull will be the minimal area that contains all of them.

4.1.2. useful when process of interest is assumed to be enacted within its limits

4.1.3. it is applied row by row

4.1.3.1. in general, you need to dissolve before computing the convex hull

4.1.4. the output returned is a _GeoSeries _ (even from a dissolve())

4.1.4.1. unless the input is a geometry (i.e. from a union_all())

4.2. this function needs projected crs

5. Buffer

5.1. the need for a halo

5.1.1. before buffering

5.1.1.1. after buffering

5.2. returns a GeoSeries