OGR Virtual

Mark Adams markadams at CUESTASYS.COM
Thu Feb 9 15:11:56 EST 2006


Hello,

I would like to know if there was ever a successful resolution to Frank's
question below. I am in the same situation: I cannot get the OGR virtual
layer to render on my map.

I have had no problem with points. However when I try to render a virtual
polygon I get no error, just no feature on the map. The other layers all
render without problem. I get no error from OGRINFO either.

I've tried a number of different ways of configuring the OVF file, the
data in the database, and the MAP file. Numerous combinations result
in "success" in the sense of no errors, but still no features.

Here is my most recent attempt:
Connection: I'm using an ODBC connection to an MS Access database. The
ODBC connection is called "parcel_test".

OVF:
<OGRVRTDataSource>
    <OGRVRTLayer name="parcel_test">
        <SrcDataSource>ODBC:parcel_test,PROPERTY_VIRTUAL</SrcDataSource>
  <SrcSQL>SELECT GEOMETRY FROM PROPERTY_VIRTUAL</SrcSQL>
 <GeometryType>wkbPolygon</GeometryType>
 <GeometryField encoding="WKT" field="GEOMETRY"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

MAP:
  LAYER
    NAME "Virtual Parcel"
    DEBUG ON
    STATUS ON
    CONNECTIONTYPE OGR
    CONNECTION "parcel_test.ovf"
    DATA "parcel_test"
    TYPE POLYGON
    TEMPLATE "null"
    CLASS
      NAME "Virtual Parcel"
      STYLE
        COLOR 255 1 5
        OUTLINECOLOR 168 112 0
      END
    END
  END

I've got one record in the PROPERTY_VIRTUAL table, with the GEOMETRY value
set as follows:
POLYGON('501453.34 4800585.97,501576.14 4800590.44,501569.85
4800522,501471.61 4800521.63,501453.34 4800585.97')

I've also tried storing the geometry without the quotes, brackets, and
keyword POLYGON but it doesn't change the result.

I've captured this output when I refresh the map:
msOGRFileOpen(parcel_test.ovf)...
OGROPen
(\\Snow\c_drive\Inetpub\wwwroot\NTGO_GeoPortal\config\..\Data\Shapefiles/pa
rcel_test.ovf)
msOGRLayerClose(parcel_test.ovf).
msOGRFileClose
(\\Snow\c_drive\Inetpub\wwwroot\NTGO_GeoPortal\config\..\Data\Shapefiles/pa
rcel_test.ovf,0).
msDrawMap(): Layer 3 (Virtual Parcel), 0.130s
msDrawMap(): Layer 4 (Property Parcels), 0.101s
msDrawMap(): Layer 6 (Streets), 0.030s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.281s
msOGRFileOpen(parcel_test.ovf)...
OGROPen
(\\Snow\c_drive\Inetpub\wwwroot\NTGO_GeoPortal\config\..\Data\Shapefiles/pa
rcel_test.ovf)
msOGRLayerClose(parcel_test.ovf).
msOGRFileClose
(\\Snow\c_drive\Inetpub\wwwroot\NTGO_GeoPortal\config\..\Data\Shapefiles/pa
rcel_test.ovf,0).
msDrawMap(): Layer 3 (Virtual Parcel), 0.110s
msDrawMap(): Layer 4 (Property Parcels), 0.070s
msDrawMap(): Layer 6 (Streets), 0.030s
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.220s



More information about the mapserver-users mailing list