[postgis-users] Re: Expression Mapserver
Vojtech Honzik
v.honzik at gmail.com
Mon May 9 10:00:11 PDT 2005
>Hi Steve,
>
>Here are all my tests :
>
>EXPRESSION ( [moved] = 't')
>EXPRESSION ( [moved] = "t")
>EXPRESSION ( [moved] eq 't')
>EXPRESSION ( [moved] eq "t")
>EXPRESSION ( [moved] =~ /t/)
>
>None of those test work
>
>Didrik
>
I use expression ('[moved]' eq 't'). It says Mapserver to compare the value
of moved as string with another string. At least I think so.
Vojtech Honzik
----- Original Message -----
From: <postgis-users-request at postgis.refractions.net>
To: <postgis-users at postgis.refractions.net>
Sent: Monday, May 09, 2005 6:45 PM
Subject: postgis-users Digest, Vol 31, Issue 23
> Send postgis-users mailing list submissions to
> postgis-users at postgis.refractions.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> or, via email, send a message with subject or body 'help' to
> postgis-users-request at postgis.refractions.net
>
> You can reach the person managing the list at
> postgis-users-owner at postgis.refractions.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of postgis-users digest..."
>
>
> Today's Topics:
>
> 1. postgis bool::text and mapserver (Didrik Pinte)
> 2. pgsql2shp changing case of fieldnames (Obe, Regina DND\MIS)
> 3. Re: postgis bool::text and mapserver (Paul Ramsey)
> 4. Re: postgis bool::text and mapserver (Didrik Pinte)
> 5. Re: postgis bool::text and mapserver (Stephen Woodbridge)
> 6. How to reproject postgis layers in mapserver
> (Obe, Regina DND\MIS)
> 7. Re: postgis bool::text and mapserver (Didrik Pinte)
> 8. Re: pgsql2shp changing case of fieldnames (strk at refractions.net)
> 9. Re: postgis bool::text and mapserver (Didrik Pinte)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 09 May 2005 16:14:16 +0200
> From: Didrik Pinte <dpinte at itae.be>
> Subject: [postgis-users] postgis bool::text and mapserver
> To: postgis-users at postgis.refractions.net
> Message-ID: <1115648056.1274.25.camel at geru-itea>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
>
> I have a problem using the latest Postigs package of the Debian GIS
> project with Debian/Sarge Mapserver package (4.4).
>
> When using boolean in EXPRESSION, the test does not work. And nothing
> displays...
>
> For example :
>
> Here is the mapserver class :
>
> CLASS
> NAME "test"
> EXPRESSION ([moved] = 't')
> COLOR 255 0 0
> OUTLINECOLOR 255 0 0
> SIZE 10
> SYMBOL "circle"
> END
>
>
> And here is the table definition :
>
> CREATE TABLE mapping
> (
> id varchar(50) NOT NULL,
> moved bool DEFAULT false,
> cartopoint geometry,
> CONSTRAINT id PRIMARY KEY (id),
> CONSTRAINT enforce_dims_cartopoint CHECK (ndims(cartopoint) = 2),
> CONSTRAINT enforce_geotype_cartopoint CHECK (geometrytype(cartopoint)
> = 'POINT'::text OR cartopoint IS NULL),
> CONSTRAINT enforce_srid_cartopoint CHECK (srid(cartopoint) = 4326)
> )
>
>
> When using psql, it works perfectly well :
>
> select text(moved) from tblgeomapping where text(moved)='t';
>
> As anybody an idea on the source of the problem ?
>
> Thanks a lot in advance for any help.
>
> Didrik Pinte
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 189 bytes
> Desc: This is a digitally signed message part
> Url :
> http://lists.refractions.net/pipermail/postgis-users/attachments/20050509/112bdaef/attachment-0001.bin
>
> ------------------------------
>
> Message: 2
> Date: Mon, 9 May 2005 10:18:52 -0400
> From: "Obe, Regina DND\\MIS" <robe.dnd at cityofboston.gov>
> Subject: [postgis-users] pgsql2shp changing case of fieldnames
> To: 'PostGIS Users Discussion' <postgis-users at postgis.refractions.net>
> Message-ID: <B318FD8D29DCD411BD0500D0B7A91C6704103EAB at jupiter>
> Content-Type: text/plain; charset="us-ascii"
>
> I noticed the 3/31/05 build of pgsql2shp I have now automatically forces
> the
> output field names to upper case which normally would be a good thing.
> Unfortunately I've got some old mapserver maps that rely on the field
> names
> in the dbf being in lowercase. Is there anyway to reverse this behavior
> e.g. with a switch or something of that sort so that I don't have to
> revert
> back to the older version of pgsql2shp?
>
> Thanks,
> Regina
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.refractions.net/pipermail/postgis-users/attachments/20050509/19e68b1f/attachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Mon, 09 May 2005 07:26:35 -0700
> From: Paul Ramsey <pramsey at refractions.net>
> Subject: Re: [postgis-users] postgis bool::text and mapserver
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <8c087af6cfc5c48dcc8a46c62d0b7416 at refractions.net>
> Content-Type: text/plain; format=flowed; charset=US-ASCII
>
>
> Two possible things:
>
> SELECT true::text
>
> and see what the text representation to boolean is.
> I think to do string comparisons in mapserver you use 'eq' instead of
> '='.
>
> Paul
>
> On 9-May-05, at 7:14 AM, Didrik Pinte wrote:
>
>> Hi,
>>
>> I have a problem using the latest Postigs package of the Debian GIS
>> project with Debian/Sarge Mapserver package (4.4).
>>
>> When using boolean in EXPRESSION, the test does not work. And nothing
>> displays...
>>
>> For example :
>>
>> Here is the mapserver class :
>>
>> CLASS
>> NAME "test"
>> EXPRESSION ([moved] = 't')
>> COLOR 255 0 0
>> OUTLINECOLOR 255 0 0
>> SIZE 10
>> SYMBOL "circle"
>> END
>>
>>
>> And here is the table definition :
>>
>> CREATE TABLE mapping
>> (
>> id varchar(50) NOT NULL,
>> moved bool DEFAULT false,
>> cartopoint geometry,
>> CONSTRAINT id PRIMARY KEY (id),
>> CONSTRAINT enforce_dims_cartopoint CHECK (ndims(cartopoint) = 2),
>> CONSTRAINT enforce_geotype_cartopoint CHECK (geometrytype(cartopoint)
>> = 'POINT'::text OR cartopoint IS NULL),
>> CONSTRAINT enforce_srid_cartopoint CHECK (srid(cartopoint) = 4326)
>> )
>>
>>
>> When using psql, it works perfectly well :
>>
>> select text(moved) from tblgeomapping where text(moved)='t';
>>
>> As anybody an idea on the source of the problem ?
>>
>> Thanks a lot in advance for any help.
>>
>> Didrik Pinte
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 09 May 2005 16:37:00 +0200
> From: Didrik Pinte <dpinte at itae.be>
> Subject: Re: [postgis-users] postgis bool::text and mapserver
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <1115649420.1274.30.camel at geru-itea>
> Content-Type: text/plain; charset="iso-8859-15"
>
> Le lundi 09 mai 2005 à 07:26 -0700, Paul Ramsey a écrit :
>> Two possible things:
>>
>> SELECT true::text
>>
>> and see what the text representation to boolean is.
>> I think to do string comparisons in mapserver you use 'eq' instead of
>> '='.
>>
>> Paul
>
> Hi Paul,
>
> Here are the information :
>
> [1] ::text conversion
>
> test=# select true::text;
> text
> ------
> t
> (1 ligne)
>
> I've also tested if there is no hidden whitespace over there :
>
> nh3=# select char_length(true::text);
> char_length
> -------------
> 1
> (1 ligne)
>
> [2] Mapserver EXPRESSION :
>
> I've just tested my expression like this :
>
> EXPRESSION ( [moved] eq 't')
>
> but it does not work ...
>
> When I export the information to a shapefile, it works great.
>
> Didrik
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 189 bytes
> Desc: This is a digitally signed message part
> Url :
> http://lists.refractions.net/pipermail/postgis-users/attachments/20050509/043d1c9c/attachment-0001.bin
>
> ------------------------------
>
> Message: 5
> Date: Mon, 09 May 2005 10:56:17 -0400
> From: Stephen Woodbridge <woodbri at swoodbridge.com>
> Subject: Re: [postgis-users] postgis bool::text and mapserver
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <427F7A11.8030300 at swoodbridge.com>
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
>
> Try EXPRESSION ( [moved] =~ /t/)
>
> -Steve
>
> Didrik Pinte wrote:
>> Le lundi 09 mai 2005 à 07:26 -0700, Paul Ramsey a écrit :
>>
>>>Two possible things:
>>>
>>>SELECT true::text
>>>
>>>and see what the text representation to boolean is.
>>>I think to do string comparisons in mapserver you use 'eq' instead of
>>>'='.
>>>
>>>Paul
>>
>>
>> Hi Paul,
>>
>> Here are the information :
>>
>> [1] ::text conversion
>>
>> test=# select true::text;
>> text
>> ------
>> t
>> (1 ligne)
>>
>> I've also tested if there is no hidden whitespace over there :
>>
>> nh3=# select char_length(true::text);
>> char_length
>> -------------
>> 1
>> (1 ligne)
>>
>> [2] Mapserver EXPRESSION :
>>
>> I've just tested my expression like this :
>>
>> EXPRESSION ( [moved] eq 't')
>>
>> but it does not work ...
>>
>> When I export the information to a shapefile, it works great.
>>
>> Didrik
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 9 May 2005 10:58:36 -0400
> From: "Obe, Regina DND\\MIS" <robe.dnd at cityofboston.gov>
> Subject: [postgis-users] How to reproject postgis layers in mapserver
> To: 'PostGIS Users Discussion' <postgis-users at postgis.refractions.net>
> Message-ID: <B318FD8D29DCD411BD0500D0B7A91C6704103EAD at jupiter>
> Content-Type: text/plain
>
> I'm using mapserver 4.4.2 and PostGIS 8.0.2/1.0.0/proj 4.4.9. I have
> aerial
> tiles of MrSID files in NAD 83 meters and my postgis layers in NAD 83 ft.
> If I have my map in NAD 83 ft most works fine - I can zoom in out etc. and
> its fairly fast. My aerial reprojects correctly to NAD 83 ft.
>
> If I perform a query something like
> qstring=parcel_id=blahblahblah&qlayer=parcels in my htm file
> - then my aerial layer gets all screwed up - it doesn't seem to reproject
> correctly. It takes a long time to run and then the whole aerial seems to
> get squashed at the center of the zoomed in parcel. If I leave the aerial
> out - the query works fine.
>
> If I switch my map projection to NAD 83 meters, then the postgis layers
> don't seem to reproject so they just don't show or show in very weird
> places.
>
> I'm assuming this is something wrong I'm doing with the postgis layers
> because if I swap these with map info tab files or shape files of NAD 83
> ft,
> those seem to work fine and project if I put in a PROJECT END clause. I
> tried putting in a PROJECT END .. in the postgis layers, but that didn't
> seem to make a difference. I verified that my spatial fields are in the
> geometry_columns table.
>
> Below is a snippet of some of my mapfile
> CONFIG PROJ_LIB "E:\DNDIntranet\mapserv\scripts\proj\"
> CONFIG GDAL_DRIVER_PATH "E:\DNDIntranet\mapserv\scripts\fw\gdal_plugins\"
> NAME REMSPROP
> #meters EXTENT 225033.887 885954.489 245303.531 905462.069
> EXTENT 738152.213543900 2907686.126484261 797440.9488538101
> 2970773.30444638
> SIZE 500 500
> SHAPEPATH "F:\Mapservdata"
> UNITS feet
> SYMBOLSET symbols/symbols35.sym
> FONTSET symbols/fonts/font.lst
> IMAGETYPE jpeg
> TEMPLATEPATTERN "printable.html|loader.html|blankloader.htm"
> PROJECTION
> "init=epsg:2249"
> #"init=epsg:26986"
> END
>
> LAYER
> NAME "bosaerial2001"
> STATUS DEFAULT
> TILEINDEX "bostonsidtiles.shp"
> TILEITEM "Location"
> MINSCALE 300
> MAXSCALE 5000
> TYPE RASTER
> PROJECTION
> "init=epsg:26986"
> END
> PROCESSING "COLOR_MATCH_THRESHOLD=6"
> PROCESSING "SCALE_1=0,255"
> PROCESSING "SCALE_2=0,255"
> PROCESSING "SCALE_3=0,255"
> END
>
> LAYER
> NAME "neighborhoods"
> CONNECTIONTYPE postgis
> DATA "the_geom from neighborhoods"
> CONNECTION "user=propuser dbname=dnddts host=localhost"
> # PROJECTION
> #AUTO
> # "init=epsg:2249"
> # END
> TYPE POLYGON
> STATUS default
> CLASS
> OUTLINECOLOR 30 0 0
> END
> END
>
> LAYER
> NAME "parcels"
> CONNECTIONTYPE postgis
> DATA "the_geom from landparcels USING UNIQUE parcel_id"
> CONNECTION "user=propuser dbname=dnddts host=localhost"
> STATUS DEFAULT
> TYPE POLYGON
> MAXSCALE 5000
> CLASS
> NAME "Parcel Footprint"
> OUTLINECOLOR 100 100 200
> LABEL
> POSITION CL
> SIZE MEDIUM
> COLOR 0 150 0
> END
> END
> TEMPLATE loader.html
> END
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 09 May 2005 17:10:09 +0200
> From: Didrik Pinte <dpinte at itae.be>
> Subject: Re: [postgis-users] postgis bool::text and mapserver
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <1115651409.1274.34.camel at geru-itea>
> Content-Type: text/plain; charset="iso-8859-15"
>
> Le lundi 09 mai 2005 à 10:56 -0400, Stephen Woodbridge a écrit :
>> Try EXPRESSION ( [moved] =~ /t/)
>>
>> -Steve
>
> Hi Steve,
>
> Here are all my tests :
>
> EXPRESSION ( [moved] = 't')
> EXPRESSION ( [moved] = "t")
> EXPRESSION ( [moved] eq 't')
> EXPRESSION ( [moved] eq "t")
> EXPRESSION ( [moved] =~ /t/)
>
> None of those test work
>
> Didrik
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 189 bytes
> Desc: This is a digitally signed message part
> Url :
> http://lists.refractions.net/pipermail/postgis-users/attachments/20050509/5a8f6478/attachment-0001.bin
>
> ------------------------------
>
> Message: 8
> Date: Mon, 9 May 2005 17:25:40 +0200
> From: strk at refractions.net
> Subject: Re: [postgis-users] pgsql2shp changing case of fieldnames
> To: "'PostGIS Users Discussion'"
> <postgis-users at postgis.refractions.net>
> Message-ID: <20050509152540.GA98527 at keybit.net>
> Content-Type: text/plain; charset=us-ascii
>
> On Mon, May 09, 2005 at 10:18:52AM -0400, Obe, Regina DNDMIS wrote:
>> I noticed the 3/31/05 build of pgsql2shp I have now automatically forces
>> the
>> output field names to upper case which normally would be a good thing.
>> Unfortunately I've got some old mapserver maps that rely on the field
>> names
>> in the dbf being in lowercase. Is there anyway to reverse this behavior
>> e.g. with a switch or something of that sort so that I don't have to
>> revert
>> back to the older version of pgsql2shp?
>>
>> Thanks,
>> Regina
>
> Which version of pgsql2shp doesn't do that ?
> I guess we can revert the change back ... or add a -k switch
> to it as well.
>
> Does anyone see a problem with this ?
>
> --strk;
>
>
> ------------------------------
>
> Message: 9
> Date: Mon, 09 May 2005 18:46:15 +0200
> From: Didrik Pinte <dpinte at itae.be>
> Subject: Re: [postgis-users] postgis bool::text and mapserver
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <1115657175.1274.38.camel at geru-itea>
> Content-Type: text/plain; charset="iso-8859-15"
>
> Le lundi 09 mai 2005 à 18:10 +0200, Nicol Hermann a écrit :
>> Hi Didrik,
>>
>> did you try:
>>
>> EXPRESSION ('[moved]' = 't')
>> or
>> EXPRESSION ("[TYPE]" = "Paved")
>>
>> with the string conversion?
>> HTH
>> Nicol
>
> That solved the problem !!!!!
>
> Many many thanks !
>
>
> Didrik
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 189 bytes
> Desc: This is a digitally signed message part
> Url :
> http://lists.refractions.net/pipermail/postgis-users/attachments/20050509/b129fdc2/attachment.bin
>
> ------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> End of postgis-users Digest, Vol 31, Issue 23
> *********************************************
More information about the postgis-users
mailing list