[MAPSERVER-DEV] How to generate 3d image like GPS device?

Brent Fraser bfraser at geoanalytic.com
Mon Mar 10 12:49:09 EDT 2008


Thomas,

  Sharing ideas (and solutions!) is what this list is all
about.

  As for advancing the implementation for 3d, it depends on
the need.  If you look at Stephen's original jpeg, there are
a few things that make the simple X scaling a no-go:
1. Text labels are "up-right" instead of laid flat.
2. The "Y" distance is scaled as well as "X"
3. Other information (distance, street name) on the bottom
dashboard and top status bar

Since the display graphic is attempting to approximate the
view you see out the windshield, somebody will ask for:
A. Show the map draped over a DEM
B. Render buildings (with photo textures)
C. Show [real-time] traffic

Or maybe not; sometimes simpler is better, especially when
you are driving.

(And how to implement that turn indicator symbol is a real
interesting problem.)

    Anyway, with all the [potential] special non-planimetric
stuff associate with 3d, perhaps it would be better to use
the traditional Mapserver-generated planimetric image as
input to a 3d navigation-graphic server.  We've done some
experimental code in VTP (www.vterrain.org) to read a GPS
stream and display a real-time perspective view, but there
are some limitations with that approach too
(non-client/server, hefty graphic card requirements,
pre-configured geographic extents, etc).

  Maybe adding a "post-processing" plugin capability to
Mapserver is the way to go?  That way the functionality (and
doc, etc) could be kept logically separate from the
traditional Mapserver.  It could have it's own "map" file to
configure the other graphic elements.

In the end, will it turn into a mapper-friendly POV-Ray (not
necessarily a bad thing)?

Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta

----- Original Message ----- 
From: "thomas bonfort" <thomas.bonfort at gmail.com>
To: <mapserver-dev at lists.osgeo.org>
Sent: Saturday, March 08, 2008 12:30 PM
Subject: Re: [MAPSERVER-DEV] How to generate 3d image like
GPS device?


> oops... just (re?)read the thread and see that I
implemented exactly
> what you where proposing, sorry for the paternity of that
;) although
> I think that if we do go along this line, it might be more
flexible to
> use a real projection matrix rather than limiting
ourselves to this
> kind of scaling.
>
> rotation wrt to north facing upwards will probably be a
bit more
> problematic, as the letters of labels are oriented to be
readable when
> the map is oriented to the north and could possibly be
upside down if
> requesting a rotated view, but I think it may be overcome
with a
> specialized msTransformShapeXXX function that could
account for the
> rotational part of the requested view. we'd still have to
investigate
> how to treat the extent of the requested view wrt clipping
of shapes
> though.
>
> I'll add myself to the soc wiki page on this subject
>
> regards,
> thomas
>
> >  On Wed, Feb 27, 2008 at 5:27 PM, Brent Fraser
<bfraser at geoanalytic.com> wrote:
> >  > Stephen,
> >  >
> >  >   A cheap way to approximate the projective
transformation
> >  >  might be to apply a x-axis scaling with the scaling
factor
> >  >  varying linearly along the y-axis, basically
squishing it at
> >  >  the top.  In other words, render the map image, then
> >  >  resample each line of pixels (with a resampling
value of say
> >  >  10% for the top line of pixels to 100% of the bottom
line),
> >  >  then clip and add other stuff (sky etc).  Then
there's the
> >  >  problem of heading-up instead of north-up.  The map
file
> >  >  does have a rotation setting, which might help.
> >  >
> >  >   In the end, I think a more rigorous projective
> >  >  transformation would give better results (preserving
line
> >  >  widths, etc).  And there may be so many "special"
features
> >  >  that it would make more sense to have a separate
"NavServer"
> >  >  (with its own map file/API objects) instead of
> >  >  warping/adding-noise to the more traditional
MapServer to do
> >  >  the task.  But as Steve Lime say, it would be cool
to see in
> >  >  Mapserver.  And 3d is the future...
> >  >
> >  >  Brent Fraser
> >  >  GeoAnalytic Inc.
> >  >  Calgary, Alberta
> >  >
> >  >
> >  >  ----- Original Message -----
> >  >  From: "Stephen Woodbridge" <woodbri at SWOODBRIDGE.COM>
> >  >  To: <MAPSERVER-DEV at LISTS.UMN.EDU>
> >  >
> >  > Sent: Wednesday, February 27, 2008 7:57 AM
> >  >  Subject: Re: [MAPSERVER-DEV] How to generate 3d
image like
> >  >  GPS device?
> >  >
> >  >
> >  >
> >  >
> >  > > Tamas Szekeres wrote:
> >  >  > > 2008/2/27, Stephen Woodbridge
<woodbri at swoodbridge.com>:
> >  >  > >> Hi all,
> >  >  > >>
> >  >  > >>  Sorry for the cross posting. I need to find
out how to
> >  >  make mapserver
> >  >  > >>  generate map images that appear like the 3D
mode of
> >  >  GPS devices. See
> >  >  > >>  attached image.
> >  >  > >>
> >  >  > >>  Has anyone done this? How?
> >  >  > >>  Any thoughts on how to to hack the code to do
this?
> >  >  > >>
> >  >  > >
> >  >  > > Stephen,
> >  >  > >
> >  >  > > I think we should add a special renderer for
doing such
> >  >  things, and it
> >  >  > > would require to do some additional coordinate
> >  >  transformations for the
> >  >  > > shapes and additional special effects like
drawing the
> >  >  horizon and
> >  >  > > use gradient fade out for distant areas etc. I
don't
> >  >  think it would be
> >  >  > > a scope of instant hack in the code.
> >  >  >
> >  >  > Tamas,
> >  >  >
> >  >  > Thank you for your response.
> >  >  >
> >  >  > Yes, you may be right. I think there are a variety
of
> >  >  levels of
> >  >  > implementation. Initially just getting mapserver
to render
> >  >  a tilted view
> >  >  > without all the special effects would be a start.
I was
> >  >  thinking of the
> >  >  > possibility of hacking the projection matrix to
achieve
> >  >  this, although
> >  >  > I'm not sure how or if that is possible.
> >  >  >
> >  >  > The image also has an implied point of viewer that
is used
> >  >  to orient
> >  >  > "up" for the image.
> >  >  >
> >  >  > > I wonder which use case would make this option
> >  >  reasonable though. Are
> >  >  > > you planning to utilize a permanent
client-server
> >  >  connection with the
> >  >  > > mobile application, or compile mapserver to your
mobile
> >  >  platform?
> >  >  >
> >  >  > Mobile devices can be Windows/Linux laptops along
with
> >  >  those normally
> >  >  > thought of as mobile.
> >  >  >
> >  >  > Best regards,
> >  >  >    -Steve W
> >  >  >
> >  >  > > Best regards,
> >  >  > >
> >  >  > > Tamas
> >  >
> >
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>



More information about the mapserver-dev mailing list