Using Anaconda Python 2.7 juypter gdal pydem in Windows I wanted to learn to do basic slope calculation.

I was given a TIFF that was UTM zone 55, it covers a small area in Qld Australia. Planning to use TIFF to learn PyDEM, I found out that I should convert UTM to use EPSG 4326. After which I went into Jupyter and typed

import os
from pydem.dem_processing import DEMProcessor
filename_geotiff = 'c:\Users\Bec\Documents\River\wgs2DEM_2m.tif'
dem_proc = DEMProcessor(filename_geotiff)
mag, aspect = dem_proc.calc_slopes_directions()

...which gives the error:

UserWarning: Latitude normalization has been prohibited in the newer versions of geopy, because the normalized value happened to be on a different pole, which is probably not what was meant. If you pass coordinates as positional args, please make sure that the order is (latitude, longitude) or (y, x) in Cartesian terms.
ValueError: Latitude must be in the [-90; 90] range.

I tried ArcGIS 10.6 project raster and define project tool to convert, both changed the coordinate system, but left the extent still showing numbers as if it was UTM. Also tried doing it in ArcCatalog which did change the extent values but put the map in the wrong place.

The next plan was to get Python to do the transformation

from osgeo import gdal

filename = r"Weany_Dem_2m_final_pit_removed.tif"
input_raster = gdal.Open(filename)
output_raster = r"wgsweany"


TypeError: in method 'wrapper_GDALWarpDestName', argument 4 of type 'GDALWarpAppOptions *'

I looked at different gdalwarp options and I got more confused

import gdal

resulted in 2020200.

Could someone suggest a simple way for me to transform the data so it will then work in PyDEM.

  • Welcome to GIS SE. As a new user, please take the Tour, which explains how our Focused Q&A opetates. Please make your code legible by using the code formatting button ({}) to indent code four spaces. There should be no reason to reproject UTM data to 4326 to use it as a surface. You seem to have several problems in this question. If it were just the "Use Desktop to reproject a raster" problem, this would likely be a duplicate. Before you get wrapped around the axle with reprojection issues, you probably want to make sure it's necessary. – Vince Dec 16 '18 at 13:09
  • As far as I know to use PyDEM it is necessary to have the data crs as EPSG 4326, my data wasn't. Using ArcGIS desktop the define projection changes the original data, the raster projection tool leaves the original data and creates a new file. Both ways left the extent values as they were, which I assume was the reason for the error of values outside 90 to -90. – becharte Dec 21 '18 at 6:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.