You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function layer in pg_tileserv that uses a function that is defined as:
FUNCTION public.blah(
z integer, x integer, y integer,
l float8,
t float8,
b float8,
r float8,
scenario text,
source integer,
amenity text)
RETURNS bytea
The amenity parameter is defined in the function as text, but by the time it gets to the function it seems to be being interpreted as an integer. I've had to add a ::text type cast inside the function but - more importantly - this is causing me problems when the input is a value with leading zeros, like 003. This is interpreted as an integer of 3 and then converted back to '3' as text, which makes my WHERE clause fail as the database contains 003.
I've found a workaround by changing the URL to have the value with leading zeros in quotes:
which then gets passed through correctly as a string.
Do you have any idea where this incorrect type conversion is happening? I'm pretty sure it's not in my Javascript code that is setting the URLs for my map - as the Network tab in Developer Tools show that the URL has 003 in it. So I think it must be somewhere in pg_tileserv or my PostGIS function.
Any ideas for where to look would be very helpful
The text was updated successfully, but these errors were encountered:
I have a function layer in pg_tileserv that uses a function that is defined as:
I call it like this:
The amenity parameter is defined in the function as
text
, but by the time it gets to the function it seems to be being interpreted as an integer. I've had to add a::text
type cast inside the function but - more importantly - this is causing me problems when the input is a value with leading zeros, like003
. This is interpreted as an integer of3
and then converted back to'3'
as text, which makes my WHERE clause fail as the database contains003
.I've found a workaround by changing the URL to have the value with leading zeros in quotes:
which then gets passed through correctly as a string.
Do you have any idea where this incorrect type conversion is happening? I'm pretty sure it's not in my Javascript code that is setting the URLs for my map - as the Network tab in Developer Tools show that the URL has
003
in it. So I think it must be somewhere in pg_tileserv or my PostGIS function.Any ideas for where to look would be very helpful
The text was updated successfully, but these errors were encountered: