map gps coordinates with CGI/ (java or Perl)

P Kishor punkish at EIDESIS.ORG
Mon Jul 31 11:41:26 PDT 2006


ya then...

On 7/31/06, Joel Thompson <joel at rhinosystemsinc.com> wrote:
> Thanks for the feedback. I really appreciate it alot.
>
> By dynamically I meant that the CGI would some be given the
> coordinates at runtime - either read from db, or passed as PARAMETERS
> in CGI ... and so actually I don't need help in setting up that part.

so, it is not dynamic in as I thought of dynamic -- as in, a moving
dot on the screen. The above is plain, vanilla MapServer, so you are
set there.

> What I would like to know is what is the best approach for dealing
> with the list of Long/Lats???
>
> 1) Is it to create a MAP file w/ layers and features? OR
> 2) create a SHAPE file? OR
> 3) Is this kind of behavior already built into the MAP or MapServer
> some how?
> 4) Are their tools that help with this sort of stuff? Like GRASS or
> something else?

Well, MapServer will need a .map file with layer definitions. There is
no way around that. That is the direction that MapServer needs. That
said, within the .map file, you can define the layer as a shapefile
(in which case, you will need to create a shapefile), or you might
even be able to define it as an OGR datasource (although, once again,
I am skating on thin-ice here... truth be told, I have been doing more
data-munging lately instead of actually working with MapServer).

Whether you have to convert your lon/lat into a shapefile or define it
as an OGR datasource, FW's eponymous tools will help you greatly. You
can use ogr2ogr to convert lon/lat into shapefile, for which, you will
have to set up a .ovf file anyway (c'est compliqué, non?). Search for
ogr2ogr and FW_tools on the MapServer website.

> 5) Also - I am having problems setting up the Perl MapScript env -
> I can't get/find any directions on how to integrate the Perl modules into
> MapServer - Yet Perl works from Apache as a plain-old-cgi env.
> So I am wondering if I should attempt #1, or #2 in this CGI w/o the
> perl map module? or should I keep attempting to get the Perl Module
> integrated... (seemed straight forward, but not quite since I download
> prebuilt MapServer for Windows 2k and can't rebuild to integrated
> PERL...sigh..)

This is the main reason I have not been using MapServer lately. Afaik,
Perl/MapScript does not work on Windows, and I am, in my current phase
in life, stuck with Windows for some time. Other flavors of MapScript
apparently work on Windows, but I have little interest in those
languages.

If anyone has been able to build Perl/MapScript on Windows
successfully, please share the knowledge. (Steve Lime, le père de
MapServer, might be able to confirm this; then maybe not).



> P Kishor wrote:
>
> > Joel,
> >
> > I don't have a specific suggestion for you, but I offer the following
> > to think about... You asked --
> >
> >> > I'd like to map GPS lat/long coordinates dynamically through CGI
> >
> >
> > First, what does "dynamically" mean?
> >
> > You will have to somehow transfer the lon/lat from the GPS to the
> > computer that hosts MapServer. So, that is your first task.
> >
> > Then you will have to convert the lon/lat into x,y point features that
> > MapServer can read. That is your second task.
> >
> > Then you will have to create an web app that refreshes every few
> > seconds in order to be qualified as "dynamically." That is your final
> > task.
> >
> > Your best bet might be to send the GPS stream into a PostGIS database,
> > and set up a MapServer map file that reads that data source. Write an
> > Ajax-y app that refreshes the map without touching the rest of the
> > cruft, and you have a dynamic app.
> >
> > When you get it all hooked up and working, I would love to see it and
> > happily plagiarize it ;-). Better yet, you can write up a nice how-to,
> > and attach your app for the rest of us to benefit.
> >
> > Seriously, search the list archives. If I recall correctly, this kind
> > of stuff has been asked, and done before.
> >
> > On 7/28/06, Joel Thompson <joel at rhinosystemsinc.com> wrote:
> >
> >> Hi Guys - sorry to bug you again, but can someone give me some general
> >> direction?
> >>
> >> 1) should I try to manipulate the map file directly through the CGI env?
> >> If so, what would a sample map file look like to that showed, say Cities
> >> and the lat/lon coordinates that I provide to show a route...?
> >>
> >> 2) Or do I have to use CGI (perl, php...etc.) w/ its API into the
> >> MapScript to execute this some how? Not sure at all how to do this, so a
> >> simple sample would be very helpful.
> >>
> >> 3) or is there some other CGI type tools that does this for me already?
> >> IE. Just pass in a list of lat/lon pairs and it would map it out for me?
> >>
> >>
> >> Thanks for you help... I really appreciate it,
> >> Joel
> >>
> >> Joel Thompson wrote:
> >>
> >> >
> >> > Hello,
> >> >
> >> > I'd like to map GPS lat/long coordinates dynamically through CGI
> >> > (preferred JAVA,perl, php, in that order) - I am new to MapServer...
> >> > Can you help me to get in the right direction with this? is there any
> >> > add-on tools that do this? or is is just done through the .map w/ html
> >> > template architecture... where the CGI is used to create the HTML
> >> file???
> >> > Any samples would be nice... Thanks in advanced.
> >> >
> >> > -Joel
> >>
> >
> >
>
>
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.ies.wisc.edu/
Open Source Geospatial Foundation https://edu.osgeo.org/



More information about the MapServer-users mailing list