Opened 15 years ago

Closed 15 years ago

#11963 closed (wontfix)

Provide global configuration variable for default SRID

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

Description

Currently if you don't explicitly provide any SRID you get 4326 and there is no convenient way to provide own default value.

There should be setting to override default value without needing explicit override everywhere.

Change History (1)

comment:1 by jbronn, 15 years ago

Resolution: wontfix
Status: newclosed

I don't think there should be a setting to override the default -- that is what the srid keyword is for (explicit is better than implicit). One can easily accomplish this by having their own DEFAULT_SRID variable in their settings and then using that with their model definitions, for example:

from django.contrib.gis.db import models
from django.conf import settings

class GeoModel(models.Model):
    point = models.PointField(srid=settings.DEFAULT_SRID)
    objects = models.GeoManager()
Note: See TracTickets for help on using tickets.
Back to Top