This discussion is archived
8 Replies Latest reply: Jul 4, 2013 2:40 AM by don123 RSS

projection

don123 Newbie
Currently Being Moderated


hi, please help me.

 

I need to transform geodetic data to projected data.

 

For UTM, the linear units are in meters.

Can I change the linear units supported (kilo meter) in sdo_dist_units while transforming ?

Do I need to create user defined coordinate system for this ?

Can I use sdo_cs.transform with user defined coordinate system defined with changed units?

 

 

Can I update geometry SRID directly ? If yes in which situation ?

 

regards

  • 1. Re: projection
    Stefan Jager Journeyer
    Currently Being Moderated

    Hi Don,

    don123 wrote:

     

    For UTM, the linear units are in meters.

    Can I change the linear units supported (kilo meter) in sdo_dist_units while transforming ?

    Yes, you should be able to. If the coordinate system you transform to has different units defined, Oracle should do that for you automatically.

    don123 wrote:

    Do I need to create user defined coordinate system for this ?

    Can I use sdo_cs.transform with user defined coordinate system defined with changed units?

    That really depends on your coordinate systems. Do you know which CS you data is in, and which one you need to transform to? They may already exist in Oracle's standard library, so you don't have to create your own.

    don123 wrote:

     

    Can I update geometry SRID directly ? If yes in which situation ?

    Yes you can:

    update <tablename> t set t.<geometry_column_name>.sdo_srid = <your SRID number>;

    But that will only work if the SDO_ORDINATES are already in the correct format. It will NOT work correctly if you want to go from geographic to projected for example. Look at the (approximate ;-) ) location where I live: Google reports that (in their own geographical coordinate system) as

    Lat: 52.647

    Lon: 5.058

    Whereas the same location (in my country's local projected coordinate system) is

    X: 132743

    Y: 517880

    Simply changing the SRID in this case would not work, because the numbers in the SDO_ORDINATES are way too different. They are also in different units, the Lat/Lon is degrees, where the X/Y is meter. Now because Google's coordinate system is very similar to WGS84, you could go from Google to WGS84 by simply updating the SRID (as long as you do not need accuracy smaller than 50m, at least).

    You can see this in action by trying this:

    select SDO_CS.TRANSFORM(
         SDO_GEOMETRY(2001,
                      28992,
                      SDO_POINT_TYPE(132743, 517880, NULL),
                      NULL,
                      NULL),
         4326) from dual;

    Note that there will be a difference in the results, because Google's coordinate system is not exactly WGS84, and SRID 4326 is WGS84. 28992 being the SRID for my local projection.

     

    HTH,

    Stefan

  • 2. Re: projection
    rpitts Newbie
    Currently Being Moderated

    Start with the easy one first

    Q> Can I update geometry SRID directly ? Yes SQL> update TABLENAME a set a.GEOMETRY_NAME.sdo_srid = NULL;

    for example, but not to do a transformation to another system specifically. generally to do maintenance. Its not something I would expect you to do very often...

     

    Q> Can I use sdo_cs.transform with user defined coordinate system defined with changed units?

          Yes you can

     

    For example  a user defined SRID 5000099

     

    SELECT 'Difference',SDO_GEOM.SDO_DIFFERENCE(op.shape, nfsb.shape, 0.05) shape, 

    ROUND(Sdo_Geom.Sdo_Area (Sdo_Cs.Transform (SDO_GEOM.SDO_DIFFERENCE(op.shape, nfsb.shape, 0.05),5000099), 1, 'unit=Acre'), 3) acres

    FROM OP01 op, OP02 nfsb

    WHERE etc etc ....

     

    Q> Can I change the linear units supported (kilo meter) in sdo_dist_units while transforming ?

    Not sure why you want to do this....  This is a legacy view from the Manual


    6.8.5 MDSYS.SDO_DIST_UNITS View

    The MDSYS.SDO_DIST_UNITS reference view contains one row for each valid distance UNIT specification in the well-known text (WKT) description in the coordinate system definition. The WKT is described in Section 6.8.1.1.

    The MDSYS.SDO_DIST_UNITS view is based on the SDO_UNITS_OF MEASURE table (described in Section 6.7.27), and it contains the columns shown in Table 6-32.

     

    My view is keep it simple ... But there is nothing to stop you having linear units of Km in a user defined CS.

     

    Hope that helps

  • 3. Re: projection
    don123 Newbie
    Currently Being Moderated

    Thanks Stefan

     

    My coordinate systems are available in dictionary, requires transformation from WGS 84 to UTM.

    I need to change the units mentioned in sdo_dist_units.

    I think sdo_cs.transform does not take input parameter of units.

     


  • 4. Re: projection
    rpitts Newbie
    Currently Being Moderated

    I would take care with Google to WGS84 by simply updating the SRID - you really have to understand your accuracy requirement at Stefan states....

    And why we have the

    use_case

    The name of the use case to be associated with the transformation. If you specify the string USE_SPHERICAL, the transformation uses spherical math instead of ellipsoidal math, thereby accommodating Google Maps and some other third-party tools that use projections based on spherical math.

     

    SDO_CS.TRANSFORM(

         geom IN SDO_GEOMETRY,

         use_case IN VARCHAR2,

         to_srid IN NUMBER

         ) RETURN SDO_GEOMETRY;

     

     

  • 5. Re: projection
    don123 Newbie
    Currently Being Moderated

    Thanks for the details.

     

    Can i pass the different UNITS parameter in sdo_cs.transform other than mentioned in WKT description.

    I dont see that in documentation on parameters.


  • 6. Re: projection
    don123 Newbie
    Currently Being Moderated

    hi

     

    When i try to transform layer with different units, i get following error.

    If i dont use unit parameter, it works fine.

     

     

    SQL> call sdo_cs.transform_layer('test', 'GEOMETRY', 'test_utm', 32630, 'unit=KILOMETER');

     

    ERROR at line 1:

    ORA-01722: invalid number

  • 7. Re: projection
    Stefan Jager Journeyer
    Currently Being Moderated

    Hi Don,

    SDO_CS.TRANSFORM_LAYER does not support the naming of units as you have tried it.

    don123 wrote:

    If i dont use unit parameter, it works fine.

    Because that's how it is supposed to work. A coordinate system has it's units predefined, because that is usually part of it's definition. For what you want to do, I would transform to 32630, then run a little procedure that sets the units of the ordinates to kilometers. Be aware though of your accuracy in this case. It is possible to set up your own UTM coordinate system with units as kilometers, but I tend to stay away from custom coordinate systems because when you exchange data, or upgrade your database, or move from the dev-database to the prod-database nothing works anymore because the coordinate system is not there. So my solution would be very simple: stick with what's there, then use a little post-processing to get what you need.

     

    Why do you need the ordinates in kilometers? Just out of curiosity ;-)

     

    HTH,

    Stefan

  • 8. Re: projection
    don123 Newbie
    Currently Being Moderated

    Thanks stefan

    I will try both methods.

    Still it (requirement) is not clear why other units.

     

    regards

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points