[postgis-devel] bool::text

dblasby at openplans.org dblasby at openplans.org
Thu Feb 24 09:30:08 PST 2005


Markus,

The Mapserver connector doesnt normally know what the column types are.

You could change it so it does a round-trip to get the column metadata
(you can see a simple implementation of this already in the
getItemNames (?) function).  Unfortunately, mapserver will not always
call that function when doing a draw or 'get information' query.

Currently, the generated query will look something like this:

SELECT a::text,b::text,c::text,d::text,  asBinary(...the_geom...)
FROM <actual user query>;

NOTE:
1. the generator that creates that SQL statement only knows the column
names, not the column types
2. this is done in a binary cursor so the geometry data comes back as
actual binary instead of the hex form
3. mapserver only wants text for the column values

As you can see, it basically allows for a normal - "text" - query to be
performed while still handling the binary data efficiently.

The mapserver connector was actually the very first application that
connected to postgis, so its not necessarily the best way to do things.

Personally, I think everyone should use the normal text cursors, but
that means your geometry data is 400% overhead if you use the current
postgis (bytea octal), 200% if you use the old postgis (hex), and 133%
if you use Base-64 (not implemented).

I reported the missing bool::text function several years ago.

dave


----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/



More information about the postgis-devel mailing list