Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#31611 closed Bug (duplicate)

Point Coords inputted using OSM map widget in Admin are wrong way round.

Reported by: ghareth Owned by: nobody
Component: GIS Version: 3.0
Severity: Normal Keywords: OSMGeoAdmin
Cc: ghareth Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Model with PointField being administered through Django Administration.

Points inserted correctly using map widget provided through GeoModelAdmin.

However, Points inserted using map widget provided through OSMGeoAdmin are created incorrectly with Latitude and Longitude swapped around.

i.e. SRID=4326;POINT(84.9497846781168 -172.663887489678) was inserted using OSMGeoAdmin.

i.e. SRID=4326;POINT(-119.5332 37.7459) was inserted using GeoModelAdmin.

Points inserted manually (ie. using method below) cannot be handled by OSMGeoAdmin returning error as Error transforming geometry from srid '4326' to srid '3857' (OGR failure.)

p.Location = Point(-119.5332, 37.7459)
p.save()

Models created using the following code using Djanog 3.0.5 running on Python 3.7 on MacOS.

from django.contrib.gis.db import models
from django.contrib.gis import admin

class Point(models.Model):
    location = models.PointField(default=Point(-98.4842, 39.0119), srid=4326)

in admin.py

admin.site.register(Point, admin.GeoModelAdmin)

or

admin.site.register(Point, admin.OSMGeoAdmin)


Change History (5)

comment:1 by ghareth, 4 years ago

Cc: ghareth added

comment:2 by Mariusz Felisiak, 4 years ago

Resolution: duplicate
Status: newclosed
Summary: Point Coords inputted using OSM map widget in Admin are wrong way roundPoint Coords inputted using OSM map widget in Admin are wrong way round.

GDAL 3.0 is not supported in Django 3.0. Duplicate of #30678.

comment:3 by palewire, 4 years ago

I think this may still exist in Django 3 with gdal 3.

$ gdalinfo --version
GDAL 3.0.4, released 2020/01/28

That's my gdal and I'm still having the issue.

in reply to:  3 ; comment:4 by Mariusz Felisiak, 4 years ago

I think this may still exist in Django 3 with gdal 3.

Django 3.0 doesn't support GDAL 3, it's supported by Django 3.1.

in reply to:  4 comment:5 by palewire, 4 years ago

Replying to felixxm:

I think this may still exist in Django 3 with gdal 3.

Django 3.0 doesn't support GDAL 3, it's supported by Django 3.1.

Ah. Thank you for the guidance. I upgraded to Django 3.1 and it fixed the bug right away. Thank you. Lucky me that 3.1 just came out!

Note: See TracTickets for help on using tickets.
Back to Top