Skip to content

Commit 185f1ee

Browse files
committed
eugh
1 parent f16e5b4 commit 185f1ee

File tree

3 files changed

+123
-3
lines changed

3 files changed

+123
-3
lines changed

geolearn_env13.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: geolearn13
2+
3+
channels:
4+
- pytorch
5+
- conda-forge
6+
7+
8+
dependencies:
9+
- python=3
10+
- pip
11+
- scikit-image
12+
- scikit-learn=1.3.0
13+
- pytorch
14+
- torchvision
15+
- segmentation-models-pytorch
16+
- jupyter
17+
- matplotlib
18+
- opencv
19+
- gdal
20+
- lightgbm
21+
- git
22+
- pandas
23+
- albumentations
24+
- ipywidgets
25+
- pandas
26+
- shapely
27+
- xgboost
28+
- pysal
29+
- pyshp
30+
- pytables
31+
- mahotas
32+
# - sqlalchemy ?
33+
# - urbanaccess ?
34+
- napari
35+
- scikit-plot
36+
- dask-ml
37+
# - auto-sklearn requires too old sklearn
38+
- ipywidgets
39+
# - nb_conda causing problems on HPC & py3.1
40+
- owslib
41+
- optuna
42+
- plotly
43+
- openpyxl
44+
- skorch
45+
46+
- pip:
47+
- morphsnakes
48+
- xmltodict
49+
- simpledbf
50+
- pyfftw
51+
- phasepack
52+
- SimpleCRF
53+
- git+https://github.com/Ciaran1981/geospatial-learn#egg=geospatial-learn
54+
#py
55+
56+
57+

geolearn_env_nongpu.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: geolearn
2+
3+
channels:
4+
- pytorch
5+
- conda-forge
6+
7+
8+
dependencies:
9+
- python=3
10+
- pip
11+
- scikit-image
12+
- scikit-learn
13+
- pytorch
14+
- torchvision
15+
- segmentation-models-pytorch
16+
- jupyter
17+
- matplotlib
18+
- opencv
19+
- gdal
20+
- lightgbm
21+
- git
22+
- pandas
23+
- albumentations
24+
- ipywidgets
25+
- pandas
26+
- shapely
27+
- xgboost
28+
- pysal
29+
- pyshp
30+
- pytables
31+
- mahotas
32+
# - sqlalchemy ?
33+
# - urbanaccess ?
34+
- napari
35+
- scikit-plot
36+
- dask-ml
37+
# - auto-sklearn requires too old sklearn
38+
- ipywidgets
39+
# - nb_conda causing problems on HPC & py3.1
40+
- owslib
41+
- optuna
42+
- plotly
43+
- openpyxl
44+
- skorch
45+
46+
- pip:
47+
- morphsnakes
48+
- xmltodict
49+
- simpledbf
50+
- pyfftw
51+
- phasepack
52+
- SimpleCRF
53+
- git+https://github.com/Ciaran1981/geospatial-learn#egg=geospatial-learn
54+
#py

geospatial_learn/raster.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ def set_bandnames(inras, names):
17711771
rds = None
17721772

17731773
def rasterize(inShp, inRas, outRas, field=None, fmt="Gtiff",
1774-
dtype=gdal.GDT_Int32):
1774+
dtype=gdal.GDT_Int32, options=None, **kwargs):
17751775

17761776
"""
17771777
Rasterize a polygon to the extent & geo transform of another raster
@@ -1795,6 +1795,10 @@ def rasterize(inShp, inRas, outRas, field=None, fmt="Gtiff",
17951795
gdal dtype for output raster - consider the dtytpe of the field
17961796
you are burning
17971797
1798+
options: list of strings
1799+
gdal options eg ['ALL_TOUCHED=TRUE']
1800+
1801+
17981802
"""
17991803

18001804

@@ -1812,10 +1816,15 @@ def rasterize(inShp, inRas, outRas, field=None, fmt="Gtiff",
18121816

18131817

18141818
if field == None:
1815-
gdal.RasterizeLayer(outDataset, [1], lyr, burn_values=[1])
1819+
gdal.RasterizeLayer(outDataset, [1], lyr, burn_values=[1], options=options,
1820+
**kwargs)
18161821
else:
18171822
print('rasterizing', field)
1818-
gdal.RasterizeLayer(outDataset, [1], lyr, options=["ATTRIBUTE="+field])
1823+
1824+
opts = options+["ATTRIBUTE="+field]
1825+
1826+
gdal.RasterizeLayer(outDataset, [1], lyr, options=opts,
1827+
**kwargs)
18191828

18201829
outDataset.FlushCache()
18211830

0 commit comments

Comments
 (0)