Hi,

 I'm trying to get point data out of mysql to display on a map. I'm using the following .ovf file, which I've tested using ogrinfo and seems to work fine.

<OGRVRTDataSource>
    <OGRVRTLayer name="test_gis">
        <SrcDataSource>MYSQL:test_gis,user=root,password=mypword,host=127.0.0.1,port=3306,tables=boxes</SrcDataSource>
        <SrcSQL>SELECT fid, x, y FROM boxes</SrcSQL>
        <GeometryType>wkbPoint</GeometryType>
        <GeometryField encoding="PointFromColumns" x="x" y="y" z="z"  />
    </OGRVRTLayer>
</OGRVRTDataSource>

When I go to the jsp that draws the map I get these errors:

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Failed to draw layer named 'test_gis'.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java :802)

root cause

javax.servlet.ServletException: Failed to draw layer named 'test_gis'.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException (PageContextImpl.java:791)
org.apache.jsp.boxes.dartmoor_005fpoints_jsp._jspService(dartmoor_005fpoints_jsp.java:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service (HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service (JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.UnknownError: Failed to draw layer named 'test_gis'.
edu.umn.gis.mapscript.mapscriptJNI.mapObj_draw (Native Method)
edu.umn.gis.mapscript.mapObj.draw(mapObj.java:382)
org.apache.jsp.boxes.dartmoor_005fpoints_jsp._jspService(dartmoor_005fpoints_jsp.java:56)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java :97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java :314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


I've tried loads of different things in the .map file (below) but I still end up with the same problem. Does anyone know what I'm going wrong?

Thanks,
Sarah

Map file:

MAP
    NAME DARTMOOR_POINTS
    STATUS ON
    SHAPEPATH "/usr/local/apache-tomcat-5.5.17/webapps/ROOT/boxes/"
    EXTENT 250000.000000 57000.000000 260000.000000 70000.000000
    SIZE 400 400

    WEB
        IMAGEPATH "/usr/local/apache- tomcat-5.5.17/webapps/ROOT/temp/"
        IMAGEURL "/temp/"
    END

    LAYER
        NAME "test_gis"
        STATUS ON
        TYPE POINT
            PROJECTION
                "proj=latlong"
                "ellps=WGS84"
                "datum=WGS84"
            END
        CONNECTIONTYPE OGR
        CONNECTION "test_gis.ovf"
        DATA "test_gis"
        CLASS
            NAME "boxes"
            SYMBOL 0
            COLOR 0 0 0
            OUTLINECOLOR 255 0 0
        END
    END
END

JSP File

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<%@ page import = "edu.umn.gis.mapscript.mapObj" %>
<%@ page import = "edu.umn.gis.mapscript.imageObj" %>

<%     mapObj vMap;
    String vMapName = "/usr/local/apache-tomcat-5.5.17/webapps/ROOT/boxes/dartmoor_points.map";
    vMap = new mapObj(vMapName);
    String vMapFile = "/usr/local/apache-tomcat-5.5.17/webapps/ROOT/boxes/dartmoor_points.mapfile";
    vMap.setMappath(vMapName);
    imageObj img = vMap.draw();
    img.save(vMapFile,vMap);


%>
<head>
</head>
<body>
Image:<br>
<image src=""></body>
</html>



Reply via email to