GeoServer
  1. GeoServer
  2. GEOS-639

Bad SRIDs when inserting Oracle spatial with WFS-T

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.2
    • Component/s: Oracle
    • Labels:
      None
    • Number of attachments :
      1

      Description

      From: Gerhard Sommer

      Hello,

      I am currently evaluating, if GeoServer (1.3.1) WFS-T can be used to edit data in Oracle Spatial (10g) feature types.

      My feature type is in EPSG:31286 coordinate system, but GeoServer seems to always insert features with Oracle SRID 0 into the Oracle Spatial layer.
      SRID = 0 is not defined in the USER_SDO_GEOM_METADATA table. Therefore, if I try to create a spatial index, this is not possible as the SRID values differ (I have 31286 in USER_SDO_GEOM_METADATA, corresponding to the EPSG code of my data). On the other hand, if I already have a spatial index on my data and try to insert geometry using GeoServer, I also get an the error message, that SRID of the geometry does not match the SRID of USER_SDO_GEOM_METADATA.

      What can I do to solve this problem? Or is this a bug in the current GeoServer version?

        Activity

        Hide
        Chris Holmes added a comment -

        Hi folks,

        with the hints posted previously to this list, I have generated a small
        patch that is working OK for my purposes. To explain, whenever a geometry
        has set an SRID of 0 (which does not exist in Oracle), now the code is
        assigning the NULL value for the SRID. Hence, the fix to me works fine as
        the SRID column contains NULL within user_sdo_geom_metadata view in our
        environment. I assume that most other people will also find a null value
        there, as most tools which load data into Oracle Spatial do not assign any
        SRID and leave this column NULL.

        A real bug fix should obtain the correct SRID value from the
        user_sdo_geom_metadata view and reproject the geometry to be
        inserted/updated if necessary.

        Please find attached a patched .jar file which I am currently using for
        geoserver + Oracle Spatial, as well as the changed source file (the changed
        line is 130).
        Diff:
        130c130
        < NUMBER SDO_SRID = srid == SDO.SRID_NULL ? null :

        > NUMBER SDO_SRID = (srid == SDO.SRID_NULL || srid == 0) ? null :

        Regards,

        Michael.

        Show
        Chris Holmes added a comment - Hi folks, with the hints posted previously to this list, I have generated a small patch that is working OK for my purposes. To explain, whenever a geometry has set an SRID of 0 (which does not exist in Oracle), now the code is assigning the NULL value for the SRID. Hence, the fix to me works fine as the SRID column contains NULL within user_sdo_geom_metadata view in our environment. I assume that most other people will also find a null value there, as most tools which load data into Oracle Spatial do not assign any SRID and leave this column NULL. A real bug fix should obtain the correct SRID value from the user_sdo_geom_metadata view and reproject the geometry to be inserted/updated if necessary. Please find attached a patched .jar file which I am currently using for geoserver + Oracle Spatial, as well as the changed source file (the changed line is 130). Diff: 130c130 < NUMBER SDO_SRID = srid == SDO.SRID_NULL ? null : — > NUMBER SDO_SRID = (srid == SDO.SRID_NULL || srid == 0) ? null : Regards, Michael.
        Hide
        Chris Holmes added a comment -

        Fixed. r20193 and r20194 in geotools. Using Michael's built jar in GeoServer.

        Show
        Chris Holmes added a comment - Fixed. r20193 and r20194 in geotools. Using Michael's built jar in GeoServer.

          People

          • Assignee:
            Chris Holmes
            Reporter:
            Chris Holmes
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: