[Geomoose-users] EXPRESSIONS
Dan Little
danlittle at yahoo.com
Tue Feb 12 11:07:16 EST 2008
Jay,
It looks like you may have borrowed some code from the SLP guys. They have their dates encoded using an integer format: YYMMDDHHMISS (or something dead similar).
That's why their code works. Right now Mapserver cannot do the date comparison, but GeoMOOSE can reformat dates into integers and Mapserver CAN do the integer comparison.
-Duck
----- Original Message ----
From: Jim Klassen <Jim.Klassen at ci.stpaul.mn.us>
To: jkapalczynski at ci.maple-grove.mn.us; geomoose-developers at lists.sourceforge.net; geomoose-users at lists.sourceforge.net
Sent: Tuesday, February 12, 2008 9:54:14 AM
Subject: Re: [Geomoose-users] EXPRESSIONS
I
don't
think
you
can
do
date/time
comparisons
using
CGI
Mapserver.
I
think
it
is
just
treating
the
date
as
a
string.
One
thing
you
could
do
is
add
a
field
to
the
DBF
file
that
stores
the
date
as
an
integer
encoded
as
the
number
of
days
past
a
certain
time
(say
Jan
1
2000)
and
then
you
could
use
the
integer
comparison
methods.
If
you
regenerate
the
file
often,
you
could
just
have
the
extra
column
be
the
number
of
days
old
the
record
is
and
not
have
to
pass
in
the
extra
parameter.
I
think
this
is
where
most
people
suggest
going
to
a
database
driven
(PostGIS)
data
source
so
you
can
use
a
select
statement
to
calculate
the
extra
column
on
the
fly.
>>>
"Jay
Kapalczynski"
<jkapalczynski at ci.maple-grove.mn.us>
02/12/08
9:35
AM
>>>
I
narrowed
the
expression
down
a
bit
and
got
it
to
work....
CLASS
NAME
'Last
Week'
EXPRESSION
('[Geo_Simple]'
=
'BURGLARY')
COLOR
197
0
255
SYMBOL
"star"
SIZE
12
END
So
the
problem
is
with
the
End
of
the
Expression
and
how
it
is
trying
to
calculate
dates
for
"LAST
WEEK"
,
"LAST
TWO
WEEKS"
etc.....
The
.map
file
is
correct
minus
the
Time/Date
and
the
.xml
is
correct....the
points
show
up...I
need
the
date
thing
to
work
What
code
am
I
missing
to
calculate
the
date
range....or
where
that
would
be
coded?
Any
thoughts...
From:
Jay
Kapalczynski
Sent:
Tuesday,
February
12,
2008
8:44
AM
To:
'geomoose-users at lists.sourceforge.net';
geomoose-developers at lists.sourceforge.net
Subject:
EXPRESSIONS
I
have
been
messing
around
with
Expressions
and
cant
seem
to
get
it
right...I
am
missing
something
If
I
eliminate
the
red
line
below
the
Symbols
appear
on
the
map...so
I
can
assume
that
the
problem
is
with
the
Expression
My
shapefile
has
the
two
fields
below
Geo_Simple
=
Text
field
with
"BURGLARY"
as
the
value
for
all
records
Geo_Time
=
Date
Field
in
this
format..."2/8/2008"
DOES
ANYONE
know
why
the
expression
is
not
working....Is
there
some
code
that
I
am
missing???????
Am
I
missing
the
reference
to
the
%LASTWEEK%????????????
THANKS
IN
THE
"Burglaries_8bit.map"
FILE
LAYER
NAME
'BURGLARIES'
DATA
'./Burglaries.shp'
TYPE
POINT
STATUS
DEFAULT
CLASS
NAME
'Last
Week'
EXPRESSION
('[Geo_Simple]'
=
'BURGLARY'
AND
'[Geo_Time]'
>
'%LASTWEEK%')
COLOR
197
0
255
SYMBOL
"star"
SIZE
12
END
HEADER
'header.xml'
TEMPLATE
'record.xml'
FOOTER
'footer.xml'
END
END
##
end
Map
IN
THE
XML
FILE
<map
title="BURGLARIES"
default="true"
reference="false"
popups="false"
data="false">
<param
type="today"
offset="-7"
name="LASTWEEK"
format="%2Y%2M%2D000000"/>
<param
type="today"
offset="-14"
name="LASTTWOWEEKS"
format="%2Y%2M%2D000000"/>
<param
type="today"
offset="-30"
name="LASTTHIRTY"
format="%2Y%2M%2D000000"/>
<param
type="today"
offset="-90"
name="LASTNINTY"
format="%2Y%2M%2D000000"/>
<file>/ms4w/apps/GeoMOOSE/maps_statedemo/Burglaries/Burglaries_8bit.map<
/file>
</map>
WITH
THE
EXPRESSION:
WITHOUT
THE
EXPRESSION:
-------------------------------------------------------------------------
This
SF.net
email
is
sponsored
by:
Microsoft
Defy
all
challenges.
Microsoft(R)
Visual
Studio
2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geomoose-users
mailing
list
Geomoose-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geomoose-users
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20080212/5274b261/attachment.html
More information about the Geomoose-users
mailing list