Code

Opened 5 years ago

Closed 5 years ago

#11963 closed (wontfix)

Provide global configuration variable for default SRID

Reported by: jtiai 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: UI/UX:

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.

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by jbronn

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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()

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.