Thanks for the suggestion, Pierre.<br><br>I turned out to be a mistake on my part as I used the first Albers Equal Area Conic listing I found on <a href="http://spatialreference.org">http://spatialreference.org</a>. It turns out there are two.....<br>
<a href="http://spatialreference.org/ref/esri/102003/">ESRI:102003</a>: USA Contiguous Albers Equal Area Conic<br><a href="http://spatialreference.org/ref/esri/102008/">ESRI:102008</a>: North America Albers Equal Area Conic<br>
<br>-David<br><br><div class="gmail_quote">On Thu, Feb 9, 2012 at 12:16 PM, Pierre Racine <span dir="ltr"><<a href="mailto:Pierre.Racine@sbf.ulaval.ca">Pierre.Racine@sbf.ulaval.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I generally display things in OpenJump to make sure they align correctly before doing anything instead of assuming they do. Do the projected geometries align properly with the rasters?<br>
<br>
You can display the raster extents easily in OpenJump by casting the raster to geometry (rast::geometry)...<br>
<br>
You can also do this easily in QGIS or ArcGIS 10.<br>
<br>
Pierre<br>
<div><div class="h5"><br>
> -----Original Message-----<br>
> From: <a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a> [mailto:<a href="mailto:postgis-users-">postgis-users-</a><br>
> <a href="mailto:bounces@postgis.refractions.net">bounces@postgis.refractions.net</a>] On Behalf Of David Quinn<br>
> Sent: Thursday, February 09, 2012 10:45 AM<br>
> To: PostGIS Users Discussion<br>
> Subject: [postgis-users] Question about using ST_Transform()<br>
><br>
> Hello All,<br>
><br>
> I'm trying to understand how to use ST_Transform() on a query. When I have<br>
> everything in the same projection (in this case Albers Equal Area Conic) my query<br>
> returns the correct result:<br>
><br>
> SELECT<br>
>     SUM((stats).sum)<br>
> FROM (<br>
>     select<br>
>         ST_SummaryStats(ST_Clip(r.rast, 1, p.geom, NULL, TRUE)) as stats<br>
>     FROM<br>
>         ny_albers as r,<br>
>         cities_albers as p<br>
>     WHERE<br>
>         <a href="http://p.name" target="_blank">p.name</a> = 'new_york'<br>
>     AND<br>
>         ST_Intersects(r.rast, p.geom)<br>
>     )  as foo;<br>
><br>
> If I use a table with polygons in a different projection (in this case Web<br>
> Mercator), I do not get any values returned:<br>
><br>
> SELECT<br>
>     SUM((stats).sum)<br>
> FROM (<br>
>     select<br>
>         ST_SummaryStats(ST_Clip(r.rast, 1, ST_Transform(p.geom,102003), NULL,<br>
> TRUE)) as stats<br>
>     FROM<br>
>         ny_albers as r,<br>
>         cities_webMercator as p<br>
>     WHERE<br>
>         <a href="http://p.name" target="_blank">p.name</a> = 'new_york'<br>
>     AND<br>
>         ST_Intersects(r.rast, ST_Transform(p.geom,102003))<br>
>     )  as foo;<br>
><br>
> I added the projection SRID:102003 using the following lines:<br>
><br>
> INSERT into<br>
>     spatial_ref_sys (<br>
>     srid,<br>
>     auth_name,<br>
>     auth_srid,<br>
>     srtext,<br>
>     proj4text<br>
>     )<br>
> values (<br>
>      102003, -- I changed this line as it was originally 9102003 which did not satisfy<br>
> the constraints<br>
>      'esri',<br>
>      102003,<br>
> 'PROJCS["USA_Contiguous_Albers_Equal_Area_Conic",GEOGCS["GCS_North_A<br>
> merican_1983",DATUM["North_American_Datum_1983",SPHEROID["GRS_1980<br>
> ",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453<br>
> 292519943295]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["False_<br>
> Easting",0],PARAMETER["False_Northing",0],PARAMETER["longitude_of_center<br>
> ",-<br>
> 96],PARAMETER["Standard_Parallel_1",29.5],PARAMETER["Standard_Parallel_2<br>
> ",45.5],PARAMETER["latitude_of_center",37.5],UNIT["Meter",1],AUTHORITY["E<br>
> PSG","102003"]]',<br>
>      '+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0<br>
> +ellps=GRS80 +datum=NAD83 +units=m +no_defs ');<br>
><br>
> I had some problems when I tried to add this projection from<br>
> <a href="http://spatialreference.org/ref/esri/102003/postgis/" target="_blank">http://spatialreference.org/ref/esri/102003/postgis/</a><br>
> The names and values of srtext, and proj4text were reversed, and the SRID<br>
> seemed incorrect so I changed it. I don't know if this is related to my question<br>
> above, but I thought it worth mentioning. I did import the raster and polygon<br>
> using this SRID on the query that worked.<br>
><br>
> Thank you,<br>
> David<br>
><br>
<br>
</div></div>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br>