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 8868715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:19:48+00:00 2026-06-14T17:19:48+00:00

I have implemented GeoDjango using postgis. Here is my model: … geometria = models.PolygonField(srid=4326,

  • 0

I have implemented GeoDjango using postgis.

Here is my model:

  ...
  geometria = models.PolygonField(srid=4326, null=True)
  ...

When I call data.area it returns a float, but I don’t have any clues about it’s measurement units, and it’s a problem because I want to test if it’s bigger of a pre-set area in squared meters.

Can you help me?

  • 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-14T17:19:49+00:00Added an answer on June 14, 2026 at 5:19 pm

    If you are dealing with large areas on the map, you should set

    geometria = models.PolygonField(srid=4326, null=True, geography=True)
    

    As mentioned in geodjango’s documentation https://docs.djangoproject.com/en/dev/ref/contrib/gis/model-api/#geography

    Geography Type In PostGIS 1.5, the geography type was introduced — it
    provides native support for spatial features represented with
    geographic coordinates (e.g., WGS84 longitude/latitude). [7] Unlike
    the plane used by a geometry type, the geography type uses a spherical
    representation of its data. Distance and measurement operations
    performed on a geography column automatically employ great circle arc
    calculations and return linear units. In other words, when ST_Distance
    is called on two geographies, a value in meters is returned (as
    opposed to degrees if called on a geometry column in WGS84).

    If you do not have geography=True, we are storing things as plain geometries, we will need to do conversion from square degrees (the floating point result you are getting) into a unit of measure you prefer because we cannot calculate area from geographic coordinates. We can instead add a helper method which is in a projected coordinate space to do the transformation:

    def get_acres(self): 
        """ 
        Returns the area in acres. 
        """ 
        # Convert our geographic polygons (in WGS84)
        # into a local projection for New York (here EPSG:32118) 
        self.polygon.transform(32118) 
        meters_sq = self.polygon.area.sq_m
    
        acres = meters_sq * 0.000247105381 # meters^2 to acres
    
        return acres
    

    Which projection we use depends on the extent of the data, and how accurate we need the results: here I’ve illustrated with a specific projection for part of New York, but if your data isn’t particularly accurate, you could easily substitute a global projection or just use a simple formula.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented arbitrary links in my rtb using the CodeProject found here .
I have implemented clean URLs using the following in my .htaccess RewriteEngine on RewriteCond
I have implemented a very basic sign up using email address+name, although I would
I have implemented a DfsRepository using jgit-2.0.0.201206130900. It works great but I want to
I have implemented the Devise Omniauth authentication in my Rails application successfully using the
I have implemented REST API using PHP. This API access to MySQL Database. I
I have implemented SSO authentication using the sourceforge spnego project . This is my
I have implemented a Single Sign on function using Janrain. It outputs this data
I have implemented SQL Server session mode for an asp.net application. <sessionState mode=SQLServer compressionEnabled=true
I have implemented graphs using this tutorial http://www.raywenderlich.com/13271/how-to-draw-graphs-with-core-plot-part-2 now i want to add a

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.