Exemple #1
0
        /**
         *
         * @return a Point Geometry as a point geometry
         * @throws MGeometryException
         */
        public static Point GetPointGeometry(IMGeometry lrs, double position)
        {
            Coordinate          c  = lrs.GetCoordinateAtM(position);
            ICoordinateSequence cs = lrs.Factory.CoordinateSequenceFactory.Create(new Coordinate[] { c });

            return(new Point(cs, lrs.Factory));
        }
 public static MultiMLineString GetLinearGeometry(IMGeometry lrs, double begin, double end)
 {
     MGeometryFactory factory = (MGeometryFactory) lrs.Factory;
     ICoordinateSequence[] cs = lrs.GetCoordinatesBetween(begin, end);
     MLineString[] mlar = new MLineString[cs.Length];
     for (int i = 0; i < cs.Length; i++) {
         MLineString ml = factory.CreateMLineString(cs[i]);
         mlar[i] = ml;
     }
     return factory.CreateMultiMLineString(mlar);
 }
Exemple #3
0
        public static MultiMLineString GetLinearGeometry(IMGeometry lrs, double begin, double end)
        {
            MGeometryFactory factory = (MGeometryFactory)lrs.Factory;

            ICoordinateSequence[] cs   = lrs.GetCoordinatesBetween(begin, end);
            MLineString[]         mlar = new MLineString[cs.Length];
            for (int i = 0; i < cs.Length; i++)
            {
                MLineString ml = factory.CreateMLineString(cs[i]);
                mlar[i] = ml;
            }
            return(factory.CreateMultiMLineString(mlar));
        }
        /*
         * (non-Javadoc)
         *
         * @see org.hibernatespatial.mgeom.IMGeometry#GetCoordinateAtM(double)
         */
        public ICoordinate GetCoordinateAtM(double m)
        {
            if (!this.IsMonotone(false))
            {
                throw new ApplicationException("MGeometryException.OPERATION_REQUIRES_MONOTONE");
            }

            ICoordinate c;

            for (int i = 0; i < this.NumGeometries; i++)
            {
                IMGeometry mg = (IMGeometry)this.GetGeometryN(i);
                c = mg.GetCoordinateAtM(m);
                if (c != null)
                {
                    return(c);
                }
            }
            return(null);
        }
 /**
  *
  * @return a Point Geometry as a point geometry
  * @throws MGeometryException
  */
 public static Point GetPointGeometry(IMGeometry lrs, double position)
 {
     ICoordinate c = lrs.GetCoordinateAtM(position);
     ICoordinateSequence cs = lrs.Factory.CoordinateSequenceFactory.Create(new ICoordinate[] { c });
     return new Point(cs, lrs.Factory);
 }