[postgis-users] trouble getting correct units from "area(transform"

Paragon Corporation lr at pcorp.us
Mon Jun 1 17:22:54 PDT 2009


Charles,

Which SRID did you use to import your data?  Sounds like that is the
problem.  If you are using QGIS to view the data, I am guessing you used the
shape file?  And it was reading the prj file to determine the native
projection, but you overwrote in SPIT 3310 (which is wrong).

For census data -- you should set SRID  to 4269 in SPIT (NAD 83 long lat)
and then your area transform below should work fine. 

So bring the data in as SRID=4269
Then transform 3310 as you are doing  (national atlas equal area - 2163
might also be suitable and that covers all of US, but probably not as
accurate as California Albers)

Leo

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Charles
Blankenship
Sent: Monday, June 01, 2009 8:04 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] trouble getting correct units from "area(transform"

Disclaimer: I'm very new to GIS.

I want to calculate the areas of school districts in Nevada (and California
at some point) using census shape files.
http://www.census.gov/geo/cob/bdy/sn/sn00shp/sn32_d00_shp.zip

The data is unprojected so I know I must project it onto something good for
equal areas.  I'm trying NAD83 California Albers (SRID = 3310).

It seems to me from reading the documentation and numerous other
posts/tutorials, that the following code should return the area of the
districts in meters (or something I can convert to meters).

select area(transform(the_geom, 3310)) from mytable

This returns a column of areas which match my unprojected areas exactly!

I've fiddled with setting the constraint to SRID=3310, importing through the
qGIS SPIT plugin, selecting into a new table, delete and resetting
constraints, and on and on...


FWIW, I can load the file into qGIS, set the projection to 3310, and the
identify area feature calculates the "derived area" exactly as it should be.
I can't for the life of me figure out how to even get into the approximately
correct units.  (I've tried reprojecting to quite different SRIDs and can
see the area change slightly, but it still appears to be in native map units
or degrees).

Thanks for any assistance,
Charles 

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list