-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve intensity normalization by stretching 3*stddev around the median
- Loading branch information
Showing
10 changed files
with
131 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__='0.2.4' | ||
__version__='0.3.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
from .logs import logger | ||
|
||
import pyproj | ||
from shapely.geometry import shape, Polygon, LineString | ||
from shapely.ops import transform | ||
import pdal | ||
|
||
import json | ||
import math | ||
|
||
def make_pipeline(args): | ||
ept = pdal.Reader.ept(filename=args.ept, polygon = args.geometry.wkt, requests=16) | ||
withheld = pdal.Filter.expression(expression="Withheld != 1") | ||
no_noise = pdal.Filter.expression(expression = "!(Classification == 12 || Classification ==7)") | ||
gdal = pdal.Writer.gdal(filename='dsm.tif', bounds = str(list(args.geometry.bounds)), | ||
data_type = "float32", | ||
dimension = "Z", | ||
output_type="idw", | ||
window_size=3, | ||
resolution = 0.5) | ||
args.pipeline = ept | withheld | no_noise | gdal | ||
|
||
def reproject_geojson(args): | ||
geojson_srs = pyproj.CRS("EPSG:4326") | ||
ept_srs = pyproj.CRS("EPSG:3857") | ||
|
||
geojson = args.geojson.open().read() | ||
geojson = json.loads(geojson) | ||
if 'features' in geojson: | ||
geometry = geojson['features'][0]['geometry'] | ||
else: | ||
geometry = geojson['geometry'] | ||
geojson = shape(geometry) | ||
|
||
forward = pyproj.Transformer.from_crs(geojson_srs, ept_srs, always_xy=True).transform | ||
|
||
geometry = transform(forward, geojson) | ||
if (not math.isnan(args.buffer)): | ||
geometry = geometry.buffer(args.buffer) | ||
args.geometry = geometry | ||
|
||
def do(args): | ||
logger.info(f"opening {args.ept} for processing") | ||
|
||
reproject_geojson(args) | ||
make_pipeline(args) | ||
with args.output.open(mode='w') as f: | ||
f.write(args.pipeline.pipeline) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from . import data | ||
from . import blend | ||
from .logs import logger | ||
from .logs import logger | ||
|
||
|
||
def doIt(args): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters