If you were Registered and logged in, you could reply and use other advanced thread options
Hello.
I have an urgent problem and would hope to get some technical advice
here.
I am working on a Java-based fleet management system which uses
MapInfo MapXtreme Java Edition servlet technology for its GIS. We
track vehicles on the road using GPS and positional info are sent back
to the backend system through GPRS and stored in the database. We have
a playback function where the individual vehicle positions are read
from the database and drawn onto the GIS map. However, recently it was
found that this feature is not working. The vehicle positions seems to
have been obtained successfully from the database and the code to draw
the points onto the map seems to be correct. But the map just don't
display the points. I tried many means to trace and fix the problem
but still cannot get it to work. I highly suspect it could be our own
map servlet or the MapXtremeServlet issue.
This is our GIS architecture:
JSP <==> Client Applet <===> Our own map servlet <===>
MapXtremeServlet <== MapInfo TAB files
Our own map servlet will interface with the Oracle database to get the
vehicle positions and draw them out on the map using the
MapXtremeServlet. The generated image data is then sent to the client
applet to be displayed on the web browser.
This is the hardware and software platform in which our system is
running on:
Server = Pentium 4 2GHz, 1.3GB RAM
Free Harddisk space (C:) = 1GB (Not enough memory to display
properly?)
Java VM = 1.4.2_06 (There are many other versions of JRE installed.
Could this be the problem?)
Map engine = MapXtreme Java Edition 3.1
OS = Windows 2000 SP4
Browser = Internet Explorer 5.00.3700.1000 SP4 (Browser version too
old?)
Web server = JRun 3.1
Database server = Oracle 9.2
Below is a snippet of our map servlet and the method to perform the
display of vehicle track playback.
////////////////////////////////////////////////////////////////////////////////////
// Code snippet starts below
public class OurMapServlet extends HttpServlet
{
... ...
public void service(HttpServletRequest httpservletrequest,
HttpServletResponse httpservletresponse)
throws ServletException, IOException
{
HttpSession httpsession = httpservletrequest.getSession(true);
if(httpservletrequest.getParameter("init") != null)
{
... ...
}
else
{
try
{
renderMap(httpsession, httpservletrequest,
httpservletresponse);
}
catch(ServletException servletexception)
{
... ...
}
}
}
private void renderMap(HttpSession httpsession, HttpServletRequest
httpservletrequest, HttpServletResponse httpservletresponse)
throws Exception
{
... ...
if(i != 0)
{
... ...
switch(i)
{
case 40:
if(httpservletrequest.getParameter("vehno") != null &&
httpservletrequest.getParameter("startTm") != null &&
httpservletrequest.getParameter("endTm") != null)
{
String s17 =
httpservletrequest.getParameter("vehno");
String s21 =
httpservletrequest.getParameter("startTm");
String s25 =
httpservletrequest.getParameter("endTm");
s17 = s17.trim();
hisTrackVeh(mapj, s17, s21, s25);
}
break;
}
}
... ...
}
private void hisTrackVeh(MapJ mapj, String s, String s1, String
s2)
{
Layer layer = mapj.getLayers().getLayer("hislayer");
if(layer != null)
mapj.getLayers().remove("hislayer");
String as[] = {
"vehicleid"
};
String s3 = "select
LONGITUDE,LATITUDE,VEHICLEID,STATUS,CREWID,TO_CHAR(EVNTIME,'HH24:MI')
from VEHLOG where VEHICLEID='" + s + "' AND EVNTIME >= TO_DATE('" +
s1 + "', 'dd/mm/yyyy hh24:mi:ss') AND EVNTIME <= TO_DATE('" + s2 +
"', 'dd/mm/yyyy hh24:mi:ss')";
RenditionType renditiontype = RenditionType.none;
com.mapinfo.coordsys.CoordSys coordsys =
mapj.getDisplayCoordSys();
XYDataProviderHelper xydataproviderhelper = new
XYDataProviderHelper("oracle.jdbc.driver.OracleDriver", m_oraset,
"dbuser1", "dbuser1");
XYTableDescHelper xytabledeschelper = new
XYTableDescHelper(s3, as, "LONGITUDE", "LATITUDE", null,
renditiontype, coordsys);
try
{
LocalDataProviderRef localdataproviderref = new
LocalDataProviderRef(xydataproviderhelper);
try
{
Layer layer1 =
mapj.getLayers().insert(localdataproviderref, xytabledeschelper, 0,
"hislayer");
layer1.setQueryBuilder(new IdentityQueryBuilder());
Rendition rendition = new Rendition();
rendition.setValue(Rendition.SYMBOL_MODE,
com.mapinfo.dp.Rendition.SymbolMode.IMAGE);
rendition.setValue(Rendition.SYMBOL_URL, m_iconURL +
"red.gif");
OverrideTheme overridetheme = new
OverrideTheme(rendition, "his");
layer1.getThemeList().add(overridetheme);
LabelProperties labelproperties =
layer1.getLabelProperties();
Rendition rendition1 = new Rendition();
rendition1.setValue(Rendition.FONT_FAMILY, "Arial");
rendition1.setValue(Rendition.FONT_SIZE, new
Float(10F));
rendition1.setValue(Rendition.FONT_WEIGHT, new
Float(2.0F));
rendition1.setValue(Rendition.SYMBOL_FOREGROUND,
Color.black);
labelproperties.setRendition(rendition1);
labelproperties.setLabelColumn(5);
DoublePoint doublepoint = new DoublePoint(0.0D, 0.0D);
labelproperties.setOffset(doublepoint);
labelproperties.setHorizontalAlignment(LabelProperties.HORIZ_ALIGN_CENTER);
labelproperties.setVerticalAlignment(LabelProperties.VERT_ALIGN_TOP);
labelproperties.setOverlapAllowed(true);
layer1.setLabelProperties(labelproperties);
layer1.setAutoLabel(true);
}
catch(Exception exception1)
{
exception1.printStackTrace();
}
}
catch(Exception exception)
{
exception.printStackTrace();
}
}
... ...
}
// Code snippet ends here
///////////////////////////////////////////////////////////////////
Does anyone know what could be the problem and how to fix it? It is an
urgent issue and any help will be greatly appreciated.
Many thanks.
Yee Peng
Senior Engineer
- MapInfo.Professional.v7.8, AVL SWIFT V3.1.1, AVL FIRE V8.2, AVL WORKSPACE V3.1.1 SUITE, AVL WORKSPACE V4.0 SUITE, MAPINFO PRO V7.5, MAPINFO MAPXTREME V4.70.36, NTF to MapInfo File Converter v1.0, MAPINFO MAPXTREME JAVA EDITION V4.5, MapInfo MapX v5.02,
- Geographic Information Systems (GIS)
- 2005-03-06
- Problem with new Nuvi 780
- Garmin GPS
- 2008-03-01
- POI Problem with Garmin Legend Cx
- Garmin GPS
- 2007-03-15
