Antwort: Re: [mapserver-dev] Point layers with Oracle driver

Fernando Simon fsimon at univali.br
Thu Feb 14 05:15:59 EST 2008


Hi Benedikt,
    Yes, this is a good workaround. For MapServer, if the sql/query
returns a MDSYS.SDO_GEOMETRY the driver can read and draw it.
    Maybe we need to test performance, but I believe that this
workaround don't degrade the performance.
    Best regards.

Fernando Simon


Citando umn-ms at hydrotec.de:

> Hi
> 
> I think Daniel asked, how Mapserver-users could deal with this
> issue in 
> the case, they have
> no direct influence on the way points are represented in the 
> oracle-database.
> 
> Maybe this is a workaround:
> ...
> DATA "GEOMETRY FROM (SELECT MDSYS.SDO_GEOM.SDO_CENTROID(shape) 
> geometry,... FROM MYTABLE  ) ...."
> ...
> 
> I didn't test it with mapserver. But the following SQL-statement
> delivers 
> "544347.756":
> SELECT  MDSYS.SDO_GEOM.SDO_CENTROID(
>                                        SDO_GEOMETRY(2001, 82247,
> NULL, 
>     SDO_ELEM_INFO_ARRAY(1, 1, 1), 
>     SDO_ORDINATE_ARRAY(544347.756, 4350295.7)),
>                                        0.05).sdo_point.x
> FROM DUAL;
> 
> It seems, that MDSYS.SDO_GEOM.SDO_CENTROID converts the way a point
> is 
> represented.
> 
> Bye
> benedikt Rothe
> 
> 
> mapserver-dev-bounces at lists.osgeo.org schrieb am 13.02.2008
> 03:18:12:
> 
> > Fernando,
> > 
> >     Good suggestion.
> > 
> > SQL> select * from tt;
> > 
> > GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, 
> SDO_ORDINATES)
> > 
>
--------------------------------------------------------------------------------
> > SDO_GEOMETRY(2001, 82247, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), 
> > SDO_ORDINATE_ARRAY
> > (544347.756, 4350295.7))
> > 
> > SQL> select sdo_geom.validate_geometry_with_context(geom,
> 0.000005) from 
> tt;
> > 
> > SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(GEOM,0.000005)
> > 
>
--------------------------------------------------------------------------------
> > TRUE
> > 
> >     This one geometry in a large table in which the point
> geometry 
> > representations vary between SDO_POINT and SDO_ORDINATES.  The
> original 
> > data stored its ordinates in SDO_POINT, but a frontend app
> inserts new 
> > geometries with ordinates in SDO_ORDINATES.  The app developers 
> > construct Oracle JGeometry objects in java, then insert then
> using JDBC. 
> 
> >   Obviously the process is pretty lax since the data is inserted
> as 
> > SDO_ORDINATES, and yet rendered identically by Oracle MapViewer.
> > 
> >     Here's some information on their oriented point extension: 
> > http://download-west.oracle.com/docs/cd/B19306_01/appdev.
> > 102/b14255/sdo_objrelschema.htm#CBBIGEFH
> > 
> > Thanks,
> > 
> > Dave
> > 
> > 
> > Fernando Simon wrote:
> > > Hi Daniel and David,
> > >     Well, about the SDO_POINT. The Mapserver driver just read
> the 
> point
> > > data from SDO_POINT, from the Oracle Spatial manual (page 2.2,
> for 
> point
> > > example and figure 2-6): "SDO_ELEM_INFO and SDO_ORDINATES are
> both 
> NULL,
> > > as required if the SDO_POINT attribute is specified." And the 
> SDO_POINT
> > > topic in the manual hint that you can just store points using
> the
> > > SDO_POINT attribute.
> > >     Maybe you can force the use of the
> > > SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT function to verify if
> the
> > > geometry is valid, if it returns true and Mapserver can't draw,
> we 
> have
> > > a bug :).
> > >     David, about the kind of the point that you wrote, the
> Mapserver
> > > can't draw it. I never head about it, I will read about it and
> other
> > > things for release 11 to check new features. Now a question for
> core
> > > developers, if I read angle data from database (like David
> wrote about
> > > the point) can I set the angle attribute for the layer? Will
> work, the
> > > angle?
> > >     We can check about this special kind of data, but I believe
> that
> > > Mapserver just need to draw the data/kinds/types defined in the
> 2-2
> > > table for SDO_ELEM_INFO.
> > >     Daniel, in my opinion the data that you report was wrong.
> You can
> > > write in the Oracle forum (in the OTN page) about it, the
> developers 
> of
> > > the Oracle Spatial read and reply there.
> > >     Best regards.
> > > 
> > > Fernando Simon
> > > 
> > > David Fuhry wrote:
> > >> Daniel,
> > >>
> > >> Point ordinates wouldn't ever be in SDO_ELEM_INFO; it only
> stores
> > >> metadata for how to interpret SDO_ORDINATES.
> > >>
> > >> I'm not sure what MapServer does, but Oracle MapViewer will
> render a
> > >> point if the ordinates are stored in either the SDO_POINT or
> the
> > >> SDO_ORDINATES substructure of SDO_GEOMETRY.
> > >>
> > >> Notably, 10g+ has a feature known as "oriented points", in
> which
> > >> SDO_POINT is null, and the (x,y[,z]) point ordinates are
> stored in
> > >> SDO_ORDINATES, and are followed by values (still in
> SDO_ORDINATES) 
> which
> > >> describe an angle, for obvious use in labeling.
> > >>
> > >> The correct behavior would be for MapServer to render the
> point at 
> the
> > >> location stored in SDO_ORDINATES iff the SDO_POINT is null.
> > >>
> > >> Thanks,
> > >>
> > >> Dave
> > >>
> > >>
> > >> Daniel Morissette wrote:
> > >>> Fernando,
> > >>>
> > >>> I've had someone report to me that when MapServer reads point
> layers
> > >>> from Oracle, it works fine if the coordinates are stored in
> the
> > >>> SDO_POINT, but it doesn't work if they are stored in
> SDO_ELEM_INFO 
> or
> > >>> SDO_ORDINATES which are apparently two other valid ways of
> storing
> > >>> point data.
> > >>>
> > >>> Are you aware of this issue? Is there a way around it or do
> you have
> > >>> any advice to provide to users who run into this problem?
> > >>>
> > >>> Thanks
> > >>>
> > >>> Daniel
> > >> _______________________________________________
> > >> mapserver-dev mailing list
> > >> mapserver-dev at lists.osgeo.org
> > >> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
> > >>
> > _______________________________________________
> > mapserver-dev mailing list
> > mapserver-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-dev
> 




-------------------------------------------------
  Univali - Webmail - http://webmail.univali.br


More information about the mapserver-dev mailing list