Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle Dialect #71

Open
mahmudkoc opened this issue Jun 12, 2017 · 13 comments
Open

Oracle Dialect #71

mahmudkoc opened this issue Jun 12, 2017 · 13 comments

Comments

@mahmudkoc
Copy link

Hi;
I want to use NHibernate Spatial With Oracle, Can I ?
Thanks

@andrerav
Copy link
Contributor

Hi @SehirBilisim,

We made an honest attempt to get the Oracle dialect working properly, but without improved support for user types in the Oracle ODP drivers, this is not possible. Sorry!

@Diaaz
Copy link

Diaaz commented Jun 14, 2017

NetTopologySuite has some code to convert mdsys.geometry to SdoGeometry. Maybe @SehirBilisim could take a look at that and implement the Oracle Dialect.

@peetw peetw reopened this Jun 29, 2017
@andrerav
Copy link
Contributor

@peetw Now this is a level of ambition I can admire ;) Do you have some ideas on how to move forward with this?

@peetw
Copy link
Collaborator

peetw commented Jun 29, 2017

@andrerav Haha, sorry to disappoint! I was merely re-opening based on @Diaaz's comment and hoping that maybe, just maybe, someone (perhaps @SehirBilisim? 😉) would see it in the future and run with it.

Plus it serves as pseudo-documentation for anyone else wondering whether it's supported.

@rightthgir
Copy link

@peetw hi, I saw this, https://github.com/mapspiral/NetSdoGeometry , helpful ?

@rightthgir
Copy link

@peetw I find a bug, public class OracleGeometryWriter
private void AddPolygon(SdoGeometry sdoGeometry, IPolygon polygon)

et = ElementType.INTERIOR_RING_STRAIGHT_SEGMENTS;
coords = polygon.InteriorRings[i - 1].Coordinates; ---> coords = polygon.InteriorRings[(int)i/3 - 1].Coordinates;

@rightthgir
Copy link

@peetw I found a bug.

oracle when Geomerty. srid = 0, oracle srid = null. so , I change like this

    public SdoGeometry Write(IGeometry geometry)
    {
        // TODO:
        //_builder.SetSrid(geometry.SRID);
        //WriteGeometry(geometry);
        //return _builder.ConstructedGeometry;

        //return null;
        var geom = this.WriteGeometry(geometry);

        if (geometry.SRID < 1)  // by  zhou yijun 2018-10-29
        {
            geom.sdo_Srid = null;
        }
        else
        {
            geom.sdo_Srid = geometry.SRID;
        }

        //
        return geom;
    }

@rightthgir
Copy link

private SdoGeometry WritePoint(IGeometry geometry)
{
var dim = this.GetCoordDimension(geometry);
var lrsDim = this.GetCoordinateLrsPosition(geometry);
var isLrs = (lrsDim != 0);
var coord = this.ConvertCoordinates(geometry.Coordinates, dim, isLrs);
var sdoGeometry = new SdoGeometry
{
GeometryType = (int)SDO_GTYPE.POINT,
Dimensionality = dim,
LRS = lrsDim,
sdo_Srid = geometry.SRID,
ElemArray = new[] { 1, (decimal)SDO_ETYPE.ETYPE_SIMPLE_POINT, 1 },
OrdinatesArray = coord
};
sdoGeometry.PropertiesToGTYPE(); // by zhou yijun
return sdoGeometry;
}

writePoint , writeWriteLineString , .........

I added this " sdoGeometry.PropertiesToGTYPE(); // by zhou yijun", so , this._sdo_gtype He can have a value ahead of time, so,I can use this class on my own。

@rightthgir
Copy link

now, I can use NHibernate.Spatial.Oracle.dll on my own.

don't forget change inner to public

@spatialbits
Copy link

spatialbits commented Jul 23, 2019

So just to be clear, the Oracle dialect doesn't work with Oracle as it stands?
I would need to make the modifications that @rightthgir has done?
If that's the case could we ask @rightthgir to submit a PR?

@peetw
Copy link
Collaborator

peetw commented Jul 25, 2019

@spatialbits I've not had any experience of working with it, so I can't say for sure. However, based on @andrerav 's comment, I doubt it does. We also don't currently release a NuGet package for it either.

We're always happy to accept PR's though if you do have success in getting it working :)

@spatialbits
Copy link

Thanks @peetw . For the time being we're OK with just the SQLServer dialect but Oracle may be needed in the future.
I note that there does appear to be a Nuget package for the Oracle spatial dialect: https://www.nuget.org/packages/NHibernate.Spatial.Oracle/4.0.3.4000-alpha1/

@peetw
Copy link
Collaborator

peetw commented Jul 29, 2019

@spatialbits np :) The pre-release version is not "official" and is based on a very old version of NHibernate (you'll see that it was released in July 2015). The code is currently in the repo, but we do not maintain it or release NuGet packages for it as part of a standard release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants