OGR Virtual
Emil Zegers
taatuut at PLANET.NL
Thu Feb 9 12:41:07 PST 2006
Hello Mark,
Have you tried adding a PROJECTION to the LAYER containing the ovf file
and/or the ovf file?
Something like:
LAYER
NAME "Virtual Parcel"
DEBUG ON
STATUS DEFAULT
CONNECTIONTYPE OGR
CONNECTION "parcel_test.ovf"
DATA "parcel_test"
TYPE POLYGON
# fill projection parameter, e.g. 28992 for Dutch system
PROJECTION
"init=epsg:12345"
END
TEMPLATE "null"
CLASS
NAME "Virtual Parcel"
STYLE
COLOR 255 1 5
OUTLINECOLOR 168 112 0
END
END
END
In the past I had situations where I needed to put the PROJECTION in the
LAYER and not in the OVF file.
Also, use STATUS DEFAULT for testing purposes so the layer is always on.
Regards,
Emil
-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
Behalf Of Mark Adams
Sent: donderdag 9 februari 2006 21:12
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] OGR Virtual
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