[postgis-devel] Not receiving SRID conflict error
Bborie Park
dustymugs at gmail.com
Fri Jan 16 08:18:09 PST 2015
Yes, the following explains it.
SELECT 'SRID=4269;POINT(-1 -1)'::geometry &&
ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 4326), 1, '16BUI',
1, 0)
and
SELECT ST_Intersects('SRID=4269;POINT(-1 -1)'::geometry,
ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 4326), 1, '16BUI',
1, 0))
On Fri, Jan 16, 2015 at 8:14 AM, Bborie Park <dustymugs at gmail.com> wrote:
> Do you have a spatial index on IGBP_2012?
>
> The only thing I can think of is that dasymetric.us_dem_prj has a spatial
> index and since ST_Intersects() uses the spatial index first, there is no
> rows to consider in ST_Intersects and ST_Clip.
>
> -bborie
>
> On Fri, Jan 16, 2015 at 7:56 AM, David Haynes II <dahaynes at umn.edu> wrote:
>
>> Hello,
>>
>> I have a question about an error I am not receiving when I believe I
>> should.
>>
>> Below are three datasets that with their SRID
>> igbp_2012 (6842), us_dem_prj (3410), and us_states (4326).
>>
>> When I run a query determining the SRID for these datasets in PostgreSQL
>> they confirm their SRIDs
>> select st_srid(r.rast), st_srid(p.geom) from dasymetric.us_dem_prj r,
>> dasymetric.us_states p limit 5
>>
>> When I run the next query, I do not receive an error, but no records are
>> returned. The raster is in 3410 and the states geom column is in 4326
>> SELECT state_label, ST_Clip(r.rast,p.geom) as rast FROM
>> dasymetric.us_states p inner join dasymetric.us_dem_prj r on
>> ST_Intersects(p.geom, r.rast) WHERE p.state_label = 'Minnesota'
>>
>> However, If I adjust the raster dataset to IGBP_2012, the error
>> ERROR: Raster and geometry do not have the same SRID, shows up.
>>
>> Why am I not receiving a conflict projection error for a raster in 3410
>> and a geometry in 4326? Any idea why that is occurring?
>>
>> --
>> David Haynes, Ph.D.
>> Research Associate Terra Populus
>> Minnesota Population Center
>> www.terrapop.org
>>
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20150116/64beaf53/attachment.html>
More information about the postgis-devel
mailing list