[mapserver-users] Hacking Mappostgis.c to allow Views as Maps
erver Data Source
rramuhn at chu-rouen.fr
Wed Mar 20 04:08:32 EST 2002
Hello Rodrigo and everybody,
Please, if you work on the SDO cartridge take in consideration the Oracle 9i
version which doesn't work exactly like 8i for spatialindex selection. Now
Oracle is able to take in consideration the Earth is not a plate ! So if you
define an rectangle to spatially select objects you have to project it :-) !
One more time, tks very much for all the great job you did till now on
De : Rodrigo Cabral [mailto:cabral at yadata.net]
Envoyé : mercredi 20 mars 2002 06:09
À : Sean Gillies; Dave Blasby
Cc : mapserver-users at lists.gis.umn.edu
Objet : Re: [mapserver-users] Hacking Mappostgis.c to allow Views as
Mapserver Data Source
I'm not a postgis user <yet>, but anyway I agree with the "USING UNIQUE ID
urid" sufix proposed by Grahan/Sean. This format looks like the Oracle
Spatial srid definition (i.e. "USING SRID srid"), and keeping some standard
like making the DATA statement "shape FROM table [USING xxx]" is always a
Another improvement which I will probably include in SDO is projection,
which mapserver can do with proj.4, but Oracle also have it implemented. It
could be interesting for some users to use SDO's projection functions. Thus
I'm planning in extending DATA syntax for Oracle Spatial like this:
DATA "shape FROM table USING SRID srid, VIEW viewsrid"
Generally, it could be implemented dbwise like this:
DATA "shape FROM table USING <arg1>, <arg2>, ..., <argn>"
Where <argi> varies depending on the data source (i.e. SDO, postgis, etc.)
----- Original Message -----
From: "Sean Gillies" <sgillies at i3.com>
To: "Dave Blasby" <dblasby at refractions.net>
Cc: <mapserver-users at lists.gis.umn.edu>
Sent: Tuesday, March 19, 2002 4:25 PM
Subject: Re: [mapserver-users] Hacking Mappostgis.c to allow Views as
Mapserver Data Source
Thanks for the response.
Perhaps the answer to the OID issue is to allow a user to
specify an optional alternative to OID in the Mapserver
DATA parameter like
"the_geom from view USING UNIQUE ID urid"
If there is no ' USING UNIQUE ID *' string, meaning
strstr(layer->data, " USING UNIQUE ID") == NULL)
you could default to the OID?
This was suggested to me by David Graham.
At this moment I am writing a function that will parse the
layer->data into geom_column_name, table_name and urid_name
using the 'using unique id' keywords. I'd like to contribute
it the the code if you think it would be useful.
One more thing -- I am having problems with sub-selects here
with my win32 mapserver. A DATA parameter like:
"the_geom from (select oid,* from table) as foo"
is failing because the Mapserver goes to the geometry_columns
table (using find_srid()) looking for an f_table_name of
'(select oid,* from table) as foo'. Have I uncovered a win32-
Dave Blasby wrote:
> Thanks a lot for your comments and work on the mappostgis.c
> Its always great to see someone contributing!
> Sean Gillies wrote:
>>1. Querying a unique row ID called "URID" instead of the Postgres
> The reason why I used OID was because it is always available in every
> table, and is always unique. Relying on a column called "URID" to
> be an integer, and be unique is a pretty hefty assumption. Plus it
> requires people to manually add this column to every table.
> As an alternative, you can check with msPOSTGISLayerGetItems() to
> see if there is a "URID" column. If there is, use it, otherwise use
> This way only people with a "URID" column thats non-integer or
> will have problems.
> Perhaps we should call it "UNIQUE_INT_ID" so its highly unlikely someone
> mistake what it is and what it should contain?
More information about the mapserver-users