Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9133455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:29:33+00:00 2026-06-17T08:29:33+00:00

I am attempting to use South to create a migration to convert my data

  • 0

I am attempting to use South to create a migration to convert my data from using the 4326 SRID to 900913. After the migration, the coordinates remain in their 4326 format. (It’s easy to tell the difference between the 4326 and 900913 projections, since the numbers are much larger in 900913)

Here are the forward() and backward() functions from that migration:

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Changing field 'ZipCoords.point'
        zips = orm.ZipCoords.objects.all()
        db.alter_column('itinerary_generator_zipcoords', 'point', self.gf('django.contrib.gis.db.models.fields.PointField')(srid=900913, null=True))
        for zip in zips:
            zip.point.transform(900913)
            zip.save()

    def backwards(self, orm):
        # Changing field 'ZipCoords.point'
        zips = orm.ZipCoords.objects.all()
        db.alter_column('itinerary_generator_zipcoords', 'point', self.gf('django.contrib.gis.db.models.fields.PointField')(null=True))
        for zip in zips:
            zip.point.transform(4326)
            zip.save()

I am checking their values using the Django Admin. Also, interestingly, this migration “works” in reverse, it turns my coordinates into much smaller (but incorrect) numbers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:29:34+00:00Added an answer on June 17, 2026 at 8:29 am

    The problem seems to be that the data I was converting from did not have an SRID. (or perhaps the SRID was 900913, causing a no-op on the transform(), I didn’t test.). This updated forward() function works:

    def forwards(self, orm):
        # Changing field 'ZipCoords.point'
        zips = orm.ZipCoords.objects.all()
        db.alter_column('itinerary_generator_zipcoords', 'point', self.gf('django.contrib.gis.db.models.fields.PointField')(srid=900913, null=True))
        for zip in zips:
            zip.point.srid = 4326
            zip.point.transform(900913)
            zip.save()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use the data series from this example no longer passes the JSONLint
When attempting to use pandoc to convert JSON based files (.ipynb) from iPython notebook
When attempting to use HttpWebRequest to retrieve a page from my dev server, I
In attempting to use std::select1st from <functional> in a VS2008 project I found that
I am attempting to use the data sources pluigin for rubymine 4.0.3 but I
I am attempting to use the following code to search a database using words
Attempting to use the amazon API to obtain product data and currently failing miserably.
Im attempting to use Silverlight and MVC together. After creating a simple Silverlight application
I'm attempting to use the method of internal storage to retain my data. In
I'm attempting to use the latest master branch of ember.js and ember-data. Here's some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.