[postgis-devel] Rant on SRID -1 vs 0

Stephen Woodbridge woodbri at swoodbridge.com
Tue Jul 16 05:29:58 PDT 2013


On 7/16/2013 3:15 AM, Sandro Santilli wrote:
> On Mon, Jul 15, 2013 at 05:38:22PM -0400, Stephen Woodbridge wrote:
>> On 7/15/2013 5:36 PM, Bborie Park wrote:
>>
>>> I forget but can't you just shove in -1 for SRID? PostGIS 2.0 should
>>> automatically clamp values < 0 to 0.
>>
>> Yes this works, I was avoiding it because it raises an notice which
>> messes with them test infrastructure.
>
> If you don't care about testing warnings consider also using:
>
>   SET client_min_messages TO ERROR;
>
> (but yeah, the ST_Srid(<simple_geom_here>) trick works fine)

Looks like I have things mostly figured out. I used the 
ST_Srid(<simple_geom_here>) trick and ended up writing functions 
pgr_startpoint() and pgr_endpoint() to handle the MULTI* problem.

The NOTICE problem is a little harder to solve. I had thought of setting 
the message level to ERROR, but one of things that I want to be able to 
detect is whether or not someone has left debug notices turned on. The 
problem is the postgresql seems to vary the content of the NOTICE 
messages with every version of postgresql. So basically I have left me 
test response files to be correct for the version I work on and I have 
to spot check the false positives on the other platforms.

Thanks everyone for the suggestions.

-Steve



More information about the postgis-devel mailing list