OGR and oracle (MS4W 1.5)
Frank Warmerdam
warmerdam at POBOX.COM
Mon Apr 3 10:14:36 PDT 2006
listuser HH wrote:
> Frank Warmerdam wrote:
>
>> listuser HH wrote:
>>
>>> Hi Frank,
>>>
>>> thanks for the answer. You are right something in the connection is
>>> failing. I used SrcLayer for the data source definition - when I use
>>> SrcSQL with a "select * .." it works.
>>
>>
>> Norbert,
>>
>> The datasource definition (OCI:...) should go in the SrcDataSource tag.
>> The SrcLayer should contain the name of the table you wish to operate on.
>> You might want to use ogrinfo against the datasource to ensure that you
>> are using the right name for the layer (table) as it might contain
>> prefixes.
>>
>> Best regards,
>
> Hi again,
>
> I tried it like that. When I used orginfo on the datasource only one
> table was shown. This was the table which has sdo geometry.
>
> Here is my .ovf content for the x/y data table:
>
> <OGRVRTDataSource>
> <OGRVRTLayer name="netzknoten">
> <SrcDataSource>OCI:[..]</SrcDataSource>
> <SrcLayer>strassennetz.tmp_vw_netzknoten</SrcLayer>
> <GeometryType>wkbPoint</GeometryType>
> <LayerSRS>EPSG:31467</LayerSRS>
> <GeometryField encoding="PointFromColumns" x="KOORDINATE_X"
> y="KOORDINATE_Y"/>
> </OGRVRTLayer>
> </OGRVRTDataSource>
>
> This produced the TNS problem. After that I changed SrcLayer to SrcSQL
> and added "select * from" and it worked.
Norbert,
Hmm, I have no idea why this would give you the TNS issue (assuming
thee are no XML escaping issues). However, if strassennetz.tmp_vw_netzknoten
isn't listed as a layer name when you do "ogrinfo OCI:[..]" then it won't
be available for SrcLayer.
If there are any spatial tables in Oracle, then the OCI driver will only treat
spatial tables as layers. If there are none, I think all non-spatial tables
will be treated as layer.
I believe there is a way of encoding a specific list of tables to treat as
layers in the datasource name. Check the OCI driver page. I only press
on this issue because there are performance and "correctness" issues with
using SrcSQL. So it should be avoided unless it is needed.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGF, http://osgeo.org
More information about the MapServer-users
mailing list