Opened 7 years ago

Closed 3 years ago

#6251 closed defect (wontfix)

gdal_proximity.py gives wrong distance

Reported by: remilemoy Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: 1.11.0
Severity: normal Keywords: proximity
Cc:

Description (last modified by remilemoy)

When computing distances between all points of a raster and a given pixel (the center of a city in a monocentric city model) using gdal_proximity.py, I obtained wrong distances. The error is not big, but not very small either, something like 5 or 10% (500-900m for 10km), depends on the CRS I used (I tried another one because I thought it was CRS-related) and is bigger in a North-South direction than East-West.

I saw the error when I computed the distance in another way (euclidian distance using the projected coordinates). I am confident that this euclidian distance is right because I compared it to the one given by an online national GIS system (http://www.geoportail.gouv.fr -- I was working on a French city), and the distances I measured were in good agreement (and it worked for both CRSs I tried).

So I will just stop using gdal_proximity, also because I don't really need it in this project, but I wanted to mention the error -- I hope that this is the right place to do so.

Sorry if it is actually my mistake, I am still a beginner with GIS!

Best,

Rémi

Change History (5)

comment:1 by Even Rouault, 7 years ago

Did you use the "-distunits GEO" switch ? Quoting http://gdal.org/gdal_proximity.html

-distunits PIXEL/GEO:

    Indicate whether distances generated should be in pixel or georeferenced coordinates (default PIXEL). 

comment:2 by Even Rouault, 7 years ago

Also note that if your raster is georeferenced in a geographic coordinate system (long/lat), -distunits GEO will compute distance in "degrees". So you might want to project in a projected coordinate system first.

in reply to:  2 comment:3 by remilemoy, 7 years ago

Hello, yes I used this "-distunits GEO", and I was working in a projected coordinate system (I even tried 2 of them), with coordinates in meters.

comment:4 by remilemoy, 7 years ago

Description: modified (diff)

comment:5 by Even Rouault, 3 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.