OGR and oracle (MS4W 1.5)

listuser HH listuser at HERZSYS.DE
Tue Apr 4 04:33:44 EDT 2006


Frank Warmerdam wrote:

> 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,

Hi Frank,

thanks again for your help. I expected that is better to use SrcLayer. I 
checked the driver page and I saw that I used ",table" when I tested but 
it must be ":table". Now the SrcLayer works if I give the table with the 
datasource.

Best regards

Norbert



More information about the mapserver-users mailing list