#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 , 5 years ago
Cc: | added |
---|
comment:2 by , 5 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Summary: | Point Coords inputted using OSM map widget in Admin are wrong way round → Point Coords inputted using OSM map widget in Admin are wrong way round. |
follow-up: 4 comment:3 by , 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.
follow-up: 5 comment:4 by , 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.
comment:5 by , 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!
GDAL 3.0 is not supported in Django 3.0. Duplicate of #30678.