kopia lustrzana https://github.com/OpenDroneMap/ODM
Replaced gippy with rasterio
rodzic
f9ed7900fd
commit
5a06291ac3
|
@ -74,7 +74,6 @@ RUN pip install -U \
|
|||
scipy \
|
||||
shapely \
|
||||
xmltodict \
|
||||
https://github.com/OpenDroneMap/gippy/archive/numpyfix.zip \
|
||||
rasterio \
|
||||
attrs==19.1.0
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ install() {
|
|||
libboost-log-dev
|
||||
|
||||
echo "Installing split-merge Dependencies"
|
||||
pip install -U scipy numpy==1.15.4 shapely pyproj https://github.com/OpenDroneMap/gippy/archive/numpyfix.zip psutil
|
||||
pip install -U scipy numpy==1.15.4 shapely pyproj psutil
|
||||
|
||||
echo "Compiling SuperBuild"
|
||||
cd ${RUNPATH}/SuperBuild
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
import sys
|
||||
import gippy
|
||||
import rasterio
|
||||
import numpy
|
||||
import math
|
||||
import time
|
||||
|
@ -236,9 +236,10 @@ def post_process(geotiff_path, output_path, smoothing_iterations=1):
|
|||
|
||||
log.ODM_INFO('Starting post processing (smoothing)...')
|
||||
|
||||
img = gippy.GeoImage(geotiff_path)
|
||||
nodata = img[0].nodata()
|
||||
arr = img[0].read()
|
||||
with rasterio.open(geotiff_path) as img:
|
||||
nodata = img.nodatavals[0]
|
||||
dtype = img.dtypes[0]
|
||||
arr = img.read()[0]
|
||||
|
||||
# Median filter (careful, changing the value 5 might require tweaking)
|
||||
# the lines below. There's another numpy function that takes care of
|
||||
|
@ -259,11 +260,8 @@ def post_process(geotiff_path, output_path, smoothing_iterations=1):
|
|||
arr[locs] = nodata
|
||||
|
||||
# write output
|
||||
imgout = gippy.GeoImage.create_from(img, output_path)
|
||||
imgout.set_nodata(nodata)
|
||||
imgout[0].write(arr)
|
||||
output_path = imgout.filename()
|
||||
imgout = None
|
||||
with rasterio.open(output_path, 'w', **img.profile) as imgout:
|
||||
imgout.write(arr.astype(dtype), 1)
|
||||
|
||||
log.ODM_INFO('Completed post processing to create %s in %s' % (os.path.relpath(output_path), datetime.now() - start))
|
||||
|
||||
|
|
|
@ -41,10 +41,7 @@ def euclidean_merge_dems(input_dems, output_dem, creation_options={}):
|
|||
logging.disable(logging.DEBUG)
|
||||
|
||||
with rasterio.open(existing_dems[0]) as first:
|
||||
src_nodata = 0
|
||||
nodatavals = first.get_nodatavals()
|
||||
if len(nodatavals) > 0:
|
||||
src_nodata = nodatavals[0]
|
||||
src_nodata = first.nodatavals[0]
|
||||
res = first.res
|
||||
dtype = first.dtypes[0]
|
||||
profile = first.profile
|
||||
|
@ -148,10 +145,7 @@ def euclidean_merge_dems(input_dems, output_dem, creation_options={}):
|
|||
# With rio merge this just adds an extra row, but when the
|
||||
# imprecision occurs at each block, you get artifacts
|
||||
|
||||
nodata = 0
|
||||
nodatavals = src_d.get_nodatavals()
|
||||
if len(nodatavals) > 0:
|
||||
nodata = nodatavals[0]
|
||||
nodata = src_d.nodatavals[0]
|
||||
|
||||
# Alternative, custom get_window using rounding
|
||||
src_window = tuple(zip(rowcol(
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
from __future__ import absolute_import
|
||||
import os, shutil, sys, struct, random, math
|
||||
from gippy import GeoImage
|
||||
from opendm.dem import commands
|
||||
from opendm import system
|
||||
from opendm import log
|
||||
|
|
|
@ -74,7 +74,6 @@ RUN pip install -U \
|
|||
scipy \
|
||||
shapely \
|
||||
xmltodict \
|
||||
https://github.com/OpenDroneMap/gippy/archive/numpyfix.zip \
|
||||
rasterio \
|
||||
attrs==19.1.0
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue