Giter Site home page Giter Site logo

dsm2dtm's People

Contributors

r1j1t avatar seedlit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dsm2dtm's Issues

Create a binary for Pip

Cn we use something similar to setup the dependencies easily via conda https://stackoverflow.com/a/59390280/7630458?
As I can see GDAL has a binary available via conda: https://gdal.org/download.html#conda and same goes for rasterio: https://github.com/conda-forge/rasterio-feedstock#installing-rasterio.

This will make it easy for users to be able to start with the package easily also they don't need to manually install GDAL. Let me know your thoughts on this.

Once this is sorted, I would like to contribute to make this package available on conda or pip for easy consumption.

Use of your DSM to DTM code on GITHUB

I have been able to run the code and it took my entire day to run, i have low number of processor.

Now I am facing the error which I have attached as an attachment.

Please do respond to it and suggest me so method or modification that i need to do. This is my last resort, I need the DTM for flood modelling. Any insight will be helpful.
Screenshot (102)

get_raster_crs

  1. Consider harvesting and returning the crs from def get_raster_resolution(raster_path). Like so:
def get_raster_resolution(raster_path):
    raster = gdal.Open(raster_path)
    raster_geotrans = raster.GetGeoTransform()
    x_res = raster_geotrans[1]
    y_res = -raster_geotrans[5]

    prj = raster.GetProjection()
    crs = osr.SpatialReference(wkt=prj)
   
    return x_res, y_res, crs

this will render def get_raster_crs(raster_path): and rasterio unnecessary.

your import will then be:

from osgeo import gdal, osr
  1. What would be the gdal equavalent to this / how can I do this with gdal?
def extract_dtm(dsm_path, ground_dem_path, non_ground_dem_path, radius, terrain_slope):
    """
    Generates a ground DEM and non-ground DEM raster from the input DSM raster.
    Input:
        dsm_path: {string} path to the DSM raster
        radius: {int} Search radius of kernel in cells.
        terrain_slope: {float} average slope of the input terrain
    Output:
        ground_dem_path: {string} path to the generated ground DEM raster
        non_ground_dem_path: {string} path to the generated non-ground DEM raster
    """
    cmd = "saga_cmd grid_filter 7 -INPUT {} -RADIUS {} -TERRAINSLOPE {} -GROUND {} -NONGROUND {}".format(
        dsm_path, radius, terrain_slope, ground_dem_path, non_ground_dem_path
    )
    os.system(cmd)

file missing issue?

ERROR 4: Attempt to create new tiff file `generated_dtm\temp_files\generated_dtm\temp_files\sample_dsm_ds_slp.tif' failed: No such file or directory
ERROR 1: Unable to create dataset generated_dtm\temp_files\generated_dtm\temp_files\sample_dsm_ds_slp.tif
ERROR 4: generated_dtm\temp_files\generated_dtm\temp_files\sample_dsm_ds_slp.tif: No such file or directory
Traceback (most recent call last):
File "D:/PycharmProjects/pythonProject/dsm2dtm/dsm2dtm-main/dsm2dtm.py", line 359, in
dtm_path = main(dsm_path, out_dir)
File "D:/PycharmProjects/pythonProject/dsm2dtm/dsm2dtm-main/dsm2dtm.py", line 304, in main
avg_slp = int(get_mean(dsm_slp_path))
File "D:/PycharmProjects/pythonProject/dsm2dtm/dsm2dtm-main/dsm2dtm.py", line 55, in get_mean
np_raster = np.array(gdal.Open(raster_path).ReadAsArray())
AttributeError: 'NoneType' object has no attribute 'ReadAsArray'

Consider adding test?

Hi @seedlit,

I think if you will add tests to package, it will help in people understanding the use case easily. Also, it would help track the development of the package in the future. Here is a good line:

... other developers want to see tests in your software before they take it seriously is yet another reason for you to start writing tests.
-https://docs.djangoproject.com/en/3.2/intro/tutorial05/#tests-make-your-code-more-attractive

Just a small suggestion from my side!

Issue on DSM to DTM Convertion for smoothness of cones

Hai seedlit...!
I have issue on DSM to DTM convertion,I done by using the agisoft metashape software but Cones is Created in buildings edges, i tried to smoothness of cones, By using your code DSM to DTM converted ,it came same as the agisoft ,i need without cones (Please refer the image)
what are the parameters need to change in your code.
I attached the image also for reference..
I hope will get quick response.
Thank you... :)
1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.