[gdal-dev] Issue with OCI driver

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Issue with OCI driver

san619
i tried to extract shapefile data table from oracle to shapefile.
But im getting error :

*Can't transform coordinates, source layer has no
coordinate system.  Use -s_srs to set one.
ERROR 1: Terminating translation prematurely after failed
translation from sql statement.*

I tried exporting using command
*ogr2ogr -f OCI OCI:user/password@ip/servicename -a_srs EPSG:2180
"C:Downloads\pas_ochronny\pas ochronny.shp"*

The file got uploaded successfully.But when im trying to extract the table
to shapefile im getting error.
I used the command
*
ogr2ogr -f "GEOJSON" "PRO.json" OCI:user/password@ip/servicename   -t_srs
EPSG:4326  -sql "SELECT * FROM  PAS_OCHRONNY"*
but im getting the error Can't transform coordinates, source layer has no
coordinate system.  Use -s_srs to set one.
ERROR 1: Terminating translation prematurely after failed
translation from sql statement.
 But when is used the command
*ogr2ogr -f "GEOJSON" "PROPERTYs.json"  OCI:user/password@ip/servicename
-s_srs EPSG:2180 -t_srs EPSG:4326  -sql "SELECT *  FROM PAS_OCHRONNY"*

Translation got successful.Why like this.
How to set the source layer coordinates while uploading.
Is there any way to reproject any source datum to EPSG:4326 without knowing
source.









--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OCI driver

jratike80
Hi,

I believe that OCI driver does not honour the -t_srs parameter of ogr2ogr.
Use the driver specific layer creation option -lco SRID=4326 instead when
saving data into Oracle https://gdal.org/drv_oci.html.

You asked if it is possible to convert data into EPSG:4326 without knowing
the reference system used in source . I ask How could it be possible? With a
good guess perhaps, sometimes, but generally not. If GDAL cannot the SRS
automatically from the data source then user must give it with -s_srs.

-Jukka Rahkonen-




san619 wrote

> i tried to extract shapefile data table from oracle to shapefile.
> But im getting error :
>
> *Can't transform coordinates, source layer has no
> coordinate system.  Use -s_srs to set one.
> ERROR 1: Terminating translation prematurely after failed
> translation from sql statement.*
>
> I tried exporting using command
> *ogr2ogr -f OCI OCI:user/password@ip/servicename -a_srs EPSG:2180
> "C:Downloads\pas_ochronny\pas ochronny.shp"*
>
> The file got uploaded successfully.But when im trying to extract the table
> to shapefile im getting error.
> I used the command
> *
> ogr2ogr -f "GEOJSON" "PRO.json" OCI:user/password@ip/servicename   -t_srs
> EPSG:4326  -sql "SELECT * FROM  PAS_OCHRONNY"*
> but im getting the error Can't transform coordinates, source layer has no
> coordinate system.  Use -s_srs to set one.
> ERROR 1: Terminating translation prematurely after failed
> translation from sql statement.
>  But when is used the command
> *ogr2ogr -f "GEOJSON" "PROPERTYs.json"  OCI:user/password@ip/servicename
> -s_srs EPSG:2180 -t_srs EPSG:4326  -sql "SELECT *  FROM PAS_OCHRONNY"*
>
> Translation got successful.Why like this.
> How to set the source layer coordinates while uploading.
> Is there any way to reproject any source datum to EPSG:4326 without
> knowing
> source.





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OCI driver

san619
But when i tried with postgresql and mssql spatial driver.I successfully
transformed the projections without mentioning -s srs i just used -t _srs it
was successful.
i used the command *ogr2ogr -f "GEOJSON" "PROPERTY_VIEW.json"
"MSSQL:Server=***,1433;uid=**;pwd=****;database=***" -t_srs EPSG:4326 -sql
"SELECT * from dbo.colorado_poi" -overwrite*
and the transformation was successful.But when i tried the same thing with
oci driver im getting error.What could be the reason.Or Is it possible to
get the source datum of the table by using any command in gdal.
Or is there any way to set the source datum while uploading the shapefile.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue with OCI driver

jratike80
Hi,

What I tried to say in my mail yesterday was that OCI driver may be a bit
different than for example PostGIS driver and it does not capture the -t_srs
parameter from ogr2ogr. Did you try my suggestion to add "-lco SRID=4326"?
Now if -t_srs cannot be utilised and if you did not use the OCI driver
specific SRID=4326 option then you will have data in Oracle in an undefined
SRS.

Reload your data and check with ogrinfo that GDAL can find the correct SRS
from your Oracle table. It is more convenient to reload into a new table
because if you use the same name for the table you must first drop the old
table and also remove the corresponding line from the USER_SDO_METADATA
table manually on the Oracle side before having a new try.

-Jukka Rahkonen-



san619 wrote

> But when i tried with postgresql and mssql spatial driver.I successfully
> transformed the projections without mentioning -s srs i just used -t _srs
> it
> was successful.
> i used the command *ogr2ogr -f "GEOJSON" "PROPERTY_VIEW.json"
> "MSSQL:Server=***,1433;uid=**;pwd=****;database=***" -t_srs EPSG:4326 -sql
> "SELECT * from dbo.colorado_poi" -overwrite*
> and the transformation was successful.But when i tried the same thing with
> oci driver im getting error.What could be the reason.Or Is it possible to
> get the source datum of the table by using any command in gdal.
> Or is there any way to set the source datum while uploading the shapefile.





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev